Open jrlover opened 8 years ago
The problem here is, the geojson exporter exports the shp and shrinks the attribute names to 8 letters. So we have 2 marker-s in the shp file. And the geotools reader, isn't aware to handle this. It has a Set with all attribute names in the schema, but one more value in the DBF record. I'll try to fix it in gt-shapefile and contribute a bug report.
To fix the file i unpacked it with
ogr2ogr POINT2.shp POINT.shp Warning 1: Field 'marker-s' already exists. Renaming it as 'marker-s2'
and then it could be imported.
The fix is in commit https://github.com/stundzig/geotools/commit/7cba148e187ee575e22a2d1eaf64bae75b9882ae
So, can we close this?
I'm not sure, if we can fix it. I've removed a check in the ShapeFileReader and now this file could be imported. But i think, we need a more generic solution for that, e.g. calling a repair job with ogr2ogr on server side for example and then importing the new file.
ogr2ogr support is done in #115. Maybe we should think about processing even shapefiles through ogr2ogr before import.
tmAg8guZ.zip
Shows no entries and when changing encoding the following exception is shown.
The original file is https://github.com/jrlover/maps/blob/master/essen_stadtmitte.geojson created with geojson.io: