Re: [visad] Axis labels with Display side CoordinateSystem

The Hashtable I was referring to is the labelTable variable in Julien's code in the updateLonScale method. You calculate the Easting/Northing values at each X/Y point using some method like Julien does and store the results in a Hashtable which gets used in the AxisScale.setLabelTable.

Don

On 3/23/12 10:37 AM, Julien Chastang wrote:
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

_______________________________________________
visad mailing list
visad@xxxxxxxxxxxxxxxx
For list information, to unsubscribe, visit:
http://www.unidata.ucar.edu/mailing_lists/

--
Don Murray
NOAA/ESRL/PSD and CIRES
303-497-3596
http://www.esrl.noaa.gov/psd/people/don.murray/