Re: [visad] Axis labels with Display side CoordinateSystem

Stefan et al.,

It is an interesting problem that I ended up solving numerically (similar to Newton's method for solving roots of an equation). I do not use a hashtable.

See:

https://github.com/Unidata/IDV/blob/axis/src/ucar/unidata/view/geoloc/MapProjectionDisplay.java#L680


Actually, looking at that code makes me realize I have to refactor it. The conditional logic therein is kludgy and unecesssary, but you get the point.

Note the solution does not always converge (around the poles) and this you need an "escape hatch".

There may be a better way of doing all of this. If so, I am open to your suggestions.

-Julien

On 3/23/12 7:13 AM, Don Murray wrote:
Hi Stefan-

On 3/23/12 2:08 AM, Stefan Below wrote:
i am using the MapProjectionDisplay for playing around with Display side
CoordinateSystem. Everything is working fine, except that i have no idea
how i can display the coordinates of the (UTM) CoordinasSystem on the
X/Y axis. Is it somehow possible to add a mapping between the
Display.Latitude/Longitude and Display.XAxis/Yxis? (p.e.
(Latitude,Longitude) -> (Northing,Easting))

Julien Chastang of the IDV group is working on this now for the IDV. There is no simple way, especially when the projection is not rectillinear. Basically, you would have to compute the UTM values at lat/lon points along the x and y axes and then use a custom Hashtable for a mapping of X/Y value to Easting/Northing.

You might try adding a data reference with just a GriddedSet of the Northing/Easting values and then map Easting to Display.XAxis and Northing to Display.YAxis. I'm not sure it would work if you had the set with a CoordinateSystem of (Latitude,Longitude) -> (Northing, Easting) but if that's easier, you could give that a try.

Don