Friday 21 September 2018

gdal - Creating Spatialite DB from Swedish OSM


I have just started to use GDAL/OGR and I am trying to create a spatialite DB from OSM data. I am using a cut of the Swedish OSM data downloaded from Geofabrik in .osm format. I have used the following command line:


ogr2ogr -f "SQLite" SwedenOSM.sqlite sweden-latest.osm


This created a spatialite db but I also got the following error: ERROR 1: Too many tags in relation 54224 this is repeated 12 times.


When I try to add the spatialite DB into QGIS 2.6 it doesn't recognise it as a proper DB.


Can some explain to me what is happening and how I go about solving it.



Answer




The GDAL osm driver makes use of an osmconf.ini file:


http://www.gdal.org/drv_osm.html


Within that file, you can uncomment the line


#other_tags=no

to avoid saving all possible names of Sweden in that database column.


By the way, GDAL can read the osm.pbf file directly, no need to extract it first.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...