Re: Map projections

Hi Doug-

Doug Lindholm wrote:
> I've attempted what I thought was the quick and dirty solution to my
> Lambert map projection problem given my limited understanding of
> visad.CoordinateSystem. My attempts to use
> visad.data.hdfeos.LambertConformalConic in a way similar to
> PolarCoordinateSystem in Test11 was not fruitful so I took the following
> approach:
> 
> construct my terrain field: (lon,lat) -> alt
> 
> construct a visad.data.hdfeos.LambertConformalConic
> 
> extract the samples of my domain set and run them through
> LambertConformalConic.fromReference() thus creating a new domain set of
> (x,y).
> 
> construct a field on this new set assigning the original alt values.
> 
> display mapping x and y to the Axes.

You are doing the hard work that VisAD will do for you automagically.
The basic problem you have is that the reference RealTupleType for
LambertConformalConic is lon, lat and that is what your data are in
and you want to have a CS where X,Y is the reference. However, there
is a class visad.InverseCoordinateSystem that should allow you to create
a CS with X,Y as the reference, using the LCC CS as input.  It basically
switches the toReference and fromReference methods.

So, if you construct an InverseCoordinateSystem:

    InverseCoordinateSystem ics = 
      new InverseCoordinateSystem(
        RealTupleType.SpatialCartesian2DTuple, myLCCCS);

and apply that to your domain set, it should do all the work for you instead
of you having to extract the values manually and run them through the fromRef
method.

Let me know if this doesn't work for you. (I'm swamped, otherwise I'd code this
up for you.

Don


  • 2001 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: