1

I am trying to convert a GeoJSON file into SpatiaLite, so I can load it as a SpatiaLite layer into QGIS, as described here.

Converting the file in QGIS with "save as.." did not work (see also here), which is why I tried ogr2ogr in the command line to do the trick. After a few attempts I managed to convert it as follows:

/Library/Frameworks/GDAL.framework/Programs/ogr2ogr -f sqlite -dsco spatialite=yes mydata.sqlite mydata.geojson -nlt PROMOTE_TO_MULTI 

This works fine for an input file with mixed geometries but does not seem to work with my file, which also contains NULL geometries. In this case, I end up with a .sqlite file that I can open in QGIS as a vector layer, but not as a SpatiaLite layer. Here it only loads the attribute table and no geometries, which are listed as "Unknown Geometries".

Does anyone have an idea how I could resolve this?

 "Unknown Geometry"

2
  • Do you need also those features which are without geometry?
    – user30184
    Commented Sep 29, 2016 at 14:30
  • OpenJUMP can handle quite well all kind of geometries, even empty ones, on the same layer. It has also a brand new GeoJSON driver which might be worth trying. Release version does not have the driver, take a nightly build from sourceforge.net/projects/jump-pilot/files./OpenJUMP_snapshots
    – user30184
    Commented Sep 29, 2016 at 14:34

0

Your Answer

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

Browse other questions tagged or ask your own question.