[Gdal-dev] Small issue with SetUTM()

Frank Warmerdam warmerdam at pobox.com
Tue Apr 1 09:33:25 EST 2003


VTP wrote:
> In the file: ogrspatialreference.cpp
> In the method: OGRSpatialReference::SetUTM()
> 
> It sets the descriptive name string ("PROJCS") if it was previously set to
> "unnamed".  But, it is valid (and common) to call SetUTM() on a project
> which is already UTM, e.g. to change the zone from 4 to 5.  In this case,
> the name is not updated (e.g. name remains "zone 4", even though the
> projection is correctly set to zone 5.)
> 
> I think a simple solution would be to not do the test:
>     if( EQUAL(GetAttrValue("PROJCS"),"unnamed") )
> I can't think of a case where you wouldn't the name string set.

Ben,

The SetUTM() method is intended to be roughly analygous to the other
direct projection parameter setting routines like SetTM() or SetLCC().
None of these set the descriptive string at all (except to unnamed).
The SetUTM() just sets the description as a convenience in cases where
I am convinced in can do no harm.

However, in some uses of SetUTM() the applicatioin may have already
set their preferred projection name string and based on the SetUTM()
docs they have no reason to expect SetUTM() to reset it on them.

An application wanting SetUTM() to also set a name could call
SetNode("PROJCS","unnamed") initially to ensure SetUTM() will set the name
to something nice.

I will clarify the SetUTM() documentation, but not change the behaviour.

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