Le lundi 17 juin 2013 17:55:19, Etienne Trimaille a écrit :
> Hi,
> 
> I'm trying to use Python API with an OSM file.
> 
> According to the documentation of OSM driver, we can use a custom
> OSM_CONFIG_FILE.
> http://www.gdal.org/ogr/drv_osm.html
> 
> However, I can't find how to use my own config file with the API.
> 
> from osgeo import ogr

from osgeo import gdal
gdal.SetConfigOption('OSM_CONFIG_FILE', '/path/to/your/osmconf.ini')

> 
> osmfile = 'test.osm'
> driver = ogr.GetDriverByName('OSM')
> datasource = driver.Open(osmfile)
> layer = datasource.GetLayer()
> 
> Is there a way to use it ?
> 
> Thanks
> Regards
> Etienne

-- 
Geospatial professional services
http://even.rouault.free.fr/services.html
_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to