Exported shapefile faulty
We use geojson.io to convert geojson files into shapefiles. Unfortunately, recently this no longer works correctly if there is more than one polyline (or polygon) in the geojson. The exported shapefile can then no longer be opened in ArcMap/ArcGIS Pro. It also doesn't open correctly in QGIS.
this happened to me too
I'm unable to reproduce this with simple drawn features in geojson.io. I did the same workflow for polygons and polylines:
- draw two polygons/polylines on geojson.io
- download as a shapefile
- unzip, open in QGIS 3.22.9 (macos), no issues with import.
Can someone provide example geojson that is not exporting to shapefile correctly?
- In QGIS (3.22.4) now I can also load the shapefile with two polygon/polyline features.
- In ArcMap/ArcGISPro you get the error "Number of shapes does not match the number of table records".
- If you check the shapefile on mapshaper.org you also get an error -> "Mismatched .dbf and .shp record count".
- If yout draw one polygon/polyline on geojson.io there is no problem, but if you draw two or more polygons/polylines then you get the error.
I have this issue too. I suspect this is because the corresponding .dbf file doesn't match the attribute number in the shapefile itself. But QGIS doesn't have strict inspection on this so you can still open the file itself. If you try to open the attribute list in QGIS you will find it blank, which is not allowed in the first place according to ArcGIS.
I have experienced this issue too. Attached, you'll find two shapefiles. 1-square is perfectly fine, 2-square has the mismatch record count issue.
According to the dBASE file specification, the number of records is located at bytes 4-7. This is correct in both .dbf files.
This implies the bug could lie within the generation of the .shp file.
PS: I tried uploading the shapefile into mapshaper. It showed the same mismatch warning.
fyi this is a problem with the shp-write library mapbox/shp-write#113