Hank Fisher wrote:
> I was wondering if anyone is doing any 2-D applications
> involving different map projections. I am able to do the
> coordinate transformations from one projection to another
> (i.e. flat lat/long to Lambert Conformal) but I am unsure
> how to map that onto a display. Anybody have any tips or
> examples they are willing to share?
Another example, although more complex than what Bill mentioned, is contained in
the ShowNCEPModel.java example in the visad/jmet directory. This uses the
GRIBCoordinateSystem class to make the transformations from grid (row,col) <-->
(lat/lon), and the 'grid' coordinate RealTypes are usually mapped to the
Display.Xaxis and Display.Yaxis. The purpose in doing these within this
application is to draw a basemap (the coordinate of which are given in lat/lon
You'll note that the instance of GRIBCoordinateSystem is created in
NetcdfGrids.java, but is then used in ShowNCEPModel's doBaseMap() method to
create the set of line segments. This information is in the domain set that is
fetched from the instance of NetcdfGrids and passed into BaseMapAdapter's
setDomainSet() method, so that any CoordinateSystem could potentially be used.
A more straight-forward example might be in visad/data/mcidas/TestArea.java,
starting around line 260 or so. Here the transform is set up for GVAR navigation
(GOES satellite projected onto linear x,y axes). Again, the goal of the
transform is only to draw a basemap from a list of lat/lon pairs.
In both cases, the transform is actually done in the BaseMapAdapter class by
calling the fromReference() method of the CoordinateSystem. The resulting x,y
pairs are put into Gridded2DSets which are then collected together as on VisAD
UnionSet for rendering. Previously, the RealTypes of the domain (x,y for
example) have been added to the display.
Hope that helps.
Tom Whittaker (tomw@xxxxxxxxxxxxx)
University of Wisconsin-Madison
Space Science and Engineering Center