extract_zones: Get zones geometry from the database or built-in files

View source: R/zone_leaflet.R

extract_zonesR Documentation

Get zones geometry from the database or built-in files

Description

Get zones geometry from the database or built-in files

Usage

extract_zones(
  zones_shp_name = NULL,
  db = NULL,
  tbl_name = "ALLZONES",
  wkt_col = "WKTSURFACE",
 
    proj4string = "+proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120.5 +x_0=399999.9999999999 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs"
)

Arguments

zones_shp_name

chr. The name of the zones_shp object in data to use if the database does not contain the WKT geometry for zones. Possible values are "zones_shp", "zones_shp_swim25".

db

class src. The connection to the database.

tbl_name

chr. The name of the table in db containing the geometry Defaults to ALLZONES.

wkt_col

chr. The name of the column in tbl_name containing the WKT geometry. Defaults to WKTSURFACE

proj4string

chr. The proj4 string for the wkt_col coordinates. Defaults to Oregon Lambert.

Details

This function extracts the geography for the zones from the scenario database. It automatically reprojects the data to WGS84 using st_transform. If the database does not contain geography, then data(zones_shp) is returned instead, unless otherwise specified by the user.

Value

a SpatialPolygonsDataFrame in WGS84 lat long coordinates.


pbsag/swimr documentation built on July 4, 2025, 12:10 p.m.