Skip to content

Commit

Permalink
Cherry-pick Shapely 1.8.0 deprecations (#496, #476) (#515)
Browse files Browse the repository at this point in the history
* Fix MultiPolygon not iterable (#496)

Signed-off-by: Xiyu Oh <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>

* Handle geometry collections (#476)

I was trying a clean build of RMF Demos and ran into a type error when
trying to compile maps. This PR fixes the type error. I'm not sure what
triggered it in the first place TBH.

Signed-off-by: Arjo Chakravarty <[email protected]>
Co-authored-by: Yadunund <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>

---------

Signed-off-by: Xiyu Oh <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Co-authored-by: Xiyu <[email protected]>
Co-authored-by: Arjo Chakravarty <[email protected]>
Co-authored-by: Yadunund <[email protected]>
  • Loading branch information
4 people authored Nov 8, 2024
1 parent 9fc8d4b commit 508ec5e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rmf_building_map_tools/building_map/floor.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,15 @@ def triangulate_polygon(self, polygon, triangles):
plt.plot(poly_x, poly_y, 'b', linewidth=4)

elif geom.geom_type == 'MultiPolygon':
for poly in list(geom):
for poly in list(geom.geoms):
self.triangulate_polygon(poly, triangles)

elif geom.geom_type == 'GeometryCollection':
# this can happen if the original triangulation needed
# to be clipped to lie within the original floor polygon
# for example, if a long triangle crossed a concave region
# and you end up with >=1 polygons and >=1 points or edges.
for item in geom:
for item in geom.geoms:
if item.geom_type == 'Polygon':
self.triangulate_polygon(item, triangles)

Expand Down

0 comments on commit 508ec5e

Please sign in to comment.