bartromgens / geojsoncontour

Convert matplotlib contour plots to geojson
MIT License
90 stars 31 forks source link

min_angle_deg is none by default in contour_to_json call #12

Closed Vichoko closed 5 years ago

Vichoko commented 6 years ago

the example as stated in the readme of the usage contour_to_json function doesn't work. As the function call doesn't include this parameter as default, the value is None. And later in the function it makes a comparison and throws the following stack trace:

gjs = geojsoncontour.contour_to_geojson(contour=cnt, ndigits=3, unit='m')
Traceback (most recent call last):
  File "/home/vichoko/Apps/pycharm-2018.2.4/helpers/pydev/_pydevd_bundle/pydevd_exec2.py", line 3, in Exec
    exec(exp, global_vars, local_vars)
  File "<input>", line 1, in <module>
  File "/home/vichoko/anaconda3/envs/rs_api/lib/python3.6/site-packages/geojsoncontour/contour.py", line 24, in contour_to_geojson
    coordinates = keep_high_angle(v, min_angle_deg)
  File "/home/vichoko/anaconda3/envs/rs_api/lib/python3.6/site-packages/geojsoncontour/utilities/multipoly.py", line 55, in keep_high_angle
    if diff_angle > min_angle_deg:
TypeError: '>' not supported between instances of 'float' and 'NoneType'
bartromgens commented 5 years ago

@Vichoko This is fixed. Thanks for reporting the issue and sorry for the late reply.