getSpatial: Generic function to derive BEC, TSA and FIZ for given...

View source: R/getSpatial.R

getSpatialR Documentation

Generic function to derive BEC, TSA and FIZ for given locations

Description

This function is to derive BEC, TSA or FIZ based on an UTM location and BEC map.

Usage

getSpatial(pointID, zone, northing, easting, spatialMap, spatialAttribute)

Arguments

pointID

character, Data point ID.

zone

integer, UTM zone.

northing

integer, UTM northing.

easting

integer, UTM easting.

spatialMap

SpatialPolygonsDataFrame or sf, Spatial map. The spatial maps are from BC Data catalogue website. You can obtain these maps using bcdata package.

spatialAttribute

character, Specifies which spatial attribute to be obtained. Must be one of "BEC", "TSA", "FIZ", "TFL" and "OWNERSHIP", regardless of lower or upper cases. Must be consistent with spatialMap arguement.

Value

Depends on what spatial attribute a function derives. For BEC, a table that contains:

  • bec_zone bec zone.

  • bec_sbz bec subzone.

  • bec_var bec variant

For TSA, a table that contains:

  • tsa tsa.

  • tsa_desc tsa descriptions.

For FIZ, a table that contains:

  • fiz fiz forest inventory zone.

For TFL, a table that contains:

  • tfl tfl timber farm licences.

  • tfl_licencee tfl timber farm licencee.

For OWNERSHIP, a table that contains:

  • owner owner of land.

  • schedule schedule.

Author(s)

Yong Luo

Examples

## Not run: 
 ## for Prince Rupert, Fort Nelson, Prince George, Victoria, Kelowna
 citylocs <- data.frame(point_ID = c("Prince Rupert", "Prince George", "Victoria", "Kelowna"),
                        zone = c(9, 10, 10, 11),
                        northing = c(6019079.41, 5974323.27, 5361626.96, 5528467),
                        easting = c(415075.83, 516441.65, 475594.70, 321996.76))
 tsamap <- bcmaps::tsa(class = "sp")
 city_tsa <- getSpatial(pointID = citylocs$point_ID,
                        zone = citylocs$zone,
                        northing = citylocs$northing,
                        easting = citylocs$easting,
                        spatialMap = tsamap,
                        spatialAttribute = "TSA")
 print(city_tsa)
 #         pointID tsa          tsa_desc
 #   Prince Rupert  46     GBR North TSA
 #   Prince George  24 Prince George TSA
 #        Victoria  38    Arrowsmith TSA
 #         Kelowna  22      Okanagan TSA

 becmap <- bcmaps::bec(class = "sp")
 city_bec <- getSpatial(pointID = citylocs$point_ID,
                        zone = citylocs$zone,
                        northing = citylocs$northing,
                        easting = citylocs$easting,
                        spatialMap = becmap,
                        spatialAttribute = "bec")
 print(city_bec)
 #        pointID bec_zone bec_sbz bec_var
 #  Prince Rupert      CWH      vh       2
 #  Prince George      SBS      mh    <NA>
 #       Victoria      CDF      mm    <NA>
 #        Kelowna       PP      xh       1

## End(Not run)

bcgov/FAIBBase documentation built on June 19, 2024, 11:57 p.m.