do not merge obstacles. this seems to get to complicated for libgeos
This commit is contained in:
parent
7a02f58175
commit
7c726ef845
4 changed files with 29 additions and 19 deletions
|
@ -42,8 +42,11 @@ class AltitudeAreaGeometries:
|
|||
faces_offset, vertices_offset)
|
||||
|
||||
for key in tuple(self.obstacles.keys()):
|
||||
faces_offset, vertices_offset = self._call_create_full(self.obstacles, key, faces, vertices,
|
||||
faces_offset, vertices_offset)
|
||||
height_obstacles = list(self.obstacles[key])
|
||||
for i in range(len(height_obstacles)):
|
||||
faces_offset, vertices_offset = self._call_create_full(height_obstacles, i, faces, vertices,
|
||||
faces_offset, vertices_offset)
|
||||
self.obstacles[key] = tuple(height_obstacles)
|
||||
|
||||
if not vertices:
|
||||
return np.empty((0, 2), dtype=np.int32), np.empty((0, 3), dtype=np.uint32)
|
||||
|
@ -90,8 +93,9 @@ class AltitudeAreaGeometries:
|
|||
lower=altitudes,
|
||||
upper=altitudes + int(0.001 * 1000),
|
||||
crops=crops)
|
||||
for height, geometry in self.obstacles.items():
|
||||
geometry.build_polyhedron(create_polyhedron,
|
||||
lower=altitudes,
|
||||
upper=altitudes + height,
|
||||
crops=crops)
|
||||
for height, height_geometries in self.obstacles.items():
|
||||
for geometry in height_geometries:
|
||||
geometry.build_polyhedron(create_polyhedron,
|
||||
lower=altitudes,
|
||||
upper=altitudes + height,
|
||||
crops=crops)
|
||||
|
|
|
@ -148,9 +148,6 @@ class LevelGeometries:
|
|||
for access_restriction, areas in tuple(color_group.items()):
|
||||
color_group[access_restriction] = unary_union(areas)
|
||||
|
||||
# merge obstacles
|
||||
obstacles = {key: unary_union(polygons) for key, polygons in obstacles.items()}
|
||||
|
||||
# add altitudegroup geometries and split ground colors into them
|
||||
for altitudearea in level.altitudeareas.all():
|
||||
altitudearea_prep = prepared.prep(altitudearea.geometry)
|
||||
|
@ -160,9 +157,13 @@ class LevelGeometries:
|
|||
for color, areas in colors.items()}
|
||||
altitudearea_colors = {color: areas for color, areas in altitudearea_colors.items() if areas}
|
||||
|
||||
altitudearea_obstacles = {height: area.intersection(altitudearea.geometry)
|
||||
for height, area in obstacles.items()
|
||||
if altitudearea_prep.intersects(area)}
|
||||
altitudearea_obstacles = {height: tuple(obstacle.intersection(altitudearea.geometry)
|
||||
for obstacle in height_obstacles
|
||||
if altitudearea_prep.intersects(obstacle))
|
||||
for height, height_obstacles in obstacles.items()}
|
||||
altitudearea_obstacles = {height: height_obstacles
|
||||
for height, height_obstacles in obstacles.items()
|
||||
if height_obstacles}
|
||||
geoms.altitudeareas.append(AltitudeAreaGeometries(altitudearea,
|
||||
altitudearea_colors,
|
||||
altitudearea_obstacles))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue