3

I'm trying to convert a large Shapefile (120 MB) to GeoJSON.

OGR converter gives an error that says process time took over 15 seconds, so process was cancelled.

Mapshaper gives the following error: File size of .shp doesn't match size in header

What can I do now? I'd prefer not installing any desktop software to do a simple conversion.

nmtoken
  • 13,355
  • 5
  • 38
  • 87
Jack
  • 183
  • 1
  • 2
  • 8

1 Answers1

6

If a python script is an option for you, then this will do the trick fast:

import geopandas as gpd
file = gpd.read_file("file.shp")
file.to_file("file.json", driver="GeoJSON")
PolyGeo
  • 65,136
  • 29
  • 109
  • 338
ImanolUr
  • 1,102
  • 1
  • 10
  • 21
  • 2
    If ogr can't read the dataset, then geopandas probably won't be able to either as it's based on ogr. – user2856 Apr 15 '18 at 09:40