[gdal-dev] Hstore errors with OSM driver

Jukka Rahkonen jukka.rahkonen at mmmtike.fi
Mon May 27 01:56:04 PDT 2013


Hi,

I got some error messages when converting OSM data into PostGIS by using
hstore for saving the additional tags. My command was:

ogr2ogr -f PostgreSQL PG:"dbname='gis' host='server' port='4326' user='user'
password='passwd'" germany.osm.pbf -gt 20000 -progress --config
OSM_COMPRESS_NODES YES  -lco DIM=2 -lco geometry_name=geoloc -lco fid=fid
-lco COLUMN_TYPES=other_tags=hstore --config PG_USE_COPY YES

I believe that issues are easy to reproduce by downloading germany.osm.pbf
of any other biggish country extract from http://download.geofabrik.de.

There two different types of errors:

ERROR 1: COPY statement failed.
ERROR:  Unexpected end of string
CONTEXT:  COPY points, line 9241, column other_tags: "addr:housenumber=>"

ERROR:  Syntax error near '8' at position 22
CONTEXT:  COPY points, line 17629, column other_tags: "opening_hours=>Mo-Fr.
8.00-18.00"

ERROR:  Syntax error near 'S' at position 45
CONTEXT:  COPY lines, line 17840, column other_tags:
"addr:interpolation=>,addr:street=>"Lintacher Straße""

I have a few questions:

I guess that the "Unexpected end of string" comes from keys without values.
Does the error mean that no tags were saved for the failing feature?

What is the reason for the syntax errors and can user do anything for
avoiding them?

How can I find the suspicious features from the PostGIS tables? Error
message gives a line number but it does not seem to have a corresponding
field in the resulting database table. Field "fid" was my favourite but
tracing by fid->osm_id did not lead to a correct feature.

-Jukka Rahkonen-







More information about the gdal-dev mailing list