getGeoData: Retrieves online geodata and converts it to raster/sp objects

Description Usage Arguments Value Well Known Data Sets Additional Data Sets Author(s) References Examples

View source: R/getGeoData.R

Description

Robert J. Hijmans getData() from the raster package is well known and highly used. The only disadvantage is that it currently doesn't support a bunch of great additional and/or improved/newer data sets. getGeoData provides some more actual or better choices for climate and DEM data as well as some easy to use interfaces to OSM and other crowd sourced data compilations. The main issue of the functionis to offer an easy to use access to a wider range of free to access data sets that may improve significantly the quality of typical ecological and other spatial analysis approaches by an straightforward utilization of data. You may download the data individually but by default all data will be downloaded georeferenced and converted in raster or sp objects.

Usage

1
2
getGeoData(name, download=TRUE, path='', ...)
ccodes()

Arguments

name

Data set name, currently supported are: GADM,
countries,
SRTM,
alt,
worldclim,
schmatzPangea,
harrylist,
OSM,
tiroldem.
See Details for more info

download

Logical TRUE data will be downloaded if not locally available

path

Character Path name indicating where to store the data. Default is the current working directory

...

Additional required (!) parameters. These are data set specific. See Details

Value

A spatial object (Raster* or Spatial*)

Well Known Data Sets

GADM

GADM is a database of global administrative boundaries.
alt stands for altitude (elevation); the data were aggregated from SRTM 90 m resolution data between -60 and 60 latitude.
countries has polygons for all countries at a higher resolution than the 'wrld_simpl' data
in the maptools pacakge .
If name='alt' or name='GADM' you must provide a 'country=' argument. Countries are specified by their 3 letter ISO codes. Use getData('ISO3') to see these codes. In the case of GADM you must also provide the level of administrative subdivision (0=country, 1=first level subdivision). In the case of alt you can set 'mask' to FALSE. If it is TRUE values for neighbouring countries are set to NA. For example:

getGeoData('GADM', country='FRA', level=1)
getGeoData('alt', country='FRA', mask=TRUE)

SRTM

SRTM refers to the 4.1 version of the CGIAR-SRTM (90 m resolution).
If name='SRTM' you must provide at least the extent of an area as argument (minlong,minlat,maxlong,maxlat).

CMIP5

If name=CMIP5 for (projected) future climate data you must provide arguments var and res as above. Only resolutions 2.5, 5, and 10 are currently available. In addition, you need to provide model, rcp and year. For example:
getGeoData('CMIP5', var='tmin', res=10, rcp=85, model='AC', year=70)
function (var, model, rcp, year, res, lon, lat, path, download = TRUE)
'model' should be one of "AC", "BC", "CC", "CE", "CN", "GF", "GD", "GS", "HD", "HG", "HE", "IN", "IP", "MI", "MR", "MC", "MP", "MG", or "NO".
'rcp' should be one of 26, 45, 60, or 85.
'year' should be 50 or 70
Not all combinations are available. See www.worldclim.org for details.

worldclim

worldclim is a database of global interpolated climate data.
If name='worldclim' you must also provide a variable name 'var=', and a resolution 'res='. Valid variables names are 'tmin', 'tmax', 'prec' and 'bio'. Valid resolutions are 0.5, 2.5, 5, and 10 (minutes of a degree). In the case of res=0.5, you must also provide a lon and lat argument for a tile; for the lower resolutions global data will be downloaded. In all cases there are 12 (monthly) files for each variable except for 'bio' which contains 19 files.
getGeoData('worldclim', var='tmin', res=0.5, lon=5, lat=45)
getGeoData('worldclim', var='bio', res=10)

Additional Data Sets

Schmatz gridded climate data of LGM

schmatzPangea provides the gridded climate data from 5 Global Climate Models (GCM) of the Last Glacial Maximum (LGM) downscaled to 30 arc seconds for Europe http://doi.pangaea.de/10.1594/PANGAEA.845883
If name='schmatzPangea' you have to specify the item of interest. Please note: The data download may take a long time!

The list of allowd items is (long):

m<-getGeoData('schmatzPangea', item="tasmax_A_MO_pmip2_21k_oa_CCSM_eu_30s",startTime=1,endTime=3) m<-getGeoData('schmatzPangea', item="bioclim_A_MO_pmip2_21k_oa_CCSM_eu_30s",data="bio_1") TT<- getGeoData('schmaztLGMData', item='TT_Luterbacher_Xoplaki_1659-1998')

Harry's Peaks

