[Gdal-dev] Radians as units in OGRSpatialReference and OGRProj4CT
Frank Warmerdam
warmerdam at pobox.com
Mon Dec 16 09:26:00 EST 2002
David E. Knight wrote:
> Hello, I have built a GIS sytem in which I use radians as my unit of
> measurement. To serve that purpose I created a OGRSpatialReference to
> represent a radian based projection. Here is the code that I use...
David,
I have recently (last week) modified OGRProj4CT to properly honour the
UNITS value on the GEOGCS. As you have observed it was not previously
supported. I would also note that since the weekend I have been working
on reworking some core assumptions about OGRSpatialReference, and while
this is ongoing OGR may be unstable.
In particular, it seems I had made some mistakes about the units for the
PARAMETER[] fields in a PROJCS. Apparently all the linear values are
actually supposed to be in the linear units of the PROJCS, and all the
angular values are supposed to be in the angular units of the GEOGCS. Also
any longitude values are relative to the prime meridian, not greenwich.
What this means for you, is that if you set your GEOGCS units to radians,
you will also need to supply any angular projection parameters in radians.
However, this upgrade is not yet completely in place so be wary.
There will also be new methods (GetNormProjParm(), and SetNormProjParm())
on the OGRSpatialReference which allow getting and setting projection
parameters as if the old assumptions (linear meters, angular degrees
relative to greenwich) still held.
PS. It is inappropriate to label your "radian" WGS84 GEOGCS as having
AUTHORITY["EPSG",4326] because you have altered the angular units from
the EPSG defined coordinate system. When you include the authority fields
a consuming application is free to ignore the rest of the definition and
assume what it knows about 4326 holds for the spatial reference. It isn't
likely to affect OGRSpatialReference operations but it isn't correct in
general.
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