Learn R Programming

wrspathrow (version 0.1)

pathrow_num: Get WRS-2 path/row numbers for a given spatial object

Description

Get WRS-2 path/row numbers for a given spatial object

Usage

pathrow_num(x, wrs_type = "2", wrs_mode = "D", as_polys = FALSE)
"pathrow_num"(x, wrs_type, wrs_mode, as_polys)
"pathrow_num"(x, wrs_type, wrs_mode, as_polys)

Arguments

x
a spatial object
wrs_type
1 (for WRS-1) or 2 (for WRS-2)
wrs_mode
either 'D' for descending (daytime) or 'A' for ascending
as_polys
if FALSE (default) return a data.frame. If TRUE, return a SpatialPolygonsDataFrame.

Value

data.frame with path and row as integers, or, if as_polys=TRUE, a SpatialPolygonsDataFrame

Examples

Run this code
## Not run: 
# library(sp)
# 
# pathrow_num(test_poly)
# 
# x <- pathrow_num(test_poly, as_polys=TRUE)
# plot(x)
# plot(test_poly, add=TRUE, lty=2, col="#00ff0050")
# text(coordinates(x), labels=paste(x$PATH, x$ROW, sep=', '))
# ## End(Not run)

Run the code above in your browser using DataLab