Learn R Programming

sptemExp (version 0.1.4)

getRidbytpoly: getRidbytpoly for Assignment of Thiessen polygon id to point object

Description

Assign the polygon id to the data points.

Usage

getRidbytpoly(tpolys,pntlayer,isnearest)

Arguments

tpolys

Thiessen polygons, data format: SpatialPolygonsDataFrame.

pntlayer

Points for assignment for polygons. SpatialPointsDataFrame.

isnearest

whether to use nearest method to assign polygon id for no overlay with polygons, default: TRUE

Value

polygon id

Examples

Run this code
# NOT RUN {
  data("samplepnt","prnside")
  # Point
  x=samplepnt
  # Border
  sidepoly=prnside
  # Get the Thiessen polygons
  res=tpolygonsByBorder(x,sidepoly)
  # Assign the regional id
  rids=getRidbytpoly(res$tpolys,x)

# }

Run the code above in your browser using DataLab