6

I am trying to create an automated ArcMAP (10.1) tool that will read in a file (ASCII most likely) of maximum and minimum lat/long values along with some additional variables. The tool will iterate over each row of this file, and run the processes on the unique variables each time.

A preliminary tool that only runs on one set of variables works perfectly. Working Model

However, the 'Extent' Data Type can't accept variables into it (in any way I have found out at least). So I have no idea how to define a unique processing extent for each run of the tool. Below is an example version of what the model might look like (I have tried several different ways, this is just one). Batch Model

If it matters, I have never tried working with python scripts in ArcMAP, so I'm hesitant to go down that route unless it's fairly straight-forward. Unless there is no other option. The base DEM I will be using will cover the entire globe, so it really is necessary that I only process a small part of it each time I run the tool.

  • how well do you know Python? I find it easier to work through a problem using arcpy/python as opposed to modelbuilder because you can see all your processes and variables on an IDE or text editor. ModelBuilder does have its pros but for complex looping I would recommend learning it through python – ziggy Sep 28 '16 at 2:26
1

I think that it is more straightforward to export my model in Python and work set the environment in the loop.

arcpy.env.extent = '-180 90 180 90' #xUL yUL xLR yLR

you can parse your file with Python using csv module http://docs.python.org/2/library/csv.html


for your problem, another solution is to use vrt files. You can then load all your vrt files by right clicking on your saved model and opening it in batch.

  • You can export the model to a python script from ModelBuilder with Model>>Export>>To Python Script and modify from there. – Roland Jul 7 '15 at 21:20
0

Have you tried creating a variable of the type 'Extent', and using that as a variable? Some additional string manipulation will likely be required to coerce your string into a format that ModelBuilder can recognize as an extent (ModelBuilder is misery for working with datatypes).

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.