Skip to content

Commit

Permalink
geom: Don't skip 4 corner geometry validation (#255)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pnorman authored Nov 4, 2020
1 parent 56812b3 commit 4758cf4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions writer/ways.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4758cf4

Please sign in to comment.