1

I am unsure how to go about doing this using Python in ArcMap, though I know how to do it by hand. I have geodatabases containing gSSURGO data, one for each state, in their own folders. I have a table that has national datasets of weighted average attributes (found here: https://geonet.esri.com/docs/DOC-2336?sr=stream&ru=9646) that can be joined to the raster layer in the GDB containing the state's gSSURGO data.

Is there a way to batch process this, so that I can create new rasters from joining the raster layer in each states GDB to the national level weighted average data?

It seems it would entail (here follows poor pseudocode):

 Open up the national level table 
 For each folder in the Main Folder (containing the states folders)
 Open up each GDB
 Open up the raster file
 Join the raster file to the national level file based on the one common field
 Create a new raster based on the join
 Merge all rasters into a national raster

I need to end up with a national level raster having merged all these individually joined state raster layers.

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Sep 23, 2014 at 2:04
2
  • I put an arcpy tag on it to make sure that I and anyone else interested in such questions will have it on their "list". If it is not answered sooner I may get a chance to look at it later and will probably answer more with an approach to the first few steps rather than complete code. Commented Sep 23, 2014 at 3:22
  • In the mean time, I am attempting to do it by hand, but it is time consuming and I will have to do the same thing with a different dataset but the exact same data types (but different data) after I make my way thru this. Commented Sep 23, 2014 at 3:24

1 Answer 1

1

I would start with this part of your pseudo code:

 Open up each GDB
 Open up the raster file
 Join the raster file to the national level file based on the one common field
 Create a new raster based on the join

and, assuming that you are running a Geoprocessing tool for each of those steps, do this once from their tool dialogs and then use Copy As Python Snippet from the Geoprocessing | Results window to copy/paste the four snippets of Python code into an empty Python script.

Once you have those four steps automated in ArcPy you will be in a good position to put it into a for loop and work on any remaining steps.

answered Sep 23, 2014 at 5:39
6
  • I am dragging the parts of the GDB I want to access into the ArcMap window. I'll look into using a tool and coping the python snippets as you suggest. Commented Sep 23, 2014 at 5:41
  • @traggatmot A key to automating workflows is to identify equivalent tools in the Geoprocessing Framework to ArcMap GUI steps which is often but not always possible. Commented Sep 23, 2014 at 5:44
  • I'm looking at it right now, and there seems to be no set tool got the first two steps....For the Join, yes, and mosaic to new raster, yes, but not the first two.... Commented Sep 23, 2014 at 5:46
  • As a new question, rather than via a string of comments on this answer, let's figure out what you mean by Open up the raster file and the equivalent Python code. I suspect that you want to loop through each raster dataset in a file geodatabase which will mean using arcpy.ListRasters() but a question that describes the ArcMap steps precisely for just this bit should make the ArcPy "conversion" easy to provide in an answer. Commented Sep 23, 2014 at 5:55
  • Does it make sense to refine this question? Or do you think a new question is definitely needed? Commented Sep 23, 2014 at 5:56

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.