Skip to content

Commit aa87cea

Browse files
committed
Update version to 1.3.19 and add validation for minimum node count in building geometry checks
1 parent e666a35 commit aa87cea

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

mosstool/map/osm/building.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ def _make_raw_aoi(self):
191191
if nodes[0] != nodes[-1]: # should be a ring
192192
invalid_way_cnt += 1
193193
continue
194+
if len(nodes) < 3:
195+
invalid_way_cnt += 1
196+
continue
194197
geo = sPolygon([nodes_dict[node] for node in nodes])
195198
if geo.is_valid:
196199
self.aois.append(
@@ -232,6 +235,9 @@ def _make_raw_aoi(self):
232235
if (
233236
nodes_ring and not nodes_line
234237
): # Multiple ring-forming edges: It may be combined into a polygon by union; it may also be separated into multiple shapes, in which case it will be split into multiple Aoi
238+
if len(nodes_ring) < 3:
239+
invalid_relation_cnt += 1
240+
continue
235241
polys = [
236242
sPolygon([nodes_dict[node] for node in nodes])
237243
for nodes in nodes_ring

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "mosstool"
3-
version = "1.3.18"
3+
version = "1.3.19"
44
description = "MObility Simulation System toolbox "
55
authors = ["Jun Zhang <zhangjun990222@qq.com>","Junbo Yan <yanjb20thu@gmali.com>"]
66
license = "MIT"

0 commit comments

Comments
 (0)