Hey Ross,

On Jul 4, 2012, at 3:06 PM, Ross Laidlaw wrote:

> Hi everyone,
> 
> I've been looking into developing some unit tests for the core classes
> in sis-core.  While developing the unit tests, I noticed that the
> LatLon constructor can accept any valid double values for its latitude
> and longitude arguments.  Is this ok or should there be some
> constraints, checks or conversions performed on the arguments to the
> constructor?

I think it's OK IMHO, mainly due to Adam's point about Coordinate Reference
Systems (CRSs).

> 
> In the LatLon class there's a 'getNormLon()' method that returns the
> longitude attribute normalized to a value between -180.0 and 180.0.
> This implies that it's ok for the constructor to accept longitude
> arguments outside this range and for the longitude attribute to have a
> value outside this range.

Yep it has to do with things like whether or not someone picked e.g., 
a 360 Lat Lon grid, or a 180 Lat Lon grid, or something else.

> 
> On the other hand, it looks like the getShiftedLat() and
> getShiftedLon() methods assume that the latitude and longitude
> attributes for a LatLon object should be within the standard ranges
> (i.e. between -90.0 and 90.0 for latitude and -180.0 to 180.0 for
> longitude).
> 
> So I was thinking - perhaps we could accept any values for the
> constructor arguments, but then normalize them in the constructor so
> that the attributes are stored as normalized values.  Alternatively,
> we could update the getShiftedLat() and getShiftedLon() methods to
> check/normalize the attributes before shifting them.

I think we should accept any values, and give the user the option to 
decide if they want to normalize them. But maybe we should associate
the normalization methods with particular coordinate reference systems,
and furthermore, maybe we should just make CRSs official first class 
citizens in future versions of SIS. Thoughts? 

Looking at Proj4J will probably help spark some ideas so I'd be curious
to know your opinions of that.

> 
> Any thoughts?  Apologies if I've completely misunderstood any of these 
> methods!

See above and you are doing great!

Cheers,
Chris

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Senior Computer Scientist
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 171-266B, Mailstop: 171-246
Email: [email protected]
WWW:   http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Assistant Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Reply via email to