Skip to contents

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", ...)

Arguments

geomName

character string. The geometry column name in the dbSpatial object. Default: "geom".

...

additional arguments passed to methods

dbSpatial

object

Value

numerical column vector in database

Functions

  • st_xmax(dbSpatial): Method for dbSpatial object

See also

Other geom_summary: st_extent(), st_ymax()

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