5

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.

1
  • Your command does not create Spatialite DB but an SQLite + FDO database. You should get good result and faster by using .pbf format and command ogr2ogr -f SQLite -dsco spatialite=yes SwedenOSM.sqlite sweden-latest.osm.pbf -progress --config OGR_SQLITE_SYNCHRONOUS OFF --config OSM_COMPRESS_NODES YES
    – user30184
    Jan 4, 2015 at 23:57

1 Answer 1

2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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