[Tile-serving] [openstreetmap/osm2pgsql] Import of changes failing because of TopologyException (#787)
Paul Norman
notifications at github.com
Wed Oct 4 20:27:03 UTC 2017
Fixed in #790
@JesseCrocker that PR won't actually fix it for you since it sets stuff up on import, but to do it without a reimport this SQL **should** work:
```sql
DELETE FROM planet_osm_polygon WHERE NOT st_isvalid(way);
CREATE OR REPLACE FUNCTION planet_osm_polygon_osm2pgsql_valid()
RETURNS TRIGGER AS $$
BEGIN
IF ST_IsValid(NEW.way) THEN
RETURN NEW;
END IF;
RETURN NULL;
EN
$$ LANGUAGE plpgsql;
CREATE TRIGGER planet_osm_polygon_osm2pgsql_valid BEFORE INSERT OR UPDATE
ON planet_osm_polygon
FOR EACH ROW EXECUTE PROCEDURE %1%_osm2pgsql_valid();
```
--
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-334279150
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20171004/f9795d70/attachment.html>
More information about the Tile-serving
mailing list