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?
