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

Sarah Hoffmann notifications at github.com
Mon Sep 25 20:38:13 UTC 2017


Some thoughts on a trigger-less solution that still uses Postgis for validation:

* On initial import add an appropriate WHERE clause when copying the *_polygon table at the end of the import process. If sorting is not requested, run a DELETE statement to remove invalid geometries.
* On updates, disable COPY mode (osm2pgsql drops out of it pretty early on anyways) and modify the prepared statements to skip over geometries with invalid geometries. A query along the lines `INSERT INTO planet_osm_polygon SELECT * FROM (SELECT <id>,...., <way> as way) w WHERE ST_IsValid(way)` should do the trick.

Given that neither of the two comes without a cost, I'm slightly in favour of making something like this configurable. Trying to repair is an option as well, just makes the query a bit more complicated.

-- 
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-332004911
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20170925/f0ffc2bb/attachment.html>


More information about the Tile-serving mailing list