On Wed, 18 Mar 2009 11:30:18 +0000, Andy Deakin <[email protected]> wrote: >>> Hello everyone, >>> >>> did anyone else ever work on simplifying the polylines for >>> low zoom -rendering or similar purposes? >>> Any algorithms, websites or books that may help me? >>> >> >> There's been a small amount of work on this in mapnik-rendering >> circles, but mainly using postgis' simplify(linestring, integer) >> function. I don't have info from anyone who's looked into it further >> from an algorithm point of view. >> > > Check out the google maps encoded polylines or vertex reduction algorithms. > I (and many others) have written algorithms to say which levels a > polyline point should be visible at on google maps. > > e.g. (not mine!) > http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/algorithm.html
Thanks. I compared it to my implementation at http://travelingsales.svn.sourceforge.net/viewvc/travelingsales/libosm/src/org/openstreetmap/osm/data/WayHelper.java?view=markup line 360-403 and it seems to be doing the same thing. Except that they store more then the final level of detail. I may add additional attributes to the simplified ways to have multiple simplification-levels in a single map. (Have each node of a way contain the number of next nodes to skip in a given zoom-level. Like key="LODDataSet:skip(" + wayid + ")(" + lod-level + ")" value="3"). This way a single low-detail map may contain multiple levels of detail. And renders that support it can make use of that without breaking renderers that do not. I like that idea. :) Marcus _______________________________________________ dev mailing list [email protected] http://lists.openstreetmap.org/listinfo/dev

