[gdal-dev] How do I tell if an OGRSpatialReference has been initialized?

Frank Warmerdam warmerdam at pobox.com
Tue Jul 23 10:49:50 PDT 2013


David,

In addition to Etienne's suggestion of exportToWkt() and check for
emptiness, you might also consider calling Validate() which will return
FALSE if it believes the coordinate system is invalid, which would include
empty coordinate systems.  The main downside to this is that some useful
coordinate systems may be identified as invalid because they don't fit a
standard pattern.

Best regards,
Frank


On Tue, Jul 23, 2013 at 8:59 AM, Etienne Tourigny
<etourigny.dev at gmail.com>wrote:

> You could try calling exportToWkt() and test if the string is null or
> empty (although I haven't tested that) - make sure to free the string
> afterwards.
>
> Etienne
>
>
> On Mon, Jul 22, 2013 at 8:44 PM, David Strip <gdal at stripfamily.net> wrote:
>
>> Given an OGRSpatialReference class object, how do I tell if it's been
>> initialized to anything? (ie,clear() was called or else was constructed
>> with a null string an no further action was taken to set the SRS?)
>> I've looked over the interface and can't spot anything that tells me it's
>> in a clear state, but of course I might have missed it.
>>
>> Thanks
>> David
>>
>>
>> ______________________________**_________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/**mailman/listinfo/gdal-dev<http://lists.osgeo.org/mailman/listinfo/gdal-dev>
>>
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



-- 
---------------------------------------+--------------------------------------
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 Software Developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20130723/54b32643/attachment-0001.html>


More information about the gdal-dev mailing list