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

Frank Broniewski frank.broniewski at gmail.com
Tue Nov 7 23:54:00 PST 2017


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.

HTH
Frank

Dipl. Geogr. Frank Broniewski
Waldhölzbacher Str. 51
66679 Losheim am See
06872 5090684
www.frankbroniewski.com

Von: Nikos Alexandris
Gesendet: Dienstag, 7. November 2017 16:15
An: gdal-dev at lists.osgeo.org
Betreff: [gdal-dev] Extracting keys & values from OSM Planet

Dear OSM experts,

a reproducible workflow that extracts specific tags from OSM's Planet
data set, includes:

1. downloading OSM Planet in form of a pbf file

2. convert pbf to o5m using `osmconvert`

3  extract areas of interest in separate `aoi_*.o5m` files, based on boundaries in form of .poly
files, using `osmconvert`

4. filtering for specific tags (i.e. highways), parallel tasks in 80 cores

```bash
# custom function for 'highway' tags
function osmfilterhighway { osmfilter $1 --drop-version --keep="highway=track =footway =bridleway =path" > $(basename $1 .o5m)_highway.osm; }
export -f osmfilterhighway

# filter
find . -type f -name \*aoi*.o5m |parallel -j80 osmfilterhighway {}
```

1. Is it any better using GDAL's `osmconf.ini` "method" [0],
over `osmconvert` and `osmfilter`, in terms of reliability/speed etc.?

2. Is OGR handling well the conversion from .osm to ESRI Shapefiles?

3. What is the way to split "other_tags" in multiple new fields *when*
knowing exactly which tags are contained and should be obtained?

Thank you for any help,

Nikos


[0] https://svn.osgeo.org/gdal/trunk/gdal/data/osmconf.ini

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20171108/3021f4b5/attachment-0001.html>


More information about the gdal-dev mailing list