From 7a18141c54b34b942f9fce5be3ebd6ce4f964c3d Mon Sep 17 00:00:00 2001 From: Arjo Chakravarty Date: Fri, 6 Oct 2023 04:06:42 +0000 Subject: [PATCH] Handle geometry collections 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 --- rmf_building_map_tools/building_map/floor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rmf_building_map_tools/building_map/floor.py b/rmf_building_map_tools/building_map/floor.py index 4392e568..f6cbe71f 100644 --- a/rmf_building_map_tools/building_map/floor.py +++ b/rmf_building_map_tools/building_map/floor.py @@ -141,7 +141,7 @@ def triangulate_polygon(self, polygon, triangles): # 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)