Check if database table has geometry column
db_table_has_geometry.RdChecks if a database table contains a geometry column. Use to confirm spatial data presence in POPS or other databases.
Arguments
- table_name
character. Name of table to check.
- con
DBI connection object. Use
connect_to_pops()for POPS connection.
Details
Queries information_schema for geometry column in specified table.
Returns logical value indicating presence.
See also
read_from_dbscripts/io/read_db.R
Other io utilities:
clean_data_dict(),
cut_and_label(),
fetch_acs(),
fetch_all_hts_tables(),
fetch_from_db(),
fetch_hts_table(),
fetch_pums(),
fetch_study_region(),
find_project_root(),
fix_value_labels_on_load(),
get_db_table_name(),
print_params(),
pums_checksum(),
read_from_db(),
read_pums_codebook(),
record_checksum(),
sampled_latlon_to_bg()
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)