geoplotlib icon indicating copy to clipboard operation
geoplotlib copied to clipboard

geoplotlib.geojson() method throws "ValueError: math domain error"

Open Silocean opened this issue 8 years ago • 3 comments

here is my python code. import geoplotlib geoplotlib.geojson('bus.json') geoplotlib.show() and here is the content of file "bus.json". { "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ 39.994238, 116.326786 ] }, "properties": { "prop0": "value0" } } ] } How could this happen?Any thing wrong?

Silocean avatar Feb 23 '17 08:02 Silocean

@Silocean Looking at the code, there is no way something with the "type": "Feature" will be used.

The four types that get checked are:

if feature['geometry']['type'] == 'Polygon':
elif feature['geometry']['type'] == 'MultiPolygon':
elif feature['geometry']['type'] == 'Point':
elif feature['geometry']['type'] == 'LineString':

Edit: Well I just saw that this issue was created starting of 2017, sorry.

timgrossmann avatar Nov 20 '18 08:11 timgrossmann

@Silocean Looking at the code, there is no way something with the "type": "Feature" will be used.

The four types that get checked are:

if feature['geometry']['type'] == 'Polygon':
elif feature['geometry']['type'] == 'MultiPolygon':
elif feature['geometry']['type'] == 'Point':
elif feature['geometry']['type'] == 'LineString':

Edit: Well I just saw that this issue was created starting of 2017, sorry.

issue solved already. Also thank you for your reply. :)

Silocean avatar Nov 22 '18 14:11 Silocean

I'm receiving similar exception errors but for loading a dictionary into GeoPlotLib on ticket #46: https://github.com/andrea-cuttone/geoplotlib/issues/46

Though I'm not passing my input through the geojson() function.

JimLakis avatar Apr 09 '19 18:04 JimLakis