openstreetmap/osm2pgsql — pull request #20 by zerebubuth (2013-04-20 20:02:41+00:00)
Title: Split long lines between nodes

This patch changes the line splitting algorithm so that it will split between nodes to maintain a maximum line length of `split_at`. Previously the algorithm would only split at nodes, meaning very long lines could still be generated by very long single segments.

This has been tested on an artificial test case consisting of one world-spanning way, and the most recent "bayern-latest" extract from Geofabrik. On the "bayern-latest" case, the maximum difference in summed line lengths by `osm_id` is 1.05e-09 meters.