Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exported shapefile faulty #847

Open
KcOOE opened this issue May 3, 2023 · 6 comments
Open

Exported shapefile faulty #847

KcOOE opened this issue May 3, 2023 · 6 comments
Labels

Comments

@KcOOE
Copy link

KcOOE commented May 3, 2023

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.

@claudinehellmuth
Copy link

this happened to me too

@chriswhong chriswhong added the bug label May 17, 2023
@chriswhong
Copy link
Contributor

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?

@KcOOE
Copy link
Author

KcOOE commented Jun 7, 2023

  • 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.

@ChenpengZhang
Copy link

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.

@leahnder
Copy link

leahnder commented Apr 29, 2024

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.

1-square.zip
2-squares.zip

PS: I tried uploading the shapefile into mapshaper. It showed the same mismatch warning.

@calvinmetcalf
Copy link

fyi this is a problem with the shp-write library mapbox/shp-write#113

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants