StationsInPoly: Clip stations to a polygon

View source: R/Locations.R

StationsInPolyR Documentation

Clip stations to a polygon

Description

Returns the stations located within a given shapefile, or outside if outside=TRUE.

Usage

StationsInPoly(
  stations,
  polygon,
  outside = FALSE,
  id_col,
  datum_col,
  lat_col,
  lon_col
)

Arguments

stations

Dataframe of stations with latitude, longitude, and source datum.

polygon

Shapefile of the area to query

outside

Set to true if you want stations located outside of the polygon instead. Default is FALSE.

id_col

Quoted name of the station ID column

datum_col

Quoted name of the datum column

lat_col

Quoted name of the latitude column

lon_col

Quoted name of the longitude column

Value

A list of stations inside, or outside if outside=TRUE, of a given polygon.

Examples

StationsInPoly(stations = "result-of-GetStations()", polygon = "your-shapefile-here", outside=FALSE,
id_col = "MLocID", datum_col = "Datum", lat_col = "Lat_DD", lon_col = "Lon_DD")

donco/odeqstatusandtrends documentation built on April 20, 2024, 12:46 a.m.