[Tile-serving] [openstreetmap/osm2pgsql] Use PostGIS to make sure geometries are valid (#790)

Paul Norman notifications at github.com
Sat Sep 30 04:35:39 UTC 2017


Because libosmium only checks 4326 validity and osm2pgsql can
transform to a different projection, another validity check needs
to be done if a different projection is being used.

A trigger is not the only possible method, but something like
`INSERT ... ON CONFLICT ...` requires 9.5.

This PR removes some of the performance gains of libosmium geometries, but is still faster than 0.92.1.

Taking the combined geofabrik BC and WA extracts and importing with ``./osm2pgsql [-l|-m] -d gis -C 1200 --number-processes 4 ~/osm/planet/bc_wa-170908.osm.pbf -S ../default.style`` I get the following as median times from three runs

```
             -m    -l
pr          121    94
0.94.0-RC1   99    95
0.92.1      161   155
```

I am testing with a larger extract to see if there are any scaling problems, but don't anticipate any.

The 0.92.1 to this PR change moves geometry validation time from processing to table finalization.

I'm not worried about update speed because they're so much slower thanks to other constraints.

Long-term I'd prefer a different method, but producing invalid geometries is holding up the 0.94.0 release.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/osm2pgsql/pull/790

-- Commit Summary --

  * Use PostGIS to make sure geometries are valid

-- File Changes --

    M table.cpp (51)

-- Patch Links --

https://github.com/openstreetmap/osm2pgsql/pull/790.patch
https://github.com/openstreetmap/osm2pgsql/pull/790.diff

-- 
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/pull/790
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20170930/0ac1db59/attachment.html>


More information about the Tile-serving mailing list