[gdal-dev] OGR API with an OSM file

Even Rouault even.rouault at mines-paris.org
Mon Jun 17 15:45:19 PDT 2013


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


More information about the gdal-dev mailing list