jwass / geojsonio.py

Open GeoJSON data on geojson.io
BSD 2-Clause "Simplified" License
121 stars 25 forks source link

Could not parse JSON error: Empty FeatureCollection #13

Open mazzma12 opened 6 years ago

mazzma12 commented 6 years ago

Thank you for your contribution, the tool is pretty cool and simple.

I tried to reproduce an example using geopandas as in the README but I got an error message once the browser opens: "Could not parse JSON" on the top left, and an empty FeatureCollection on the right.

import geopandas as gpd
import geojsonio

gdf = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres')) 
geojsonio.display(gdf.to_json())
geojsonio.display(gdf.iloc[:2].to_json()) # Worked

After investigation, I found that in fact the problem depends on the size of the URL request, as the geojson loaded is big.

I manage to get it worked if I take the first 4 rows of the GeoDataFrame, but it can't make it above 7. I bet it is a restriction on geojson.io side, but I wonder if you had a solution to bypass ? Maybe login or run it local somehow, I am not sure.