mapillary / mapillary-python-sdk

A Python 3 library built on the Mapillary API v4 to facilitate retrieving and working with Mapillary data.
MIT License
37 stars 14 forks source link

Fix Polygon creation in {shape,geojson}_features_controller #149

Open ducksoup opened 1 year ago

ducksoup commented 1 year ago

shapely.geometry.shape expects as input a GeoJSON-like mapping which, in the case of a polygon, should contain a list of lists of points. The current code instead tries to append all points to a single flat list. This causes errors such as:

Traceback (most recent call last):
  File "shapely/speedups/_speedups.pyx", line 252, in shapely.speedups._speedups.geos_linearring_from_py
AttributeError: 'list' object has no attribute '__array_interface__'

This PR fixes this issue.