Compute the centroid of this geometry.
Usage
sx_centroid(
x,
of_largest_polygon = FALSE,
output = NULL,
view_name = NULL,
verbosity = NULL,
...
)Arguments
- x
Input object (sf, sedonadb_dataframe, or character view name).
- of_largest_polygon
Logical. If
TRUE, returns the centroid of the largest polygon of a multipolygon. (Not yet supported by SedonaDB backend, ignored with warning if TRUE).- output
Character or NULL. Output type:
sedonadb_dataframe(default),sf,tibble,geoarrow, orraw. If NULL, usesgetOption("sx.output_type", "sedonadb_dataframe").Output types:
sedonadb_dataframe: Lazy data frame (no collection).sf: Materialized sf object.tibble: Tibble without geometry.geoarrow: Tibble withgeoarrow_vctrgeometry (Arrow-native).raw: Tibble with geometry as raw WKB bytes (for database import).
- view_name
Character (optional). Name to register the result as a persistent view in the active backend. If NULL (default), returns the result directly without creating a view.
Not all backends support named views. Check backend-specific documentation for availability.
- verbosity
Character or NULL. Controls message output for this function call.
"quiet": Suppress all informational messages."info": Show standard progress and status messages."debug": Show additional diagnostic messages for troubleshooting.
If NULL (the default), uses the global
sx.verbosityoption. Seesx_options()for persistent configuration.- ...
Ignored. Used to catch and warn about unsupported sf arguments.
