mbostock/topojson — pull request #206 by sttawm (2014-10-21 17:38:10+00:00)
Title: flag for ignore self intersections flag; line-segment deduping

This pull request introduces the flag ```ignore-self-intersections``` (#121). When true, topojson runs as usual.

Otherwise,

**1.** nodes at self-intersections are not considered "special" -- they are subject to being marked as junctions, just as any other node may be.
**2.** "spikes" and "punctures" (of the form [i, j, ~j, k]) are detected
**3.** "self replication" (of the form [i, i, ... i]) is detected.

(i, j, and k represent 'arcs').

This is mostly motivated by the fact that it can be useful to guarantee that no line segment is duplicated, especially when self-intersections are noded.
I've found this useful when validating polygons.
This would also allow #184 to encompass adjacent-but-opposite coincident arcs.
This should also allow the optimization #120 to be safely applied.

There are a few tests to illustrate the behavior.

##### A few disclaimers
As mentioned in #121, this is unlikely to decrease the size of the resulting Topojson.
This may not be the ideal implementation; the utility of these features may not justify the extra code.