mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Make lines_to_leaflet tolerant of single lines.
This commit is contained in:
parent
d488bcffbd
commit
1adafac35f
@ -34,6 +34,10 @@ class ShapelyUtil:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def lines_to_leaflet(
|
def lines_to_leaflet(
|
||||||
cls, lines: MultiLineString, theater: ConflictTheater
|
cls, line_string: MultiLineString | LineString, theater: ConflictTheater
|
||||||
) -> list[list[LeafletLatLon]]:
|
) -> list[list[LeafletLatLon]]:
|
||||||
return [cls.line_to_leaflet(line, theater) for line in lines.geoms]
|
if isinstance(line_string, MultiLineString):
|
||||||
|
lines = line_string.geoms
|
||||||
|
else:
|
||||||
|
lines = [line_string]
|
||||||
|
return [cls.line_to_leaflet(line, theater) for line in lines]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user