3

I noticed that downloaded osm data do not have the source tag displayed in openstreetmap query:

For example: https://www.openstreetmap.org/way/95462202

enter image description here

Once extracted as .pbf or .bz2 from Geofabrik and converted to .osm, source tag is not in QGIS

enter image description here

It looks like a simple question but I am not too familiar with OSM data and workflows and I believe the source tag is helpful.

In addition to my question, I set the osmconf.ini file, actually to_be_modified_osmconf.ini file in the AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\QuickOSM\resources\ogr folder and nothing changed. It looks like QGIS is not using this file for environment parameters

enter image description here

And I have no clue where such environment parameters are found and used by QGIS

enter image description here

QGIS actually looks into C:\Program Files\QGIS 3.24.3\share\gdal for the osmconf.ini file. This is shown in Settings > Options > Current environment variables in GDAL_DATA variable. Strangely, Windows Explorer could not find the osmconf.ini in this location!

enter image description here

It is all ok now and the 'source' tag is shown

enter image description here

Fantastic!

Just a little detail, how QGIS can deal with unicode characters not displaying correctly? Géodonnées - Etat de Vaud displays as Géodonnées - Etat de Vaud

1 Answer 1

6

The GDAL OSM driver that is used for converting data from .pbf is documented in https://gdal.org/drivers/vector/osm.html. The configuration file osmconf.ini controls which tags will be converted. You can find that file from your computer from gdal_data directory. The default osmconf.ini can also be found from GitHub https://github.com/OSGeo/gdal/blob/master/data/osmconf.ini.

You can see that some tags are intentionally ignored because they are considered to have less value than additional weight for average users.

# keys that should NOT be reported in the "other_tags" field
ignore=area,created_by,converted_by,source,time,ele,note,todo,openGeoDB:,fixme,FIXME

Edit your local osmconf.ini file and you will get the source tags. Notice that the setting is per layer and appears in 6 places in the osmconf.ini file.

5
  • I only found to_be_modified_osmconf.ini file in the AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\QuickOSM\resources\ogr folder. I made the required changes to get the source tag but nothing changed. Is this file somewhere else? The osmconf.ini do not exist in my install... Although, imported tags from osm must find their parameters somewhere...
    – Vincenty
    Commented Jun 7, 2022 at 20:20
  • You should have GDAL installed as well. Does SET GDAL_DATA from your command line show anything?
    – user30184
    Commented Jun 7, 2022 at 20:23
  • You can also use QGIS Options-System-Current environmental variables for finding out the location of GDAL_DATA.
    – user30184
    Commented Jun 7, 2022 at 20:34
  • Thanks. In Command Line, Set GDAL_DATA is not recognized. As for QGIS Options-System-Current environmental variables, I put a screenshot above and I cannot find anything like osmconf.ini. Although, QGIS must look somewhere for these variables...
    – Vincenty
    Commented Jun 8, 2022 at 9:40
  • To be sure, the QGIS Current environmental variables does not have variable "GDAL_DATA" set? The screenshot is scrolled only to APPDATA.
    – user30184
    Commented Jun 8, 2022 at 10:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.