More robust polygons.
More robust polygons.

Previously, we only tested the first point in a hole to determine whether a
clockwise polygon ring contains a counterclockwise polygon hole. However, with
topologically invalid inputs—such as when the first point in the hole is
coincident with a point in the exterior ring—this code assumed that the ring did
not contain the hole.

Now we use a more robust check: we test for containment using the first point in
the hole that is not coincident with the ring.

mbostock/shapefile