Skip to contents

Checks if a database table contains a geometry column. Use to confirm spatial data presence in POPS or other databases.

Usage

db_table_has_geometry(table_name, con)

Arguments

table_name

character. Name of table to check.

con

DBI connection object. Use connect_to_pops() for POPS connection.

Value

logical. TRUE if geometry column exists, FALSE otherwise.

Details

  • Queries information_schema for geometry column in specified table.

  • Returns logical value indicating presence.

Settings

None.

Examples

## Not run:
con <- connect_to_pops("metcouncil_wave1")
#> Error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
#> 	Is the server running locally and accepting connections on that socket?
db_table_has_geometry("ms_person", con)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'conn' in selecting a method for function 'dbGetQuery': object 'con' not found
## End(Not run)