[Tile-serving] [openstreetmap/osm2pgsql] Clipping in mercator conversion (#793)

Sarah Hoffmann notifications at github.com
Sun Oct 22 08:36:09 UTC 2017


The internal osm2pgsql function for conversion for mercator has a hard clipping at 85.07, see https://github.com/openstreetmap/osm2pgsql/blob/master/reprojection.cpp#L23. This is the reason why there are so many invalid polygons near the poles (see #787). We are currently using the exact algorithm for reprojection which degenerates only very close to the pole and PostGIS is quite happy with geometries that are outside the defined area for the projection. Therefore it should be safe to increase the clipping to something much closer to 90 degrees. This way we should be able to obtain valid geometries for most of the OSM objects close to the pole.

We could also switch to libosmium's projection function. It uses a much faster algorithm in the well-defined ranges and degenerates to the exact algorithm when closer to 90 degrees. However, this should be done on top of our choice of clipping. Libosmium itself does not do any clipping at all.

CC @imagico, @joto

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/issues/793
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20171022/6c58449d/attachment.html>


More information about the Tile-serving mailing list