From 4758cf45eac86907877be4b1d2abe39713bd0c51 Mon Sep 17 00:00:00 2001 From: Paul Norman Date: Tue, 3 Nov 2020 22:54:49 -0800 Subject: [PATCH] geom: Don't skip 4 corner geometry validation (#255) These can be invalid in some cases like a figure-of-eight shape. Because there are so few triangle geometries and they are quick to validate, it's simplest to just remove the special casing of small geoms. --- writer/ways.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/writer/ways.go b/writer/ways.go index 6db70e70..af9b4f75 100644 --- a/writer/ways.go +++ b/writer/ways.go @@ -147,10 +147,7 @@ func (ww *WayWriter) buildAndInsert( if isPolygon { geosgeom, err = geomp.Polygon(g, way.Nodes) if err == nil { - if g.NumCoordinates(geosgeom) > 5 { - // only check for valididty for non-simple geometries - geosgeom, err = g.MakeValid(geosgeom) - } + geosgeom, err = g.MakeValid(geosgeom) } } else { geosgeom, err = geomp.LineString(g, way.Nodes)