[Gdal-dev] [whatever] toWGS defintions

Frank Warmerdam warmerdam at pobox.com
Thu Aug 9 08:51:48 EDT 2007


Tomas R wrote:
> Do there exist any general source for correct [whatever] to WGS 
> definitions?
> 
> I have an application which by use of GDAL translates WGS coordinates to 
> and from [whatever] projection. I have it working with a few fully 
> defined WKTs but it is no fun searching the web after all WKTs I 
> possibly would need.
> 
> So I tried instead to define the Spatialreferences with EPSG-codes 
> instead of WKT. And as suspected the result wasn't what I had hoped for 
> since the EPSG lacked the toWGS information. The result in the 
> projection I tried (RT90 2.5 gon V, EPSG 3020) the transformation was 
> offset by approximately 200 meters west and 50 meters north.
> 
> Am I correct in that the error occurs because the EPSG-code do not 
> specify the toWGS? If I am correct - what approach do you suggest?
> 
> The goal of the application, which is written in C#, is to be able to 
> take any map the user provides, with or without geodata in it, and serve 
> it to another application which internally works with WGS84. That is my 
> application is to be able to set up and translate from a projection the 
> user selects to and from WGS84.
> 
> The Q is simple - any source for correct definitions of [whatever] toWGS 
> that I can use?
> Or can I make the EPSG-codes work? Or do they work but I have made an 
> error?

Tomas,

Some EPSG datum definitions do not have mappings to EPSG, but many do.
If EPSG has exactly one transformation to get to WGS84 for a datum, then
it should be incorporated into the WKT generated by OGRSpatialReference.
However, if there are more than one possibility the initialize-from-epsg
code chooses to play it safe, and use none of them rather than risk
picking one that is inappropriate to the situation and hide the fact that
it is guessing.

This is a questionable choice on my part.

Libraries like GeoTools take the approach of picking one of the available
transformations with some jiffy rules that they hope will pick better
ones.

But the core of the problem is that every TOWGS84 transformation for a
datum is at best an approximation.  Often several transformations
exist, and are applicable to particular regions, minimizing error in
that region.

Think that I *ought* to do:
  o Implement methods to get a list of all known transformations for
    a given datum with the descriptive name so that applications could
    offer the choice to the user.
  o Pick one by default when generating WKT for an EPSG coordinate system,
    ideally with some sort of hint that the towgs84 value is just one of
    several possibilities.

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    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list