Spatial Analysis With R
-
Upload
edwin-j-alvarado -
Category
Documents
-
view
14 -
download
0
description
Transcript of Spatial Analysis With R
![Page 1: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/1.jpg)
Spatial analysis with R
Lucy Bastin Aston University
![Page 2: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/2.jpg)
General plan • Spatial questions • Spatial data formats & types • R packages for
– Spatial data analysis – Map visualisation
• Research examples – Disease mapping – Web-based interpolation – Conservation planning
![Page 3: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/3.jpg)
Spatial questions
• Metric space – How far? What direction? What area?... – Affected by map projection – Image processing, Vector graphics, CAD…
• Topological space – Connected? Within? Accessible from? – Graph theory, optimal routing…
![Page 4: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/4.jpg)
Vector models of the world
• Coordinates: points, lines, polygons etc.. • Great for discrete, homogeneous objects.
© Crown Copyright/database right 2007 An Ordnance Survey/EDINA supplied service
![Page 5: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/5.jpg)
Raster models of the world
• Regular sampling: ideal for continuous phenomena - aerial photo or a satellite image.
![Page 6: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/6.jpg)
Vector and raster data in R
• Vector formats – Shapefiles, csv and text files…
• Raster formats – Geotiff, netCDF..
sp, rgdal, raster, maptools, RArcInfo, ncdf
fundamental data types and reading/writing
![Page 7: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/7.jpg)
Spatial analysis in R gstat, geoR, intamap, spacetime, akima spatial / spatiotemporal kriging / interpolation rgeos
topological operations: e.g.,intersection… PBSmapping, maps, GEOmap, mapproj point-in-polygon, re-projection… ecespa, spatstat, spatial, splancs point pattern analysis trip, adehabitat, rangeMapper animal tracking and territory mapping landsat topographic /other correction of satellite imagery glmmBUGS, Mondrian, spdep, RPyGeo…
![Page 8: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/8.jpg)
Visualisation in R
RgoogleMaps,plotKML,OpenStreetMap overlay data on Google Maps or OSM ggmap (enhances ggplot2) overlay on Google Maps, Stamen, OSM or CloudMade rasterVis
interactive image mapping (esp. large rasters) maps, GEOmap, rworldmap, GADM country boundary datasets & map functions
![Page 9: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/9.jpg)
Claudia Engel: GADM example from http://blog.revolutionanalytics.com/2009/10/geographic-maps-in-r.html
![Page 10: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/10.jpg)
* http://journal.r-project.org/archive/2011-1/RJournal_2011-1_South.pdf
rworldmap
![Page 11: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/11.jpg)
References, tutorials, etc. http://www.bias-project.org.uk/ASDARcourse/unit7_slides.pdf https://sites.google.com/site/rodriguezsanchezf/news/usingrasagis http://www.itc.nl/~rossiter/teach/R/RSpatialIntro_ov.pdf * https://dl.dropbox.com/u/24648660/ggmap%20useR%202012.pdf http://www.nceas.ucsb.edu/scicomp/usecases/CreateMapsWithRGraphics http://journal.r-project.org/archive/2011-1/RJournal_2011-1_South.pdf http://geography.uoregon.edu/geogr/topics/maps.htm http://www.milanor.net/blog/?p=594 http://spatialanalysis.co.uk/r/
![Page 12: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/12.jpg)
1. Disease mapping • Working with local PCTs to map infection. • Example: community-associated MRSA. • Infections in people who have not recently
visited a hospital as an in- or out-patient. • Using demographic / environmental factors
to identify SIGNIFICANT clusters of disease. • R packages: splancs and spatstat
![Page 13: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/13.jpg)
![Page 14: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/14.jpg)
Simulating disease rates
•Underlying population demographics – E.g., differing susceptibility with age.
0
0.005
0.01
0.015
0.02
0.025
0.03
0.035
0to4
5to15
16to2
9
30to4
4
45to5
9
60to6
4
65to7
4
75to8
4
85plu
s
MRSAMSSA
Ratio of MRSA to MSSA by age category
00.20.40.60.8
11.2
0to4 5to15 16to29 30to44 45to59 60to64 65to74 75to84 85plus
![Page 15: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/15.jpg)
Simulated disease cases
Underlying population stratified by age and other risk factors Many realisations created (e.g., to model the expected patterns if infection was a random Poisson process free of spatial autocorrelation)
![Page 16: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/16.jpg)
Disease mapping and modelling
Using underlying data on sociodemographic and environmental factors to identify SIGNIFICANT clusters of disease – e.g., community-associated MRSA
These point realisations are kernel-filtered, to produce density grid maps that can be overlaid.
![Page 17: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/17.jpg)
![Page 18: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/18.jpg)
Disease mapping and modelling
Using underlying data on sociodemographic and environmental factors to identify SIGNIFICANT clusters of disease – e.g., community-associated MRSA
Grey = 97.5th percentile of the simulated surfaces
Significant spatio-temporal clusters
![Page 19: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/19.jpg)
Disease mapping and modelling
Using underlying data on sociodemographic and environmental factors to identify SIGNIFICANT clusters of disease – e.g., community-associated MRSA
Cluster locations investigated in detail: - Unreported outbreaks at nursing homes. - Infections in surrounding areas. Bastin, Rollason, Hilton et. al (2007) International Journal of GIS, 21 (7): 811-835.
![Page 20: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/20.jpg)
Specific genetic strains of MRSA clustered in specific areas of the West Midlands. Potential for tracking & tracing infections which move between hospital & community (e.g., C. difficile). Ethical issues - patient confidentiality!!!
Rollason, Bastin, Hilton et. al (2008)
Journal of Hospital Infection, 70 (4): 314-20
![Page 21: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/21.jpg)
2. Web-based interpolation
• Real-time automatic mapping of environmental variables.
• Web Services expose R algorithms to interpolate from point observations, with clearly-quantified reliability.
• http://www.intamap.org
• Used Java to interface with R, but…. • http://www.rstudio.com/shiny/
![Page 22: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/22.jpg)
Case study – radiation EURDEP radiation monitoring network
Web Service for interpolating and mapping risk.
![Page 23: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/23.jpg)
Sensor networks - issues. Sensor brand A: Precision ± 0.3 No bias
Sensor brand B: Gaussian error ± 0.8 Potential bias due to elevation. Sensor brand C: Positive exponential noise, varies with level. Bias unknown.
Network is HETEROGENEOUS in spatial pattern and accuracy of measurements.
Projected sequential Gaussian process kriging (Cornford et al., StatGIS, 2009)
![Page 24: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/24.jpg)
![Page 25: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/25.jpg)
![Page 26: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/26.jpg)
![Page 27: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/27.jpg)
![Page 28: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/28.jpg)
3. Conservation planning
• Select sites for protection based on their potential, now and in the future.
• Data on species and available habitat is prone to error.
• The future context may be hard to predict.
• Can simulate various outcomes: climate change, development pressure, policy…
![Page 29: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/29.jpg)
Identify species of interest
Example PA: Ngorongoro Species extent: 50% with most restricted ranges
![Page 30: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/30.jpg)
• Identify biome ‘envelope’ - Climatic variables from Holdridge’s lifezones
(Biotemperature, precipitation, PET/precipitation)
![Page 31: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/31.jpg)
Current
2080
![Page 32: Spatial Analysis With R](https://reader033.fdocuments.net/reader033/viewer/2022052603/563dbaf1550346aa9aa8f24d/html5/thumbnails/32.jpg)
http://ehabitat-wps.jrc.ec.europa.eu/ehabitat/