Get maximum x coordinate
st_xmax.Rd
This function returns the maximum x coordinate in each geometry
in
the specified dbSpatial
object.
Usage
st_xmax(dbSpatial, geomName = "geom", ...)
# S4 method for class 'dbSpatial'
st_xmax(dbSpatial, geomName = "geom", ...)
Examples
# Create a data.frame with x and y coordinates and attributes
coordinates <- data.frame(x = c(100, 200, 300), y = c(500, 600, 700))
attributes <- data.frame(id = 1:3, name = c("A", "B", "C"))
# Combine the coordinates and attributes
dummy_data <- cbind(coordinates, attributes)
# Create a duckdb connection
con = DBI::dbConnect(duckdb::duckdb(), ":memory:")
# Create a duckdb table with spatial points
db_points = dbSpatial(conn = con,
value = dummy_data,
x_colName = "x",
y_colName = "y",
name = "foo",
overwrite = TRUE)
st_extent(dbSpatial = db_points)
#> xmin xmax ymin ymax
#> 100 300 500 700
st_xmax(dbSpatial = db_points)
#> [1] 300