diff --git a/lib/xmet/spc.py b/lib/xmet/spc.py index 61ea894..bcf818f 100644 --- a/lib/xmet/spc.py +++ b/lib/xmet/spc.py @@ -63,9 +63,14 @@ def parse_coord(coord: str) -> tuple[float, float]: if len(coord) != 8: raise SPCOutlookParserException('Coordinate pair is incorrect length string') + lon = int(coord[4:8]) + + if lon <= 60: + lon += 100 + return ( - 0.01 * -int(coord[4:8]), - 0.01 * int(coord[0:4]) + 0.01 * -lon, + 0.01 * int(coord[0:4]) ) def each_poly(parts: list[str]): @@ -73,6 +78,7 @@ def each_poly(parts: list[str]): for part in parts: if part == '99999999': + points.append(points[0]) yield shapely.Polygon(points) points = list() else: