Download presentation

Presentation is loading. Please wait.

1
Extending ArcGIS with R Mark Janikas, PhD

2
Outline IntroductionIntroduction –What is R? Why should I use it? ApplicationApplication –Point Clustering Integration optionsIntegration options –R versus Rpy Conclusions and Future DirectionsConclusions and Future Directions

3
What is R? Why should I use it? R (The R Project for Statistical Computing) is an open- source data analysis package. (GNU S)R (The R Project for Statistical Computing) is an open- source data analysis package. (GNU S)The R Project for Statistical ComputingThe R Project for Statistical Computing –Widely Used Over 60 CRAN sites across 30+ countriesOver 60 CRAN sites across 30+ countries –Its Free GNU GENERAL PUBLIC LICENSEGNU GENERAL PUBLIC LICENSE –Base is powerful Statistics, Linear Algebra, Visualization, etc…Statistics, Linear Algebra, Visualization, etc… –Its extendible Contributed Extensions1800+ Contributed Extensions splancs, spatstat, spdep, rgdal, maptools, shapefilessplancs, spatstat, spdep, rgdal, maptools, shapefiles

4
R Point Clustering Tools for ArcGIS Resource Center (Code Gallery)Resource Center (Code Gallery)Resource Center (Code Gallery)Resource Center (Code Gallery) Contains two tools… that do the same thing!Contains two tools… that do the same thing!

5
Application: Point Clustering Cluster a given a set of point locations:Cluster a given a set of point locations: –Spatial Proximity –Attributes Values

6
Integration with ArcGIS Two (Three) Integration Options With ArcGISTwo (Three) Integration Options With ArcGIS Both require PythonBoth require Python Both have pros and consBoth have pros and cons ESRI UC Plenary 2008ESRI UC Plenary 2008 –predicting plant species in unknown areas

7
Integration: R Option Decouples R and PythonDecouples R and Python PythonPython –Retrieves and organize parameters from ArcGIS –Convert Data (Interchange) Shapefiles, netcdf, img etc….Shapefiles, netcdf, img etc…. –Spawns R given the *.r file with provided parameters R –Does the analysis

8
Integration: RPy Option R and Python closely coupledR and Python closely coupled RPy (RPy2)RPy (RPy2) –Python Interface to the R Programming Language PythonPython –Retrieves and organize parameters from ArcGIS –RPy module is imported and R commands are executed within the Python script file

9
Which One Should I Use? R OptionR Option –Attractive to R Programmers –Out of Proc: Spawning R on every execute –Use Copy Features!!! selection setsselection sets Projections and other environment variablesProjections and other environment variables –You must use an R library for handling shapefiles maptools, shapefilesmaptools, shapefiles –Two files per script tool (*.py and *.r)

10
R Option Code Snippet

11
Which One Should I Use? Cont… RPy OptionRPy Option –For more advanced users (Python and R knowledge) –In Process Will be MUCH faster after the first callWill be MUCH faster after the first call –Honors selection sets –A robust choice of database formats –Will honor environment settings (GP Functions) –Only a single file associated with your script tool

12
RPy Option Code Snippet Source R Libraries Create Output Cluster Analysis NumPy and R Interchange

13
Which One Should I Use? Cont… Wait… Why would I go with the R Option?Wait… Why would I go with the R Option? –Doesnt have as many dependencies/layers –RPy Python, R, and RPy builds have to play nice!Python, R, and RPy builds have to play nice! You must know Python, some R and now RPy.You must know Python, some R and now RPy. –Currently there is an open bug in RPy that must be fixed in order to run in the In Process mode in ArcGIS Manual fix in the portal tool documentationManual fix in the portal tool documentation Both methods require the editing of Environment Variables in order to run properlyBoth methods require the editing of Environment Variables in order to run properly

14
Conclusions R –contains cutting edge data analysis techniques from a wide body of academic and applied fields –extendible –Open-source Can be integrated with ArcGIS using PythonCan be integrated with ArcGIS using Python –R versus RPy (RPy2) Pros and ConsPros and Cons

15
Future Directions RPy2RPy2 Web Portal: RToolsWeb Portal: RTools –Could be expanded upon Calling Python from RCalling Python from R –Leveraging geoprocessing within the R environment –RSPython:

16
Links R –http://www.r-project.org/index.html RPy (Link to RPy2)RPy (Link to RPy2) –http://rpy.sourceforge.net/ PythonPython –http://www.python.org/ NumPyNumPy –http://www.numpy.org/

17
Related Sessions Developing Python Scripts for Data Analysis Tips and TricksDeveloping Python Scripts for Data Analysis Tips and Tricks –Geoprocessing Demo Theater – W, 5:00 – 6:00 Spatial Statistics: Using Spatial StatisticsSpatial Statistics: Using Spatial Statistics –TH 1:30 – 2:45 Regression Analysis for Spatial Data with ArcGIS 9.3Regression Analysis for Spatial Data with ArcGIS 9.3 –TH 3:15 – 4:30

Similar presentations

© 2016 SlidePlayer.com Inc.

All rights reserved.

Ads by Google