Description Usage Arguments Details Note Author(s) References See Also Examples
Each polygon range is overlayed on the canvas and the results are saved to the active project file.
1 | processRanges(con,...)
|
con |
An sqlite connection pointing to a valid |
... |
Arguments to pass to the corresponding methods: |
The overlay is performed using overlay
. If the overlay returns no results (i.e. the polygon is smaller than a grid cell) then the centroid of the range will snap to the nearest point and only one grid cell will be returned for that range.
If thousands of individual range map polygons are processed, their geometries are complex and/or the canvas resolution is relatively high this step can be time consuming.
Mihai Valcu valcu@orn.mpg.de
Valcu, M., Dale, J. and Kempenaers, B. (2012) rangeMapper: A platform for the study of macroecology of life history traits. 21(9). (DOI: 10.1111/j.1466-8238.2011.00739.x)
rangeMapper
rangeTraits
metadataUpdate
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | require(rangeMapper)
wd = tempdir()
## Not run:
# Multiple files (one file per range)
rdr= system.file(package = "rangeMapper", "extdata", "wrens", "vector")
dbcon = rangeMap.start(file = "wrens.sqlite", overwrite = TRUE, dir = wd)
global.bbox.save(con = dbcon, bbox = rdr)
gridSize.save(dbcon, gridSize = 2) ; canvas.save(dbcon)
system.time(processRanges(dir = rdr, con = dbcon))
## End(Not run)
# One file containing all the ranges
r = readOGR(system.file(package = "rangeMapper", "extdata",
"wrens", "vector_combined"), "wrens", verbose = FALSE)
dbcon = rangeMap.start(file = "wrens.sqlite", overwrite = TRUE, dir = wd )
global.bbox.save(con = dbcon, bbox = r)
gridSize.save(dbcon, gridSize = 2)
canvas.save(dbcon)
system.time(processRanges(spdf = r, con = dbcon, ID = "sci_name" ))
# ~ 18 times faster than processing individual ranges.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.