Skip to content

Commit

Permalink
Merge pull request #620 from peterstace/fix_doc_comment_for_geos.Conc…
Browse files Browse the repository at this point in the history
…aveHull

Fix doc comment for `geos.ConcaveHull`
  • Loading branch information
peterstace authored May 23, 2024
2 parents 5ae7add + 97a3ead commit d52e89d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions geos/entrypoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,13 @@ func UnaryUnion(g geom.Geometry) (geom.Geometry, error) {
return rawgeos.UnaryUnion(g)
}

// ConcaveHull returns concave hull of input geometry.
// concavenessRatio - ratio 0 to 1 (0 - max concaveness, 1 - convex hull)
// allowHoles - true to allow holes inside of polygons.
// ConcaveHull returns a concave hull of the input. A concave hull is generally
// a Polygon, but could also be a 2-point LineString or a Point in degenerate
// cases. It will be made of vertices that are a subset of the input vertices.
// The concavenessRatio parameter controls the concaveness of the hull (a value
// of 1 will produce convex hulls, and a value of 0 will produce maximally
// concave hulls). The allowHoles parameter controls whether holes are allowed
// in the hull.
func ConcaveHull(g geom.Geometry, concavenessRatio float64, allowHoles bool) (geom.Geometry, error) {
return rawgeos.ConcaveHull(g, concavenessRatio, allowHoles)
}
4 changes: 2 additions & 2 deletions internal/rawgeos/entrypoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ func ConvexHull(g geom.Geometry) (geom.Geometry, error) {
return result, wrap(err, "executing GEOSConvexHull_r")
}

func ConcaveHull(g geom.Geometry, pctconvex float64, allowHoles bool) (geom.Geometry, error) {
func ConcaveHull(g geom.Geometry, ratio float64, allowHoles bool) (geom.Geometry, error) {
if C.CONCAVE_HULL_MISSING != 0 {
return geom.Geometry{}, unsupportedGEOSVersionError{
C.CONCAVE_HULL_MIN_VERSION, "ConcaveHull",
Expand All @@ -375,7 +375,7 @@ func ConcaveHull(g geom.Geometry, pctconvex float64, allowHoles bool) (geom.Geom
if allowHoles {
ah = 1
}
return C.GEOSConcaveHull_r(ctx, g, C.double(pctconvex), ah)
return C.GEOSConcaveHull_r(ctx, g, C.double(ratio), ah)
})
return result, wrap(err, "executing GEOSConcaveHull_r")
}
Expand Down

0 comments on commit d52e89d

Please sign in to comment.