Re: Tuple vs. FieldImpl displays

Hi Don,

> I was doing some work with DEM data and was trying to show
> two 7.5 minute DEM's for Mt. Rainer (east side, west side)
> to create a more complete view.
>
> We are using the geotransform package for UTM->lat/lon conversion
> and my FlatField for each DEM looks like:
>
> (UTM_easting, UTM_northing) -> (Altitude)
>
> I create a UTMCoordinateSystem for each section which may
> be different since they could lie in different UTM zones.
> I then create a RealTupleType of (UTM_easting, UTM_northing)
> and pass in the CS on the constructor.  I use this RTT
> as the MathType of my domain set.
>
> My first thought was to create a FieldImpl of:
>
> (index) -> ((UTM_easting, UTM_northing) -> (Altitude))
>
> and the samples of the FieldImpl would just be each of
> the DEM FlatFields.  However, I thought I would run into
> an error if I created the FunctionType with the MathTYpe
> of one of the FlatFields and then tried to call setSample
> on the FieldImpl, because the MathType of the other FlatField
> would not be the same since it had a different CoordinateSystem.
> (I've since found this isn't a problem and have other ways
> to work around it.)
>
> So, my initial solution was to create a Tuple of the two
> FlatFields and then use that as the Data object for my
> DataReference.  When I did this, I ended up with only one
> of the FlatFields being rendered (the second in the Tuple).

This may be a bug. As long as both FlatFields in the Tuple
have MathTypes whose RealTypes are appropriately mapped
they should both be visible.

> So, I tried to do this with a FieldImpl instead and found
> that it worked (RealTupleTypes must be equal even if they
> don't have the same CS?) and when I used the FieldImpl,
> I got both halves of Mt. Rainier to show up.  Thinking
> this was some problem with my CS, I removed that from
> the equation and found that this happens in any case.
>
> I've attached a small test program that shows the behavior.
> Is this a bug or a feature?

The deal with CoordinateSystems (as with Units) is that
the CS in the actual data may use a different CS than
the RealTupleType, as long as they both have the same
reference RealTupleType. That it, in:

  (index -> ((UTM_easting, UTM_northing) -> (Altitude)))

if the RealTupleType (UTM_easting, UTM_northing) has a
CS with reference (Latitude, Longitude) then all the
FlatFields in the range of index must have CS's with
reference (Latitude, Longitude). The code in FieldImpl
doesn't check to make sure the RealTupleType and data
CS's have the same class, only the same reference.

This is very much a feature, to allow things like
satellite navigation and pressure coordinates to change
over time.

Cheers,
Bill


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