You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've found a case where imposm emits an invalid geometry for a self-intersecting polygon.
The polygon is a figure-eight shape, and the files and commands to reproduce are below.
The invalid polygon causes later operations to fail like st_pointonsurface.
I've found a case where imposm emits an invalid geometry for a self-intersecting polygon.
as I see - the w120717877 has 4 nodes ;
so probably your example related to this change "Skips slow GEOS IsValid calls for polygons with only 4 corners."a367850
modifying the code solves your problem.
root@2d0f4fac8032:/tools/imposm3# git diff
diff --git a/writer/ways.go b/writer/ways.go
index 6db70e7..8219523 100644
--- a/writer/ways.go
+++ b/writer/ways.go
@@ -147,7 +147,7 @@ func (ww *WayWriter) buildAndInsert(
if isPolygon {
geosgeom, err = geomp.Polygon(g, way.Nodes)
if err == nil {
- if g.NumCoordinates(geosgeom) > 5 {
+ if g.NumCoordinates(geosgeom) > 4 {
// only check for valididty for non-simple geometries
geosgeom, err = g.MakeValid(geosgeom)
}
I've found a case where imposm emits an invalid geometry for a self-intersecting polygon.
The polygon is a figure-eight shape, and the files and commands to reproduce are below.
The invalid polygon causes later operations to fail like st_pointonsurface.
Files
w120717877.osm
water.yaml
Commands to reproduce
The text was updated successfully, but these errors were encountered: