Skip to content

Commit b574f61

Browse files
Use ST_MakeValid with method=structure instead of ST_Buffer with radius 0
1 parent 46f1a8f commit b574f61

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

database/postgis/columns.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func (t *validatedGeometryType) GeneralizeSQL(colSpec *ColumnSpec, spec *General
5858
// TODO return warning earlier
5959
log.Printf("[warn] validated_geometry column returns polygon geometries for %s", spec.FullName)
6060
}
61-
return fmt.Sprintf(`ST_Buffer(ST_SimplifyPreserveTopology("%s", %f), 0)::Geometry as "%s"`,
61+
return fmt.Sprintf(`ST_MakeValid(ST_SimplifyPreserveTopology("%s", %f), 'method=structure')::Geometry as "%s"`,
6262
colSpec.Name, spec.Tolerance, colSpec.Name,
6363
)
6464
}

0 commit comments

Comments
 (0)