On Tue, Dec 25, 2007 at 09:58:40PM +0100, Marcus Wolschon wrote: > I am looking for some java-code to simplify ways > to generate simplified, pre-computed maps for low zoom-levels. > (Like showing all of berlin or europe in Traveling Salesman > after zooming out.) > > Does anyone know of such code or a simple algorithm to implement?
You can take a look at the SimplifyWayAction in the utilsplugin, it uses Douglas-Peucker. That simple recursive algorithm simply takes a straight line from the first point to the last point and looks for the farthest points from that line. If that node is farther than a specified tolerance, then it's included in the simplified polyline; then we split the polyline at that point and repeat for both parts. Gabriel. _______________________________________________ dev mailing list [email protected] http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev

