Description Usage Arguments Details Value Author(s) See Also Examples
Select and cut a polygon shaped area of interest (aoi) from satellite images
1 |
satin.obj |
a satin object as returned by |
polygon |
a polygon defining the aoi to be cut |
return.poly |
if TRUE |
If provided, the polygon defining the aoi must have two columns with x and y coordinates. The function assures that the last point is exactly the same as the first one. When not specified, the user can define the polygon by a series of clicks on the previously displayed image. The result is a list containing the polygon and a “satin” object with the same dimensions as the original, but where the pixels outside the aoi are set to NA.
An object of class “satin” as returned by read.oceancolor
.
When return.poly = TRUE
, a list with two components:
aoi |
“satin” object |
polygon |
polygon coordinates defining the aoi |
Héctor Villalobos
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # load and display sample data
data(dbsst)
plotSatin(dbsst)
# define polygon, cut the image and display the aoi
polyg <- data.frame(x = c(-125, -126, -120, -119, -125), y = c(35, 30, 28, 34, 35))
dbsst.cut <- cutSatin(dbsst, polygon = polyg)
plotSatin(dbsst.cut)
## Not run:
# the same, but polygon is defined by clicking on the image
plotSatin(dbsst)
dbsst.cut <- cutSatin(dbsst, return.poly = TRUE) # *** draw the aoi polygon ***
dbsst.cut$polygon # show polygon coordinates
plotSatin(dbsst.cut$aoi) # plot the selected aoi
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.