[gdal-dev] how to test for version number in python with gdal 1.10 ?

Etienne Tourigny etourigny.dev at gmail.com
Wed Jan 16 08:07:37 PST 2013


ok merci.

It might be good to write this somewhere? Not sure where though,
perhaps the gdal/ogr wiki page?

Etienne

On Wed, Jan 16, 2013 at 1:40 PM, Even Rouault
<even.rouault at mines-paris.org> wrote:
>
>> The following seems to work using VERSION_NUM:
>>
>> in 1.10dev:
>> >>> gdal.VersionInfo("VERSION_NUM")
>> '1100000'
>> >>> print( int(gdal.VersionInfo("VERSION_NUM")) >= 1900 )
>> True
>> >>> print( int(gdal.VersionInfo("VERSION_NUM")) >= 1100000 )
>> True
>>
>> and in 1.9.2:
>> >>> print( int(gdal.VersionInfo("VERSION_NUM")) >= 1900 )
>> True
>> >>> print( int(gdal.VersionInfo("VERSION_NUM")) >= 1100000 )
>> False
>
> This is actually what I've used recently in
> swig/python/samples/ogr_layer_algebra.py
>
>>
>>
>> thanks,
>> Etienne
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>
>
>


More information about the gdal-dev mailing list