[Tile-serving] [openstreetmap/osm2pgsql] Don't let invalid geometries into the database (#655)
Paul Norman
notifications at github.com
Thu Dec 1 05:28:12 UTC 2016
pnorman commented on this pull request.
> @@ -209,11 +209,14 @@ geom_ptr geometry_builder::create_simple_poly(GeometryFactory &gf,
std::unique_ptr<std::vector<Geometry *> > empty(new std::vector<Geometry *>);
geom_ptr geom(gf.createPolygon(shell.release(), empty.release()));
- if (!geom->isValid()) {
+ if (geom->isEmpty() || !geom->isValid()) {
Perhaps the logic should be
```c++
if (geom->isEmpty()) {
if (excludepoly) {
throw std::runtime_error("Excluding broken polygon.");
}
} else if (!geom->isValid())) {
if (excludepoly) {
throw std::runtime_error("Excluding broken polygon.");
}
geom = geom_ptr(geom->buffer(0));
if (geom->isEmpty() || !geom->isValid()) {
throw std::runtime_error("Excluding unrecoverable broken polygon.");
}
}
```
--
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/655
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20161130/9f06505a/attachment.html>
More information about the Tile-serving
mailing list