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.

  • 2
    Your shapefile is corrupted. Contact whoever delivered the data for you and ask to send valid data.
    – user30184
    Commented Apr 15, 2018 at 12:12

1 Answer 1


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")
  • 2
    If ogr can't read the dataset, then geopandas probably won't be able to either as it's based on ogr.
    – user2856
    Commented Apr 15, 2018 at 9:40

Not the answer you're looking for? Browse other questions tagged or ask your own question.