[Tile-serving] [openstreetmap/osm2pgsql] Import of changes failing because of TopologyException (#787)

Sarah Hoffmann notifications at github.com
Sun Sep 24 16:27:09 UTC 2017


The original error does not look like it comes from osm2pgsql itself. @JesseCrocker Do you have additional triggers installed on `planet_osm_polygon`? Then you can add a validity check there (using `ST_IsValid()`.

As for creating invalid geometries: we need to get rid of all points outside the defined area of the chosen projection. This is also what the geos-based version used to do as far as I can  tell. The trick is to find the points _before_ sending the lines to libosmium for the polygon creation even though at this point the coordinates are still in WSG84. If we do this, then libosmium can still guarantee that the geometry is still valid. I don't think reprojection can invalidate a geometry if all coordinates are valid in the source and target projection. @imagico, please correct me if I'm wrong.

The interesting question is what to do with the invalid points. We can either drop them completely or move them towards the nearest edge. The former is more likely to leave the geometry usable but it will lead to odd rendering artifacts near the edges. @pnorman opinions?

-- 
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/787#issuecomment-331721214
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20170924/b3986fdb/attachment.html>


More information about the Tile-serving mailing list