andrea-cuttone / geoplotlib

python toolbox for visualizing geographical data and making maps
MIT License
1.03k stars 175 forks source link

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

Open Silocean opened 7 years ago

Silocean commented 7 years ago

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?

timgrossmann commented 5 years ago

@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.

Silocean commented 5 years ago

@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. :)

JimLakis commented 5 years ago

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.