Skip to contents

Check CRS of a table

Usage

ddbs_crs(conn, name, crs_column = "crs_duckspatial")

Arguments

conn

a connection object to a DuckDB database

name

a character string of length one specifying the name of the table, or a character string of length two specifying the schema and table names.

crs_column

a character string of length one specifying the column storing the CRS (created automatically by ddbs_write_vector)

Value

CRS object

Examples

if (FALSE) { # interactive()
## load packages
library(duckdb)
library(duckspatial)
library(sf)

## database setup
conn <- dbConnect(duckdb())
ddbs_install(conn)
ddbs_load(conn)

## read data
countries_sf <- st_read(system.file("spatial/countries.geojson", package = "duckspatial"))

## store in duckdb
ddbs_write_vector(conn, countries_sf, "countries")

## check CRS
ddbs_crs(conn, "countries")
}