[gdal-dev] Why are fields required in osmconf.ini file?

Rahkonen Jukka (MML) jukka.rahkonen at maanmittauslaitos.fi
Fri Nov 18 01:33:26 PST 2016


You need to have both: include all_tags in osmconf.ini and define with the ogr2ogr command that field “all_tags” in PostGIS should be initialized as hstore. If you do not define column type all_tags will probably become text type column. Make a test and you will see it.

-Jukka Rahkonen-

Djordje Spasic wrote:

Re: [gdal-dev] Why are fields required in osmconf.ini file?

Thank you for the useful reply Jukka!

The command you gave me:

ogr2ogr -f PostgreSQL "PG:dbname=osm" test.pbf -lco
COLUMN_TYPES=all_tags=hstore
does the same thing as "all_tags=yes" in the osmconf.ini file:

# uncomment to create "all_tags" field. "all_tags" and "other_tags" are exclusive
all_tags=yes
?

If not, then what is the difference between these two?

On Friday, November 18, 2016 8:55 AM, jratike80 <jukka.rahkonen at maanmittauslaitos.fi<mailto:jukka.rahkonen at maanmittauslaitos.fi>> wrote:

georges wrote

> Thank you for the quick reply Even!
>
> So this required predefined set of fields is a necessary step for any .osm
> file conversion with ogr2ogr.exe?
> Not only conversion from .osm to .shp?
> But also to .pbf, geojson etc. ?


Only exception and highly recommended if you want to get all the tags is to
use PostGIS and "all_tags" which puts everything into hstore:

ogr2ogr -f PostgreSQL "PG:dbname=osm" test.pbf -lco
COLUMN_TYPES=all_tags=hstore

-Jukka Rahkonen-



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/gdal-dev-Why-are-fields-required-in-osmconf-ini-file-tp5296342p5296397.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org<mailto:gdal-dev at lists.osgeo.org>
http://lists.osgeo.org/mailman/listinfo/gdal-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20161118/3b37a84c/attachment-0001.html>


More information about the gdal-dev mailing list