query_gis: Query LAGOS GIS

Description Usage Arguments Examples

Description

Query LAGOS GIS

Usage

1
2
3
4
5
6
7
query_gis(
  layer,
  id_name = NULL,
  ids = NULL,
  crs = albers_conic(),
  gis_path = lagosnegis_path()
)

Arguments

layer

character layer name

id_name

selection column

ids

feature ids to select

crs

character projection info defaults to lagosnegis_path()

gis_path

character path to LAGOSNE GIS gpkg

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## Not run: 

library(sf)
st_layers(lagosnegis_path())

library(gdalUtils)
ogrinfo(lagosnegis_path(), "HU12", so = TRUE)

states   <- query_gis("STATE")

library(mapview)
state    <- query_gis("STATE", "State_Name", "Michigan")
res_iws  <- query_gis("IWS", "lagoslakeid", c(34352))
res_lake <- query_gis("LAGOS_NE_All_Lakes_4ha", "lagoslakeid", 34352)
res_pnt  <- query_gis("LAGOS_NE_All_Lakes_4ha_POINTS", "lagoslakeid", 34352)
mapview(state) + mapview(res_iws) + mapview(res_lake) + mapview(res_pnt)

res <- query_gis("IWS", "lagoslakeid", c(7010))
res <- query_gis("HU12", "ZoneID", c("HU12_1"))
res <- query_gis("HU8", "ZoneID", c("HU8_100"))
res <- query_gis("HU4", "ZoneID", c("HU4_5"))

# query multiple feature ids
res <- query_gis("IWS", "lagoslakeid", c(7010, 1))

## End(Not run)

jsta/LAGOSNEgis documentation built on Aug. 10, 2021, 2:08 p.m.