Skip to content

Commit

Permalink
Update docs to match output type
Browse files Browse the repository at this point in the history
  • Loading branch information
skygering committed Oct 2, 2023
1 parent fe1d6da commit 055a030
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/methods/centroid.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ availible just in case the user also needs the area or length to decrease
repeat computation.
=#
"""
centroid(geom)::GI.Point
centroid(geom)::Tuple{T, T}
Returns the centroid of a given line segment, linear ring, polygon, or
mutlipolygon.
Expand All @@ -63,7 +63,7 @@ centroid(geom) = centroid(GI.trait(geom), geom)
centroid(
trait::Union{GI.LineStringTrait, GI.LinearRingTrait},
geom,
)
)::Tuple{T, T}
Returns the centroid of a line string or linear ring, which is calculated by
weighting line segments by their length by convention.
Expand All @@ -74,15 +74,15 @@ centroid(
) = centroid_and_length(trait, geom)[1]

"""
centroid(trait, geom)
centroid(trait, geom)::Tuple{T, T}
Returns the centroid of a polygon or multipolygon, which is calculated by
weighting edges by their `area component` by convention.
"""
centroid(trait, geom) = centroid_and_area(trait, geom)[1]

"""
centroid_and_length(geom)::(GI.Point, ::Real)
centroid_and_length(geom)::(::Tuple{T, T}, ::Real)
Returns the centroid and length of a given line/ring. Note this is only valid
for line strings and linear rings.
Expand All @@ -93,14 +93,14 @@ centroid_and_length(geom) = centroid_and_length(GI.trait(geom), geom)
centroid_and_area(
::Union{GI.LineStringTrait, GI.LinearRingTrait},
geom,
)::(GI.Point, ::Real)
)::(::Tuple{T, T}, ::Real)
Returns the centroid and area of a given geom.
"""
centroid_and_area(geom) = centroid_and_area(GI.trait(geom), geom)

"""
centroid_and_length(geom)::(GI.Point, ::Real)
centroid_and_length(geom)::(::Tuple{T, T}, ::Real)
Returns the centroid and length of a given line/ring. Note this is only valid
for line strings and linear rings.
Expand Down Expand Up @@ -140,7 +140,7 @@ end
centroid_and_area(
::Union{GI.LineStringTrait, GI.LinearRingTrait},
geom,
)::(GI.Point, ::Real)
)::(::Tuple{T, T}, ::Real)
Returns the centroid and area of a given a line string or a linear ring.
Note that this is only valid if the line segment or linear ring is closed.
Expand Down Expand Up @@ -179,7 +179,7 @@ function centroid_and_area(
end

"""
centroid_and_area(::GI.PolygonTrait, geom)::(GI.Point, ::Real)
centroid_and_area(::GI.PolygonTrait, geom)::(::Tuple{T, T}, ::Real)
Returns the centroid and area of a given polygon.
"""
Expand All @@ -205,7 +205,7 @@ function centroid_and_area(::GI.PolygonTrait, geom)
end

"""
centroid_and_area(::GI.MultiPolygonTrait, geom)::(GI.Point, ::Real)
centroid_and_area(::GI.MultiPolygonTrait, geom)::(::Tuple{T, T}, ::Real)
Returns the centroid and area of a given multipolygon.
"""
Expand Down

0 comments on commit 055a030

Please sign in to comment.