[gdal-dev] Extracting keys & values from OSM Planet

Nikos Alexandris nik at nikosalexandris.net
Wed Nov 8 02:38:18 PST 2017


Frank Broniewski:

>Hi Nikos,
>
>I am using a similar approach to yours to extract data from OSM files
>to a GIS format. I chose Spatiallite as a format since it is superior
>to the Shapefile format in all areas.  FYI here’s what I do:

>osmconvert -b="5.5,49,8,50.5" -o=saarland.osm.pbf "europe-latest.osm.pbf"

>ogr2ogr --config OSM_CONFIG_FILE /home/frank/gdal/osmconf.ini -f SQLite -dsco SPATIALITE=YES -progress -gt 65536 -t_srs "EPSG:31466" >/tmp/saarland.sqlite /tmp/saarland.osm.pbf

>Please note the “–config” switch for a custom osmconf.ini. With that
>you can copy the config to a custom location and have several configs
>for many use cases.

Thank you Even and Frank!

I will likely adopt the `osmconf.ini` method.

@Frank, I would go a step further if time permits. A function or script that
takes something like `layer=lines` and
`keys="track,footway,bridleway,path"` as input parameters and outputs the
custom configuration file.

From reading the driver's manual [0], there is a hint about the spatial,
filtering resulting in lines or polygons missing vertices. Is this a/the
reason, to stick to `osmconvert` for extracting areas of interest?

Thank you for your (invaluable) time, Nikos

[0] http://www.gdal.org/drv_osm.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20171108/18fcf3db/attachment.sig>


More information about the gdal-dev mailing list