File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,31 @@ def get_coast_polygons(resolution):
8888 if lsd is not None :
8989 b = quantize (b ,lsd )
9090 polybounds .append (b )
91+
92+ # Manual fix for incorrect Antarctica polygons at full resolution
93+ # This issue is only present in the shapefile version and may be fixed
94+ # in future versions of GSHHS!
95+ if resolution == 'f' and level == 5 :
96+ i = [item [- 1 ] for item in polymeta ].index ('4-E' )
97+ coords = polybounds [i ][2 :- 1 , :]
98+ coords = np .vstack ([coords ,
99+ [180.0 , - 90.0 ],
100+ [0.0 , - 90.0 ]]).astype (np .float32 )
101+ polybounds [i ] = coords
102+ polymeta [i ][- 2 ] = len (coords )
103+
104+ j = [item [- 1 ] for item in polymeta ].index ('4-W' )
105+ coords = polybounds [j ][3 :, :]
106+ np .savetxt ('coordinates.txt' , coords )
107+ coords = np .vstack ([coords ,
108+ [0.0 , coords [- 1 ][1 ]],
109+ [0.0 , - 90.0 ],
110+ [- 180.0 , - 90.0 ],
111+ coords [0 ]]).astype (np .float32 )
112+
113+ polybounds [j ] = coords
114+ polymeta [j ][- 2 ] = len (coords )
115+
91116 return polybounds , polymeta
92117
93118def get_wdb_boundaries (resolution ,level ,rivers = False ):
You can’t perform that action at this time.
0 commit comments