07_rangeMapProcess: Process ranges

Description Usage Arguments Details Note Author(s) References See Also Examples

Description

Each polygon range is overlayed on the canvas and the results are saved to the active project file.

Usage

1

Arguments

con

An sqlite connection pointing to a valid rangeMapper project.

...

Arguments to pass to the corresponding methods:
spdf SpatialPolygonsDataFrame object containing all the ranges.
ID when spdf is set this is a character vector given the name of the range.
dir ranges file directory where the individual ranges shp files are located. In this case the range ID is the file name.
metadata a named list of functions. See rangeTraits and metadataUpdate
parallel for the moment no method defined for this signature.

Details

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.

Note

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.

Author(s)

Mihai Valcu valcu@orn.mpg.de

References

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)

See Also

rangeMapper rangeTraits metadataUpdate.

Examples

 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.

rangeMapper documentation built on May 2, 2019, 5 p.m.