Polymap4 / polymap4-p4

Polymap4 GIS client with Batik UI
0 stars 5 forks source link

[Import] Shape: cannot be imported #82

Open jrlover opened 8 years ago

jrlover commented 8 years ago

tmAg8guZ.zip auswahl_084

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: auswahl_086

stundzig commented 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.

stundzig commented 8 years ago

-> https://github.com/geotools/geotools/commit/b84b10db8b21e2100c0b6365465853c27a8b6bf5

stundzig commented 8 years ago

The fix is in commit https://github.com/stundzig/geotools/commit/7cba148e187ee575e22a2d1eaf64bae75b9882ae

fb71 commented 8 years ago

So, can we close this?

stundzig commented 8 years ago

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.

fb71 commented 7 years ago

ogr2ogr support is done in #115. Maybe we should think about processing even shapefiles through ogr2ogr before import.