Open QuLogic opened 5 years ago
Seems to also affect AzimuthalEquidistant
(which is somewhat similar.)
If we plot the points of the OCEAN polygons:
for i, mp in enumerate(cartopy.feature.OCEAN.geometries()):
p = mp[0] # There's only one polygon.
x, y = zip(*list(p.exterior.coords))
ax.scatter(x, y, marker='o', facecolor='none', edgecolor=f'C{i * 2}',
transform=cartopy.feature.OCEAN.crs,
label=f'{i} exterior')
for j, interior in enumerate(p.interiors):
x, y = zip(*list(interior.coords))
ax.scatter(x, y, marker='x', color=f'C{i * 2 + 1}',
transform=cartopy.feature.OCEAN.crs,
label=f'{i} interior' if j == 0 else None)
then we see that there's one small 'ocean' in Eurasia and one big ocean whose exterior is Eurasia+Africa and Antarctica, with the remaining continents being the excluded interiors. This is a bit more clear on a
PlateCarree(central_longitude=30)
:
It's a bit weird to me that both Eurasia and Antarctica are both part of the exterior polygon, but I think something weird is going on there, either tranform-wise, or attaching to the boundary.
So I think the problem here is re-projecting the weird exterior produces an invalid LinearRing. Using this simplified topology:
the re-projection looks like:
and the bit extending from the Eastern part of Asia down to Antarctica crosses back over Asia. I think this is an invalid LinearRing to shapely. It's a bit weird to me that that whole line does not seem to be problematic on say, shifted PlateCarree, though.
This is essentially the same as #146.
Originally posted by @akrherz in https://github.com/SciTools/cartopy/issues/803#issuecomment-333909742