lawn_centroid | R Documentation |
Takes one or more features and calculates the centroid using the arithmetic mean of all vertices. This lessens the effect of small islands and artifacts when calculating the centroid of a set of polygons.
lawn_centroid(features, properties = NULL, lint = FALSE)
features |
Input features, as a data-Feature or data-FeatureCollection |
properties |
A list of properties. Default: |
lint |
(logical) Lint or not. Uses geojsonhint. Takes up increasing
time as the object to get linted increases in size, so probably use by
default for small objects, but not for large if you know they are good
geojson objects. Default: |
a data-Feature<(data-Point)> - centroid of the input features
Other measurements:
lawn_along()
,
lawn_area()
,
lawn_bbox_polygon()
,
lawn_bbox()
,
lawn_bearing()
,
lawn_center_of_mass()
,
lawn_center()
,
lawn_destination()
,
lawn_distance()
,
lawn_envelope()
,
lawn_extent()
,
lawn_line_distance()
,
lawn_midpoint()
,
lawn_point_on_feature()
,
lawn_pt2line_distance()
,
lawn_square()
poly <- '{ "type": "Feature", "properties": {}, "geometry": { "type": "Polygon", "coordinates": [[ [105.818939,21.004714], [105.818939,21.061754], [105.890007,21.061754], [105.890007,21.004714], [105.818939,21.004714] ]] } }' lawn_centroid(features = poly) lawn_centroid(features = as.feature(poly)) lawn_centroid(features = poly, properties = list(foo = "bar"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.