Handle longitudes <-99.99 in SPC outlook areas
This commit is contained in:
parent
90993e08d1
commit
671caf01bd
1 changed files with 8 additions and 2 deletions
|
@ -63,8 +63,13 @@ def parse_coord(coord: str) -> tuple[float, float]:
|
||||||
if len(coord) != 8:
|
if len(coord) != 8:
|
||||||
raise SPCOutlookParserException('Coordinate pair is incorrect length string')
|
raise SPCOutlookParserException('Coordinate pair is incorrect length string')
|
||||||
|
|
||||||
|
lon = int(coord[4:8])
|
||||||
|
|
||||||
|
if lon <= 60:
|
||||||
|
lon += 100
|
||||||
|
|
||||||
return (
|
return (
|
||||||
0.01 * -int(coord[4:8]),
|
0.01 * -lon,
|
||||||
0.01 * int(coord[0:4])
|
0.01 * int(coord[0:4])
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -73,6 +78,7 @@ def each_poly(parts: list[str]):
|
||||||
|
|
||||||
for part in parts:
|
for part in parts:
|
||||||
if part == '99999999':
|
if part == '99999999':
|
||||||
|
points.append(points[0])
|
||||||
yield shapely.Polygon(points)
|
yield shapely.Polygon(points)
|
||||||
points = list()
|
points = list()
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Reference in a new issue