 Hello, my name is Orvin Aiden and today I will talk about ArcGIS Binding and R package for integrating R in ArcGIS. ArcGIS is a GIS platform that contains spatial and spatial temporal data sources and their representations and spatial analysis tools to analyze these data sources. Our ArcGIS bridge allows us to directly access ArcGIS through R. Here we can return R objects back to ArcGIS native data types or we can convert ArcGIS spatial data types into their counterparts in R. So the ArcGIS bridge gives us this seamless connection between spatial and spatial temporal data sources and analysis functions in ArcGIS and R. ArcGIS Binding package, which is the ArcGIS bridge projects R package, can be used in different ways. For instance, it can be used for reading and writing vector data and raster data that can take multiple formats. We allow direct conversion from ArcGIS format data types to R spatial data frames such as SP and SF. In addition, we have in platform bindings to R that allows us to create tools, GUI-driven tools that can interact with R libraries. And the idea there is to open up the wealth of analysis in R to GIS audience that may or may not be familiar with R programming language in particular. In terms of our vector data support, we provide support for key R objects and spatial packages in terms of converting ArcGIS type objects into R data frames. We have on the fly conversion capabilities to SP and SF. In addition, we can do customized data manipulations on the fly and this is particularly useful when working with big spatial data sources. On the raster side, the story is very similar. We can consume raster objects in GIS platform directly as R rasters. We can bring them in to R for analysis and we can also write them back to GIS for further analysis and visualization. In addition, we have a new conda package called ArcGIS Essentials that is built on top of ArcGIS ProPy3, which is our native conda package that drives our desktop software, which is ArcGIS Pro. ArcGIS ProPy3 conda package contains common libraries such as ArcPy and ArcGIS. ArcPy is a proprietary spatial data science library that we develop at ESRI. In addition to that, it's built on top of commonly used Pythonic libraries such as Numpy and Pandas. And with our introduction of ArcGIS Essentials, we actually enabled spatial analysis capabilities of GIS within an R framework. And using this conda package, we actually can bring in Microsoft's version of ArcGIS binding, which is our R package for GIS integration, and also libraries that support basic spatial analysis and R notebooks so that you can create easily a conda environment where you can leverage the package that we developed for spatial R analysis. That brings me to patterns of working with R. If you have local data on your machine, if you're doing local analysis, you can bring it in and out of R to do your analysis. And also if you're remote data sources, especially ESRI's REST API that serves feature services, which is remote feature data, vector data, and also image services, which is remote raster data, you can directly consume these data sources, remote data sources into R as a data frame, and create useful widgets that you can serve in an outward facing frontend. In addition, we have integration into ESRI leaflets that allows us to create interactive maps. This is a bird's-eye view of ArcGIS binding, and I will explain how it can be useful in analysis and how it can be used in a hands-on demo that's going to be next. But if you're interested in additional reading, there's a link that you can follow where you will find more information about ArcGIS binding. In this demo, we'll explore how to use our notebooks and the R ArcGIS bridge to solve a spatial problem. First and foremost, we will import all of the libraries we need. So I'm just going to go ahead and run this code. Now, all of my libraries are imported. The first thing I want to do is run Arc.CheckProduct. We have to run ArcCheckProduct so that this function makes sure that we have a valid pro license, defines what type of license it is, what version of pro I have, what type of license I have, I have an advanced license, and also the version of the bridge that I'm using, which is version 239. Here, I'm going to be using reticulate to import ArcPy. Here, I have a data source that contains house prices in King County, Washington, along with the house attributes. It lives in this URL. We can quickly copy-paste this URL and see that it actually corresponds to a layer. And I can view this dataset online. Here, I have house prices in King County, Washington. And all these houses have certain attributes, such as the number of rooms, bedrooms, bathrooms, and the sale price, so on and so forth. So using this URL, I can directly interact with the REST API to bring this remote data source as an R data frame. Here, the interaction is very simple. Just like bringing in a local data source, you just use ArcOpen to bring this dataset in. Once this dataset is in R as an R data frame, now I can do my regular R analysis on it, because I've already brought it in as an R data frame from this remote data source. For example, I can convert this Arc data type to an SF so that I can quickly plot the first four columns and see what type of data I'm looking at. And these are static plots in R. We all use it. They are useful to look at data. Here, it's coloring different attributes of this spatial data coming from King County, Washington. Every circle corresponds to a house. So here we see object IDs, the date, the prices located, the price. So these are somewhat useful, and they still have a lot of relevance in analysis. We can go one step further and actually start creating interactive maps that tell a story. And now we can do that simply by using our esri.leaflet integration with an ArcJS bridge. So how did we do that? First thing I do is I just define a color palette. So I'm just defining a color scheme based off of the house price. And if you're wondering what house price corresponds to, let's quickly go back. House price is the Arc object that was defined by ArcSelect. So through this integration with leaflet, we actually have such a tight connection that leaflet can actually understand ArcObjects that we bring in using ArcOpen and ArcSelect. The first thing I do with leaflet is I define a blank map. I just give it a name and I define a blank map. The next thing I do is I add tiles. The tiles are the base map for this leaflet. And after I do that, I can use the function add circle markers where the data is the house price and the color will be rendering using this color rendering scheme that we defined above. I'm going to be defining circles of radius 5 and I'm going to be embedding a pop-up label that tells me the house price at a given location. I'm going to add a legend to this interactive map and I'm going to show it on this notebook. Once the interactive map is published, you can see that this actually is a very effective way of communicating data. Here I can interact with this map, I can zoom in and I can hover over data to see the house price at any given location. And the data is plotted using this quartile map that is defined on the right. So this is how we can bring in remote data sources and create interactive maps within our notebooks. And this is very powerful for spatial analysis. Interactive maps exist in R and they are doable and they are quite wonderful for analysis. In the R bridge team, we just want to make it as simple as possible so that you can bring your powerful analysis to light. And this is one way of telling a powerful story by being able to interactively plot your data or even embed this data or analysis driven by R in a widget. Now with these interactive maps, you can easily do that. Of course, our integration is not only bound to remote data sources that live on our servers. As long as there is an SG type REST API, you can still interact with data sources. For example, King County, Washington's GIS database has a lot of SG format feature services. For example, they have a polygon for school districts. It lives under this URL. Again, using our Copenhagen Arc Select, I'm going to bring this dataset in. This is different from the house price data because these are not points. These are polygons with some geometry. What I would like to do is overlay these polygons on the house price map that I just created. I brought in the remote data source from King County's GIS database. And now I'm simply going to append it to my active map which is defined with this variable L and the data I'll be plotting is school data which is the Arc Select object which is pointing to the remote data source. We have the school polygons overlaid on the house price data we had on the previous map. In addition to interacting with remote data sources and interactive mapping, I would also like to touch on our reticulate used within our notebooks and how we can call ArcPy from an R notebook. You might be wondering, why would I want to do that? If you would like to automate a large spatial or spatial temporal data analysis workflow in R, you can use notebooks and reticulate to automate your workflow so that you can run geoprocessing functions directly from R. Remember that we've imported ArcPy using reticulate and we call it ArcPy. I want to create a creaking surface for house prices in King County, Washington. I check out the geostatistics extension. I set my environment variable overwrite output to true. These are all Pythonic commands, but I can also do them in R using the magic of reticulate. And I will run empirical Bayesian creaking. If you're wondering how I magically came up with this long string of input, well, I just ran it once in Pro. I copied the history and I brought it into my notebook. All you need to do is change the periods to dollar signs because this is the convention used in R and you will be good to go. One thing to note here is my output feature class is an in-memory feature class, meaning that I'm not going to be writing this to memory or to a remote data source, but the output raster that contains the interpolated house price is going to remain as an in-memory feature. This is something very Pythonic, but to reticulate, we can also perform this in R, which is very powerful. And after EBK is completed, remember that we all put it to an in-memory raster, I'm going to read this in-memory raster using ArcOpen and I'm going to bring it in as a raster object using ArcRaster. And after I did that, I can simply plot this raster using a static raster plot in R. And here I can see the higher prices around Lake Washington and the surrounding areas. But also I can interactively map rasters. Again, I'm going to define a renderer like I did before. I'm going to be defining a spatial coordinate system. I'm going to define a second map. I'm going to call it L2. First, I define a blank map. I add a base map. And after I added this base map, I'm going to use the add raster image function to add my raster data. If you're wondering what price that our raster corresponds to, this is the raster I brought in using ArcOpen and ArcRaster from this in-memory feature class we created with EBK. And in the end, I'm going to append a legend. And here it is. The raster object that is plotted in an interactive map where I have a nice legend to tell me what the prices are and also it gives me a very good idea about how I can interact with this particular data set to slice it and dice it. Lastly, I would like to output this raster I created to a local data source. This is nothing new in R. So let's just use ArcRite and output this data set. And I get an error. It's telling me that I'm doing something wrong with this function. This happens a lot. It's okay to make mistakes as long as we can get help we need. And here, since I misuse one of the ArcGIS bridge functions, one thing you can do is in a cell type question mark, space, and the name of the function. And when you run it, our documentation will show up inside the Jupyter Notebook. So you can get the help you need using our documentation that is embedded in this Jupyter Notebook. Here it's telling me that to use ArcRite, I need to define the path first and then the data object. It seems like I did the opposite here on the top. Now that I know what I did wrong, I can finally correctly output this raster to a local raster. This notebook summarizes the latest and greatest in R Bridge. You can bring in remote data sources, plot them interactively, map them interactively, and you have the power of ArcGIS inside our Notebook.