Tag Info

Hot answers tagged

5

One solution is to use the iterations portion as a completed model, then use that model inside of another that performs the remaining operations on the output of the iteration model. This is called a nested model. Also, consider looking into Python scripting, the options for dropping into and out of iterations are much more flexible.


5

I believe you will need to build a small Python script and paste that into your Model. You would use the ArcPy module and build a field list on your layer: fieldList = arcpy.ListFields("C:/Data/MyGIS.gdb/MyLayer") and then you would iterate through the fieldList using a for loop, for example for field in fieldList: #run your spatial analysis ...


5

Export your table to a text format. Grab the header row and paste it to a new file. Delete irrelevant column headings (could also turn them off prior to export to avoid this step), and then use find/replace functions to change the delimiting characters to proper syntax for the formula (ie quotes around field names, a plus sign in the middle). Copy and paste ...


4

Assuming that your text files are some sort of tables (e.g. CSV having X and Y coordinates in rows with delimited columns), try using 'Iterate Tables' instead of 'Iterate Files'. You will be offered an option of choosing DBF or INFO as the type. Ignore this field. It is optional. You should now be able to connect the output file to the 'Make XY Event ...


4

The ArcGIS help page for iterators in model builder says that you can only have one iterator per model. (It's the first note, below the table of iterator types.) Perhaps that is why you are having trouble trying to use two in the same model. I believe if you want to use multiple iterators in modelbuilder you have to build a model for each one and then nest ...


4

I like to run such things from a file geodatabase to keep all the fields consistent for field mapping in your model. If I interpreted correctly you want to: 1. split your FC by lease type. 2. Dissolve each resulting FC on the lease type and sum the percent interest for that lease type. 3. and then combined all FC's back together. From what I have gathered, ...


4

Nest the iterated part in a sub-model. See the "Advanced Use of Model Iterators" section under Integrating a model within a model in the help. Related question: Exporting data from 'collect values' output in ArcGIS model builder


4

The input of the While loop should be of boolean data type. I recreated your model and script and called arcpy.SetParameterAsText(1, "FALSE") in the script. For the script output, I used a boolean. ModelBuilder automatically converts the output string "FALSE" to boolean false. The boolean false can be evaluated by the While loop.


4

Slicing should do the trick. To slice a string do this "%var%"[x:y], where x and y are indices representing the start and end positions of the bits of the string you want to keep. The first character of a string has index 0. say you got: var = "myfc_clip" and you want myfc_buffer not myfc_clip_buffer you would do something like this ...


4

If you try to output the iterate raster tool directly into raster calculator, you will only see the last iteration in the raster calculator layers and variables list. To get around this nuisance in model builder, use Collect Values to generate a list that you can pass off to Cell Statistics to do your calculations. Simply choose the "MEAN" overlay ...


4

Use the Calculate Value tool in model builder to drop the last 4 four characters of your Count_Field variable. Set the tool to be a precondition to the alter field tool to ensure it executes first. Set your expression as shown below


3

The following python code should help you calculate the distances from points to their corresponding median point. The script creates a new field in your point file and stores the distance to the median point. This script assumes that the point file and median point file have a common field that relates the points to the median points. If you generate the ...


3

Near by Group Something like this sounds like what you need. Conceptually, this question can be answered by the Near tool (what is the nearest feature?). However, the question also contains a constraint *(with the same attributes*?) that is not directly supported by the Near tool. To answer the full question additional ModelBuilder techniques must be ...


3

Two iterators are allowed within a model as long as you embed a model within a model. Check out the advanced use of model iterators section on the integrating a model within a model help page.


3

In the sub model, insert "Collect Values" after the iterator. You find it in the model builder menu "Insert" -> "Model Only Tools"


3

I usually approach situations like this using a few steps. The general process is to determine the maximum value in each polygon and then determine which points actually has that value: First join a unique identifier from the polygons to the points (Using intersect, spatial join, etc..). This doesn't have to be OBJECTID, but it can be. Then run summary ...


3

I hate to be the bringer of bad news, but your current workflow is probably an inefficient way of reaching your goal. What you should check out is the Spatial Join Tool http://resources.arcgis.com/en/help/main/10.1/index.html#//00080000000q000000. It should do, I think, everything you are asking to accomplish if you set up the options right. You'll just ...


3

As a shapefile FIDs' are contiguous and 0 based, you can use that to your advantage: import sys, os, arcpy InFC = sys.argv[1] # must be a shape file OutFC = sys.argv[2] # change as appropriate DivisorSize = 1000 BufferDistance = 100 TempDir = os.environ.get("Temp") MaxFeat = int(arcpy.GetCount_management(InFC).getOutput(0)) StepRange = ...


3

The ultimate in stupidity. All I was missing (in any of the ways I approached it) was "QUOTATION MARKS" around the expression. ie. Expression = "%Value%" if using Parse Path, or "%Name%" if not using Parse Path


3

You need to separate your model into two models. As you have it now, the results table gets created with every iteration. Step 1 needs to be in separate model that calls a sub model, which performs the rest of the steps. Refer to this help file on how to set up nested models.


3

Wouldn't it be more straight forward to: create a list ordered by distance between sales point and closest dealer Iterate that list until you have collected the 40% of sales volume The distance to the last one is the buffer value you are seeking. btw, it can be done with one sql-query (with or without the final buffering)


3

You could use the Append tool to add your intersect_result to a feature class. First, I would create an empty feature class to store your outputs in, then just add the append tool to your model after your Intersect completes. Make the empty feature class the Target dataset and the intersect_result the input dataset. You can save yourself some trouble ...


3

I was able to get this to work by: Specifying that Workspace is a Precondition to Create File GDB Using %Name%\%Name% as the File GDB Name, not as part of the location This results in the desired output:


2

Here are a couple resources that you might find helpful for performing iterations. http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Iterate_Feature_Selection/00400000000s000000/ Getting to Know Model Builder


2

Without seeing your model it seems odd that your precondition is failing. I knocked a model together (see image below) and it worked fine. When the attribute query created a selection it was copied out when nothing was selected the export was skipped. It makes me wonder if you are using the correct select tool?


2

The attached model intersects the lines and polygons and creates a multipart featureclass (i.e. all of the line segments contained within a polygon combine). Make sure to select the correct dissolve feature in the Dissolve tool and select the "Create multipart features" checkbox. Also, make sure the output is located in a geodatabase because the line ...


2

Thanks for recommending Python. Having never used it before, I've had to take a crash course in Python programming. I stumbled when it came to iterating through a dictionary as you suggested, so I tried another approach -- which seems to work. I'll paste it here for anyone else if it is of use. import arcpy arcpy.env.workspace = ...


2

I would use Python instead of ModelBuilder for something like this. The gist of it would be to do something like this: Read the contents of the first folder into a list using ListFeatureClasses Do the same for the second folder zip() the two lists into a dictionary: Example Iterate over the dictionary's key/value pairs (Example) and perform the Union for ...


2

You need to feed the output of the iterator (green blob) into a make featurelayer tool which would then feed into your selectbyattribute tool.


2

It seems like you are defining a lot of redundant variables, so I cleaned it up some and changed the workflow slightly. This is completely untested, but it might point you in the right direction: import arcpy from os.path import join # enable overwrite outputs arcpy.env.overwriteOutput = True # input feature directory: transects dir_transects = ...



Only top voted, non community-wiki answers of a minimum length are eligible