mbostock/topojson — pull request #126 by jasondavies (2013-11-21 22:57:26+00:00)
Title: More intelligent forcing of polygon winding order.

Previously, if a polygon was incorrectly specified with the order of
interior and exterior rings swapped, TopoJSON would attempt to maintain
the existing ordering of rings, and reverse their winding orders.

However, this doesn't resolve the issue, since it creates an exterior
ring which is smaller than the interior ring(s). Since the interior
rings are counter-clockwise and aren’t contained within the exterior,
they end up subtracting from the whole sphere rather than from the
exterior ring.

A better solution is to use the largest ring as the exterior, and then
ensure that the winding orders are all as expected assuming the rings
are smaller than a hemisphere.

(To do: tests.)