Handle longitudes <-99.99 in SPC outlook areas

This commit is contained in:
XANTRONIX 2025-03-16 00:34:45 -04:00
parent 90993e08d1
commit 671caf01bd

View file

@ -63,9 +63,14 @@ 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])
) )
def each_poly(parts: list[str]): def each_poly(parts: list[str]):
@ -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: