[Gdal-dev] IsProjected and IsGeographic

Frank Warmerdam fwarmerdam at gmail.com
Wed Aug 3 22:47:15 EDT 2005


On 8/3/05, Craig Miller <craig.miller at spatialminds.com> wrote:
> Frank,
> 
> I just wanted to verify that my code isn't going to fail on some oddball
> case.  :-)  Is it always true that if an SRS is not Geographic that it will
> be Projected and that if an SRS is not Projected that it is Geographic?
> 
> E.g.
> 
> Assert(
> 
> (OGRSpatialReference::IsGeographic() == FALSE &&
> OGRSpatialReference::IsProjected() == TRUE)
> ||
> (OGRSpatialReference::IsProjected() == FALSE &&
> OGRSpatialReference::IsProjected() == TRUE)
> );

Craig,

Currently there is also a third type of SRS indicated by the IsLocal()
method.  In the future there may be additional types such as a compound
coordinate system (one that defines the vertical datum).  So, no, it is
not wise to assume that a coordinate system is either projected or
geographic if you wish to operate with complete generality.

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