cartopy icon indicating copy to clipboard operation
cartopy copied to clipboard

Oceans (10m resolution) fill the whole plot when using TransverseMercator with central_longitude=15.0

Open dbratell opened this issue 4 years ago • 7 comments

Description

When plotting oceans (resolution "10m") with projection TransverseMercator(central_longitude=15.0), the whole plot turns blue.

I have understood that ocean polygons are complicated and upgrading to 0.18 made resolution "50m" work, but "10m" still causes the whole plot to be blue.

I've tested various values for central_longitude. There is no bug for values between 10.0 and 12.0. Everything is blue between 12.5 and 19.0, except for 18.0 that for some reason seems to work. I've also tested approx=False and approx=True and that makes no observable difference.

TransverseMercator(central_longitude=15.0) (with some additional parameters) is the official projection for Sweden which makes that particular value interesting.

Code to reproduce

A minimal testcase:

import cartopy.crs as ccrs
import cartopy.feature as cfeature
import matplotlib.pyplot as plt

MAP_PROJECTION = ccrs.TransverseMercator(central_longitude=15.0)
ax = plt.axes(projection=MAP_PROJECTION)
ax.add_feature(cfeature.OCEAN.with_scale("10m")) # "50m" works
plt.show()

Expected,

The Baltic Sea, and the North Sea

Actually

Blue

### Operating system

Windows 10

Cartopy version

cartopy.version is '0.18.0' Installed with anaconda/conda which calls the package 0.18.0

Python version

(base) c:>python --version Python 3.7.8

dbratell avatar Jul 23 '20 15:07 dbratell