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,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:
|
||||
|
|
Loading…
Add table
Reference in a new issue