[QGIS-Developer] Reading OSM data from .osm file

Dr. Marco Lechner mlechner at bfs.de
Tue Jul 24 04:13:03 PDT 2018


Hi Matteo,

I guess you are missing an understanding for OSMs data model. OSM is
very flexible in adding attributes to a feature by adding key/value
pairs. If this is to be represented in a GIS data away (table) you have
to convert the data importing just relevant keys (each becoming a
column), which results in loss of some attributes, or you can use
something like hstore in postgresql [1] meaning you store the set of
key/value pairs (or dictionary in python-terms) in one column. This is
lossless and seems to be what is used here.

Marco

[1] https://www.postgresql.org/docs/9.3/static/hstore.html

Am 24.07.2018 um 12:57 schrieb matteo:
> Hi all,
> 
> downloading an osm file from https://www.openstreetmap.org and loading
> it in QGIS results in perfect spatial positions but the attribute data
> are read wrong.
> 
> Wrong means that there are only 2 columns: "osm_id" with correct numbers
> of feature ids and another nameless column that contains all the other
> information like: "crossing"=>"traffic_signals","highway"=>"crossing"
> 
> Seems that the parser is not working correctly?
> 
> To reproduce the problem:
> 
> 1. https://www.openstreetmap.org
> 2. Click on Export in the top left corner
> 3. click on Export in the new tab
> 4. open the osm file in QGIS
> 
> Someone confirms? Should I open a ticket?
> 
> Thanks to all
> 
> Matteo
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0xCD250CA0D733400E.asc
Type: application/pgp-keys
Size: 3303 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20180724/cb6b4df3/attachment-0001.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5122 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20180724/cb6b4df3/attachment-0001.bin>


More information about the QGIS-Developer mailing list