Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review rpygeo #39

Open
wants to merge 13 commits into
base: gh-pages
Choose a base branch
from
23 changes: 23 additions & 0 deletions _rmd/2019-03-10-RPyGeo-1_0_0.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
layout: post
title: "RPyGeo 1.0.0"
date: "`r format(Sys.time(), '%d %B, %Y')`"
comments: true
author: Marc Becker
categories: r
---

<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>

[DOWNLOADHERE]

RPyGeo 1.0.0 has been released on CRAN. The RPyGeo package establishes an interface to the geoprocessing tools of ArcGIS from within R. ArGIS is a geographic information system developed by Esri.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link to ArcGIS page. Maybe change to "ArcGIS is one of the leading [...]".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add the release date?


The new RPyGeo package accesses the ArcPy Python side-package via the [reticulate](https://cran.r-project.org/web/packages/reticulate/index.html) package. ArcGIS provides almost all of it's geoprocessing tools via ArcPy. With RPyGeo these functions are available in R. Additonally RPyGeo provides utilitiy functions to create a seamless workflow between ArcGIS and R.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • "The new version of the package"

  • "ArcPy Python side-package" sounds a bit strange, rephrase?

  • Put "RPygeo" in backticks or in italics

  • do a spellcheck


In 2015 Esri released the R-ArcGIS Bridge, a software that also connects ArcGIS and R. Essentially, the R-ArcGIS Bridge offers read, write and conversion functions to transfer data from ArcGIS to R and vice versa. The idea is to use the large number of R packages to solve spatial problems, which cannot be solved with ArcGIS alone. R scripts can be run as geospatial scripts with an interactive user inferface from within ArcGIS. However, no functionality is added for the R user. RPyGeo is able to run the geoprocessing tools of ArcGIS directly from the R session.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • link to R-ArcgGIS bridge

"The idea is to use the large number of R packages to solve spatial problems"

-> sth like "to use R to add additional capabilities for solving spatial problems"

"R scripts can be run as geospatial scripts"

-> put "geospatial scripts" in parantheses or explain better what is meant by this in the context of ArcGIS

"However, no functionality is added for the R user. RPyGeo is able to run the geoprocessing tools of ArcGIS directly from the R session."

-> do you want to showcase a difference here? this does not become clear. Maybe add a bit more detail.

The update added many new features to the package. It is now possible to chain ArcPy functions togheter with the pipe operator. Help files for all ArcGIS functions can be viewed directly inside RStudio. Moreover, map algebra expressions can be used to modify raster objects.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The update added many new features to the package. I

"With the new version it is now...

It is now possible to chain ArcPy functions togheter with the pipe operator

-> It is now possible to chain ArcPy functions using the pipe operator


For a detailed instruction on how to use RPyGeo we would like to refer to the [vignette](https://cran.r-project.org/web/packages/RPyGeo/RPyGeo.pdf). It includes a tutorial with all essential RPyGeo functions.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a detailed instruction on how to use RPyGeo we would like to refer to the vignette.

-> For a detailed instruction on how to use RPyGeo please see the corresponding vignette. (Maybe a pkgdown site would help here? But maybe problematic to generate one on Travis as we need Windows)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also the link is not to the vignette but to the reference PDF. The vignette is at https://cran.r-project.org/web/packages/RPyGeo/vignettes/RPyGeo.html

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


The devolepment of RPyGeo is now integrated into the r-spatial.org community. If you find any bugs please report them at our new development repository [r-spatial/RPyGeo](https://github.com/r-spatial/RPyGeo) or help us fix them via a pull request.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The devolepment of RPyGeo is now integrated into the r-spatial.org community. If you find any bugs please report them at our new development repository r-spatial/RPyGeo or help us fix them via a pull request.

The source code of RpyGeo is now hosted on Github within the r-spatial organization.

76 changes: 76 additions & 0 deletions _rmd/2019-03-11-RPyGeo-1_0_0.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
layout: post
title: "RPyGeo 1.0.0"
date: "`r format(Sys.time(), '%d %B, %Y')`"
comments: true
author: Marc Becker
categories: r
---

<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>

[DOWNLOADHERE]

RPyGeo 1.0.0 has been released on 14.11.2018 on CRAN. The RPyGeo package establishes an interface to the geoprocessing tools of ArcGIS from within R. [ArcGIS](https://www.esri.com/en-us/arcgis/about-arcgis/overview) is the leading commercial geographic information system platform, which is developed by Esri since 1999.
be-marc marked this conversation as resolved.
Show resolved Hide resolved

ArcGIS offers access to its geoprocessing tools via a Python site-package called ArcPy. The new version of RPyGeo reads the site-package via the [reticulate](https://cran.r-project.org/web/packages/reticulate/index.html) package into the R session.
be-marc marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "site-package" the correct wording here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it is


If you want to run the following examples you need a working ArcMap or ArcGIS Pro installation. In addition, install and attach the following packages and execute the other commands to get some data.
be-marc marked this conversation as resolved.
Show resolved Hide resolved

```{r, eval=FALSE}
library("RPyGeo")
library("sf")
library("raster")
library("magrittr")

data(dem, package = "RQGIS")
writeRaster(dem, file.path(tempdir(), "dem.tif"), format = "GTiff")
```

After a quick initialization, which usually finds the ArcGIS installation automatically, all geoprocessing tools of ArcGIS are available in R.
be-marc marked this conversation as resolved.
Show resolved Hide resolved

```{r, eval=FALSE}
arcpy <- rpygeo_build_env(workspace = tempdir(),
overwrite = TRUE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

watch out for indentation

```

The ArcPy functions can be accessed via the `$` operator. All functions are listed after typing the `$` operator in RStudio.
be-marc marked this conversation as resolved.
Show resolved Hide resolved

```{r, eval=FALSE}
arcpy$Slope_3d(in_raster = "dem.tif", out_raster = "slope.tif")
```

RPyGeo can load spatial objects stored in Esri's proprietary geodatabases as well as files from the hard disk with the `rpygeo_load()` function.

```{r, eval=FALSE}
slope <- rpygeo_load("slope.tif")

plot(slope)
```

<img src="../images/rpygeo1.jpg", width="100%" style="display: block; margin: auto;" />
*Figure 1: Slope computed with Slope_3d() and plotted in R.*

Both functions can be chained using the pipe operator. It is also possible to use the pipe operator to chain multiple geoprocessing tools.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pipes are great but the old school way object = arcpy$Slope_3d(in_raster = "dem.tif", out_raster = "slope.tif") would also work, wouldn't it?

I guess you can reduce the two sentences into one.


```{r, eval=FALSE}
arcpy$Slope_3d(in_raster = "dem.tif", out_raster = "slope.tif") %>%
rpygeo_load()
```

Map algebra expressions can be used in RPyGeo with special operators to modify ArcPy raster objects. The resulting temporary files can be saved to the hard disk with the helper function `rpygeo_save()`.
be-marc marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Helper functions are usually non-exported functions within a package.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also called them helper functions in the vignette but we could use another word and change it in all documents.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I think its not so crucial and the meaning of "helper function" is used in a manifold context. If its consistent everywhere just leave it as it is :)


```{r, eval=FALSE}
ras <- arcpy$sa$Raster("dem.tif")

ras %rpygeo_+% 2 %>%
rpygeo_save("dem_2.tif")
```

With the new version many other utility functions are added. Help files for all AcrPy functions can be viewed directly inside Rstudio with the `rpygeo_help()` function. `rpygeo_search()` returns all available geoprocessing functions that contain a specified search term. The new functions try to provide a seamless workflow between ArcGIS and R.
be-marc marked this conversation as resolved.
Show resolved Hide resolved

In 2015 Esri released the [R-ArcGIS Bridge](https://r-arcgis.github.io), a software that also connects ArcGIS and R. Essentially, the R-ArcGIS Bridge offers read, write and conversion functions to transfer data from ArcGIS to R and vice versa. The idea is to use the large number of R packages to solve spatial problems, which cannot be solved with ArcGIS alone. R scripts are integrated into geoprocessing scripts, which can be run as geoprocessing tools from within ArcGIS. The user can add a user interface to the geoprocessing tool or use it as a part of a ModelBuilder workflow. However, no functionality is added for the R user. The R-ArcGIS Bridge cannot run geoprocessing tools from within R, whereas RPyGeo offers almost all geoprocessing tools of ArcGIS directly from the R session. The R-ArcGIS Bridge is developed for users, who want to process their whole workflow from within ArcGIS, whereas RPyGeo is developed for R users who wants to integrate a geoprocessing tool into their R workflow.
be-marc marked this conversation as resolved.
Show resolved Hide resolved

For a detailed instruction on how to use RPyGeo we would like to refer to the [vignette](https://cran.r-project.org/web/packages/RPyGeo/RPyGeo.pdf). It includes a tutorial with all essential RPyGeo functions and the necessary data to run the above examples.
be-marc marked this conversation as resolved.
Show resolved Hide resolved

The source code of RpyGeo is now hosted on Github within the r-spatial organization. If you find any bugs please report them at our new development repository [r-spatial/RPyGeo](https://github.com/r-spatial/RPyGeo) or help us fix them via a pull request.
be-marc marked this conversation as resolved.
Show resolved Hide resolved
Binary file added images/rpygeo1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.