I'm trying to import a large (8.8GB) GeoJSON file to a Postgres 9.6 database with the following command:
ogr2ogr -f "PostgreSQL" -nln final_diffs PG:"host=localhost dbname=inspire user=me" diffs.geojson
But I get lots of warnings like this:
ERROR 1: GeoJSON object too complex
ERROR 1: GeoJSON object too complex
More than 1000 errors or warnings have been reported. No more will be reported from now.
And the process runs without errors, but at the end, nothing has been imported into the Postgres database.
Any ideas? I've not seen this warning before, and the only online reference I can find is in the GDAL source code.
All I get from ogrinfo
is the above warnings, then:
Layer name: diffs
Geometry: Unknown (any)
Feature Count: 0
Layer SRS WKT:
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.0174532925199433,
AUTHORITY["EPSG","9122"]],
AUTHORITY["EPSG","4326"]]
Best Answer
Error comes from the GDAL GeoJSON driver. The source code is in https://github.com/OSGeo/gdal/blob/master/gdal/ogr/ogrsf_frmts/geojson/ogrgeojsonreader.cpp.
The max value is defined on line 50
There are tooComplex checks in many places and that throws the errot that you saw
I do not know really what to do but I can suggest