SciTools/cartopy — pull request #111 by esc24 (2012-10-23 10:49:44+00:00)
Title: Prevent attempts to process invalid polgons resulting from projection.

When plotting a Robinson projection of the coastline of Japan from GSHHS .shp files a problem occurs when bisecting the line from 139.697, 39.965 to 139.699, 40.0079 (in geodetic coords). The result is that cartopy believes the projected polygon crosses the boundary spawning a new geometry. It then attempts to attach these to the boundary and one of the resulting rings is invalid, leading to an exception when attempting to invert this interior ring. This PR ensures that any invalid polygons are ignored.

The source of the problem with the Robinson projection is a fix to proj4 (between 4.7.0 and 4.8.0) in which the 40 deg latitude constant 0.4968 was changed to 0.4958. This is supposed to fix a 9km North-South discontinuity. See https://trac.osgeo.org/proj/ticket/113. If I revert this fix, the problem goes away, but everything I can find suggests the constant should indeed be 0.4958. Odd.