harrylist is a list of world wide about 60.000 coordinates altitudes and names of summits PeakList
If name='harrylist' you will download and clean the complete list
getGeoData('harrylist')

OSM Point Data

OSMp is the OSM Point Data from the current OSM database
If name='OSMp' you must provide lat_min,lat_max,lon_min,lon_max for the boundig box. Additionally you must set the switch 'all' to FALSE if you just want to download a specified item. Then you have to provide the content of the desired items in the 'key' and 'val' argument. According to this combination you have to provide a tag list containing the Tags of the element c('name','ele').

getGeoData('OSMp', extent=c(11.35547,11.40009,47.10114,47.13512), key='natural',val='peak',taglist=c('name','ele'))

Digital Elevation Model of Tyrolia

tiroldem refers to the 10 m Lidar based DEM as provided by the Authorithy of Tirol. For Copyright and further information see: DEM

If name='tiroldem' you must set the switch 'all' to FALSE if you just want to download a specified item you have to set data=item. The list of allowd items is:

For use in ArcGIS the data is correctly georeferenced. However for R you MUST use the following proj4 strings if you want to project other data acccording to the Austrian Datum. DO NOT USE the default EPSG Code string! All datasets except Lienz are projected with: ”+proj=tmerc +lat_0=0 +lon_0=10.33333333333333 +k=1 +x_0=0 +y_0=-5000000 +ellps=bessel +towgs84=577.326, 90.129, 463.919, 5.137, 1.474, 5.297, 2.4232 +units=m'. Item=lz_10m (Lienz) has an different Central_Meridian. You have to change it to 13.333333.

getGeoData('tiroldem', item = 'KU_DGM10')

Author(s)

Robert J. Hijmans, Chris Reudenbach giswerk@gis-ma.org

References

http://www.worldclim.org
http://www.gadm.org
http://srtm.csi.cgiar.org/
http://diva-gis.org/gdata
http://www.tourenwelt.info
https://www.tirol.gv.at/data/datenkatalog/geographie-und-planung/digitales-gelaendemodell-tirol/
http://www.openstreetmap.org
http://doi.pangaea.de/10.1594/PANGAEA.845883

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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#### Examples getGeoData

## Not run: 
## get SRTM data at a position
r<-getGeoData(name="SRTM",xtent = extent(11.,11.,50.,50.))
## get SRTM data for an area
r<-getGeoData(name="SRTM",xtent = extent(11.,17.,50.,56.))
## get SRTM data for an area with a buffer zone (e.g. for a cost or watershed analysis) zone is in degree
r<-getGeoData(name="SRTM",xtent = extent(11.,17.,50.,56.), zone = 3.0)
## get SRTM Tile names
t<-getGeoData(name="SRTM",xtent = extent(11.,17.,50.,56.), zone = 3.0, download = FALSE)
## get SRTM data for an area with a buffer and merge it
r<-getGeoData(name="SRTM",xtent = extent(11.,17.,50.,56.), zone = 3.0, merge = TRUE)

## get Schmatz et al. data please have a look at details
r<- getGeoData('schmatzPangea', item='tasmin_A_MO_pmip2_21k_oa_CNRM_eu_30s',endTime=12)
r<- getGeoData('schmatzPangea', item="bioclim_A_MO_pmip2_21k_oa_CCSM_eu_30s", layer="bio_1")

## get a single tile of the Tirolean DEM
r<- getGeoData('tiroldem', items='IBK_DGM10')
## get a single 3 tiles of the Tirolean DEM as a merged raster
r<- getGeoData('tiroldem', item=c('IBK_DGM10','IL_DGM10','IM_DGM10'), merge =TRUE)

# get arbitrary OSM point data
r<- getGeoData('OSMp', extent=c(11.35547,11.40009,47.10114,47.13512), key='natural',val='saddle',taglist=c('name','ele','direction'))

# get Harald Breitkreutz' summit list
r<- getGeoData('harrylist', extent=c(11.35547,11.40009,47.10114,47.13512))

### the following datasets are retrieved according to Hijmans \code{getData}
r<- getGeoData('worldclim', var='tmin', res=0.5, lon=5, lat=45)
r<- getGeoData('worldclim', var='bio', res=10)
r<- getGeoData('CMIP5', var='tmin', res=10, rcp=85, model='AC', year=70)
v<- getGeoData('alt', country='FRA', mask=TRUE)
v<- getGeoData('GADM', country='FRA', level=1)
t<- ccodes()

## End(Not run)

gisma/robubu documentation built on May 17, 2019, 5:28 a.m.