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

Nikos Alexandris nik at nikosalexandris.net
Mon Nov 20 06:48:20 PST 2017


* Even Rouault <even.rouault at spatialys.com> [2017-11-07 22:37:02 +0100]:

>> 2. Is OGR handling well the conversion from .osm to ESRI Shapefiles?
>
>Yes, but within the limits ot the shapefile, and particularly .dbf format: limitation to 254
>characters for field values, 10 characters for field names... which are easily violated by
>OSM extracts.
>
>Spatialite, GeoPackage, PostGIS etc. would be better choices as output format
>
>>
>> 3. What is the way to split "other_tags" in multiple new fields *when*
>> knowing exactly which tags are contained and should be obtained?
>
>Edit osmconf.ini to add in the attributes= settings the tag names you're interested in.
>
>Even

Dear List,

in a custom .ini file, under the [points] layer, an `attributes=`
instruction set of values that includes `natural,cave_entrance` (key and
value under OSM's Natural key), well extracts for the points layer some
existing nodes which bear the tag `natural:cave_entrance`.

It is not required, as far as I understand the documentation, to include both
the parent key and any values (under it) of interest. Perhaps it may be
practical to have the attributes of interest split in a separate column.

The command I tested, for example, is:

```
ogr2ogr --config OSM_CONFIG_FILE custom.ini -f SQLite -dsco SPATIALITE=YES -gt 65536 -progress output.sqlite source.osm
```

While this is sufficient for the work I am doing (I can filter
`cave_entrance`s out from the `natural` column in the `output.sqlite` file), I
wonder why the entries for some nodes correctly bear the string
`cave_entrance` in the `natural` column, yet the `cave_entrance` column
itself is empty for the same entries.

Thank you for any hints, Nikos
-------------- 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/20171120/c702302b/attachment.sig>


More information about the gdal-dev mailing list