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

Etienne Trimaille etienne.trimaille at gmail.com
Tue Jul 24 05:57:29 PDT 2018


It's the purpose of the QuickOSM default parser. It will not lose any
key/value, so you will have one column for each keys.

But if you load your file without plugins and not with the OSM core
provider in QGIS 2, I'm surprise that you got the "highway" key on the
"other_tags" field. I suspect you modified your own osmconf.ini.
According to the default file, "highway" must have its own field:
https://github.com/OSGeo/gdal/blob/master/gdal/data/osmconf.ini#L48

You can still use the default parser and use the whitelist field in
QuickOSM QGIS 2. It will parse only these OSM keys (separated by a comma).
If you have your own OSM file on your computer, when you open it with
QuickOSM (2 and 3), you can provide your custom OSMConf.ini file which
specify which OSM keys you want to parse.



2018-07-24 8:35 GMT-04:00 matteo <matteo.ghetta at gmail.com>:

> Hi Marco,
>
> thanks for the answer and the explanation.
>
> > 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.
>
> well I think that even if lossless the information are pretty much
> useless also.
>
> What I'm saying is that the old OSM core provider of QGIS 2 (download
> osm and convert osm to SpatiaLite) and the current QuickOSM plugin (both
> QGIS 2 and QGIS 3) stores all the information as well, having maybe a
> lot of columns empty, but still usable.
>
> Cheers
>
> 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 --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20180724/b6c32961/attachment.html>


More information about the QGIS-Developer mailing list