mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Migrate off deprecated shapely APIs.
This commit is contained in:
parent
6c1e1e1e95
commit
3af3bd606c
@ -74,11 +74,11 @@ class ConflictTheater:
|
|||||||
if self.is_on_land(point):
|
if self.is_on_land(point):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
for exclusion_zone in self.landmap.exclusion_zones:
|
for exclusion_zone in self.landmap.exclusion_zones.geoms:
|
||||||
if poly_contains(point.x, point.y, exclusion_zone):
|
if poly_contains(point.x, point.y, exclusion_zone):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
for sea in self.landmap.sea_zones:
|
for sea in self.landmap.sea_zones.geoms:
|
||||||
if poly_contains(point.x, point.y, sea):
|
if poly_contains(point.x, point.y, sea):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@ -95,7 +95,7 @@ class ConflictTheater:
|
|||||||
if not is_point_included:
|
if not is_point_included:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
for exclusion_zone in self.landmap.exclusion_zones:
|
for exclusion_zone in self.landmap.exclusion_zones.geoms:
|
||||||
if poly_contains(point.x, point.y, exclusion_zone):
|
if poly_contains(point.x, point.y, exclusion_zone):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ class ConflictTheater:
|
|||||||
nearest_points = []
|
nearest_points = []
|
||||||
if not self.landmap:
|
if not self.landmap:
|
||||||
raise RuntimeError("Landmap not initialized")
|
raise RuntimeError("Landmap not initialized")
|
||||||
for inclusion_zone in self.landmap.inclusion_zones:
|
for inclusion_zone in self.landmap.inclusion_zones.geoms:
|
||||||
nearest_pair = ops.nearest_points(point, inclusion_zone)
|
nearest_pair = ops.nearest_points(point, inclusion_zone)
|
||||||
nearest_points.append(nearest_pair[1])
|
nearest_points.append(nearest_pair[1])
|
||||||
min_distance = point.distance(nearest_points[0]) # type: geometry.Point
|
min_distance = point.distance(nearest_points[0]) # type: geometry.Point
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user