GetPoly: Return the polygon attribute for any point.

Description Usage Arguments Value See Also Examples

Description

GetPoly takes a dataframe of points containing at least two fields of latitude and longitude, overlays the points with a shapefile, and adds the attribute as a field to the input dataframe.

Usage

1
2
3
4
GetPoly(points, polygon = NULL,
  proj4 = "+init=epsg:4269 +proj=longlat +ellps=GRS80 +datum=NAD83 +no_defs +towgs84=0,0,0",
  polygonAddress = NULL, polygonShapeFile = NULL, join = NULL,
  parallel = FALSE)

Arguments

points

A dataframe of the points. The dataframe should contain at least two fields: "latitude" and "longitude".

polygon

SpatialPolygonDataFrame

proj4

Character: Projection to be used for points's dataframe.

polygonAddress

Characetr: Address to where polygonShapeFile is located.

polygonShapeFile

Character: Name of a polygon shapefile.

join

Character: Attribute from the polygon shapefile which will be added as a column to points dataframe

parallel

Logical (DEFAULT= FALSE)

Value

Dataframe with an extra column containing the attribute for each point.

See Also

Other geospatial: ExportGeogrid, GetGeogridIndex, GetGeogridSpatialInfo, GetProj, GetRfc, GetTimeZone, PolyToRaster

Examples

1
2
3
4
5
## Not run: 
sg<-GetPoly(sg,  polygonAddress= "/glade/scratch/arezoo/QPF_verification_rwrfhydro/gis/",
polygonShapeFile= "huc6", join="HUC6")

## End(Not run)

mccreigh/rwrfhydro documentation built on Feb. 28, 2021, 1:53 p.m.