1

I have 30,000 raster files that needs to go through a small ArcMap 10.1 Toolbox Model I made (clip, flip, export to ASCII, etc.). I have a R script which then imports all the exported raster file and does what I need it to do. Everything can simply be automated, except for the ArcMap 10.1 section which requires me to manually import everything via hand and run a Batch process (which frequently crashes the program and I lose the progress).

There has to be an easier way. I looked into R-Toolbox-py, however it seems like it runs the entire R system inside ArcMap. What I'm looking for is a simple way to process the required features (clip, flip, etc.) through the ArcMap Toolbox model. R-Bridge-Install tool by ArcGIS also doesn't work as I do not have access to 10.3.1.

Is there an easier solution to this issue without doing it by hand? I can code in R, however I'm not very proficient in python.

ArcMap plays a very small role in my scripting/needs, therefore if there was an easy way to call the ArcMap Toolbox Model from R, that would work well because the toolbox model handles the input, and the output information without needing to even really open up the files.

2

Based on your description, the simplest answer to your question (not be the best solution, see why below) would be to call a Python script from R with system()

> system(paste('python ExportedModelBuilder.py', argumentIn, argumentOut, sep=" "))

for the python file, you can export it from model builder and change the required variables as arguments using argv[]. The main drawback with this method would be the fact that you will import arcpy at each launch of Python, which will considerably slow down your process.

The best solution is to do everything in R: the functions that you mention in your first paragraph are all available with the rgdal and raster packages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.