Skip to content

Shapefile shape has invalid polygon: no exterior rings found (must have clockwise orientation #219

Closed
@coneheadusa

Description

@coneheadusa

The shape file issue I'm having was closed on the cartopy site by upgrading to the latest gshhg-gmt. (SciTools/cartopy#1659). I have the latest version of the gshhg-gmt files. I'm using using pyshp==2.1.3 and the cartopy reference is using pyshp==2.1.2. I have not tried to use pyshp==2.1.2.
Please advise.

Using this OS and listed python modules below.

OS sles:15:sp2
Python 3.8.6
pyshp==2.1.3
Shape files : gshhg-gmt-2.3.7

import matplotlib.pyplot as plt;
import cartopy.crs as ccrs;
import cartopy;
fig = plt.figure();
proj = ccrs.Mercator(central_longitude = 0);
ax = plt.axes(projection = proj);
ax.add_feature(cartopy.feature.GSHHSFeature(levels = (1, 2), linewidth = 2.0));
print("before");
fig.savefig("test.png");
print("after");

/apps/prod/python-modules/3.8.6/intel/19.1.3.304/lib/python3.8/site-packages/shapefile.py:391: UserWarning: Shapefile shape has invalid polygon: no exterior rings found (must have clockwise orientation); interpreting holes as exteriors.
warnings.warn('Shapefile shape has invalid polygon: no exterior rings found (must have clockwise orientation); interpreting holes as exteriors.')

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions