[Gdal-dev] OGRCoordinateTransformation::Transform problem

Frank Warmerdam warmerdam at pobox.com
Thu Oct 7 23:49:05 EDT 2004


Patrick Dooley wrote:
> I have two issues.  I would first like to set up a geocentric 
> OGRSpatialReference source as opposed to any specific datum.

Patrick,

While the underlying PROJ.4 library supports geocentric coordinate
systems, it appears I have not propagated that support into the
OGRSpatialReference at this time.

> I am currently attempting to convert WGS84 lat lon coordinates to UTM 
> coordinates.  However when the lat lon coordinates falls outside the 
> valid range of the UTM zone,  I get invalid utm coordinates.  However 
> the transform() method reports through its error handling that the 
> conversion was successfull.  

The transverse mercator math used in PROJ.4 degrades very seriously
when you get far away from the central meridian (say 30 degrees for
instance).  How far out of the zone are you?

In situations where the accuracy of the math degrades but can still
be evaluated the projection operation will generally seem to succeed
even if the results may not be very useful.

> I did think of doing the inverse conversion to see if the resulting lat 
> lon coordinates match the input, but that is a hack.  I was hoping that 
> there might be a isValidPoint() method on the OGRSpatialReference object 
> but I didn't find any. 

I'm afraid not.  Your suggestion of projecting back is a respectible
(if hacky) way of identifying whether the equations have broken down
pretty badly.

You might also want to raise this issue on the PROJ.4 list where you
will find folks with a deeper understanding of the projection issues.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list