0

I am trying to split Microsoft building data for Pakistan. It's size is 6gb. I am trying to use geojsplit to split the large GeoJSON file into small chunks, but it giving me this erro:

File "C:\Users\waqas\anaconda3\lib\site-packages\ijson\backends\python.py", line 171, in basic_parse raise common.JSONError('Additional data') ijson.common.JSONError: Additional data

Any other way to split GeoJSON file?

1
  • If your JSON is not valid, you won't be able to split it into logical chunks. Try to manually split the file as plain text, then fix/remove the feature that was cut in half and try your splitting process on the bisected file again. This way you might be able to find the broken feature(s) and fix them in the full file so that you can geojsplit that. Jul 15, 2022 at 10:32

2 Answers 2

1

It looks like your GeoJSON is invalid. As this is rather large file, please validate it offline by running GeoJSON lint on your infrastructure.

After you correct the GeoJSON there are couple of ideas about splitting it:

  1. Splitting GeoJSON using QGIS.
  2. Splitting JSON using FME.
  3. Splitting GeoJSON in shell/bash.
  4. Splitting GeoJSON using python:

For dividing GeoJSON file with python to 10000 features per feature collection type in terminal/your IDE:

pip install geojsplit
geojsplit --geometry-count 10000 ~/data/large.geojson
0
-1

I solve this problem using Git. Simply download Git from chrome and use this command to split files. Open Git terminal in folder where you already keep your file.

#Commond
split myLargeFile.geojsonl -l 1000000

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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