Returns a point guaranteed to lie on the geometry, unlike ga_centroid(),
which can fall outside a concave shape.
Details
For a polygon this is a point on the interior, chosen from the horizontal line closest to the centroid. An empty or null geometry becomes a null element.
See also
Other query:
ga_closest_point(),
ga_is_convex(),
ga_line_locate_point()
Examples
g <- geoarrow::as_geoarrow_array(sf::st_sfc(sf::st_polygon(list(
matrix(c(0, 0, 4, 0, 4, 4, 0, 4, 0, 0), ncol = 2, byrow = TRUE)
))))
sf::st_as_sfc(geoarrow::as_geoarrow_vctr(ga_interior_point(g)))
#> Geometry set for 1 feature
#> Geometry type: POINT
#> Dimension: XY
#> Bounding box: xmin: 2 ymin: 2 xmax: 2 ymax: 2
#> CRS: NA
#> POINT (2 2)