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.


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

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 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

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

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 ...


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

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

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

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 ...


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

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.


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 = ...


2

To do this I would chain three submodels together. Each submodel will use Iterate Feature Classes configured using the wildcard with a different letter (R, S, then T). The use of submodels is needed because of the "one iterator per model" restriction. There is a help page available on Integrating a model within a model but its examples all look to be ...


2

So problem solved. This post encountered a similar issue. It's possible to ignore the field selection in the join field tool. I was not able to use add join and run the iterators successfully. http://forums.arcgis.com/threads/73410-Model-Builder-Using-iterator-and-Add-Join-tools-to-join-tables The starting materials for this process is a spreadsheet of ...


2

First off, I don't think you want to be saving these as layer files (.lyr). A layer file is only a pointer to data. You need to save the data to a feature class or shapefile. The output from the Make XY event layer tool is a "in memory layer" and it is gone once the session is over. That needs to be converted to feature class to save it to your computer. ...


2

I'm not sure what the problem with the dataset iterator is, but you can replace it with a little Python. If you're at ArcGIS 10.1 SP1, you could use the arcpy.da.walk function, passing in the CadDrawing option for datatype. Otherwise you could use os.walk to achieve the same thing, but you would need to implement logic to return only the file types you're ...


2

I have written a response to a similar question using python - the link is here: How to count the number of shapefiles that touch each polygon?


2

You need to put the model up to and including the collects value tool in its own model and expose the collects tool as a parameter. Then put that SUB model into a model and connect its output to your merge tool.


2

I've successfully used these two functions for thousands of interpolations and all were unittested. IT is based on my knowledge as well as help from stackoverflow import numpy as np from scipy.ndimage import map_coordinates def oneD_interpolate(x, x_list, y_list): """ interpolate in one dimension """ return np.interp(x, x_list, y_list) ...


2

You may be accidentally overwriting your output with each iteration. Have you given each output a unique name, using inline variable substitution or the like? Try naming your output file like so: C\foo\bar\%value%.


2

I'm not sure how to manage your changing neighborhood size, but here is already an answer. Iterate Rasters runs the same tool/chain of tools for a series of datasets in the specified workspace, so it's not going to do what you need. If you want to reuse the output of the model as input a number of times, you should do the following: Right-click the input ...


2

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 ...


2

So you need the area of all agriculture parcel for each dataset. There is a tool for this called "Saptial join". Use the JOIN_ONE_TO_ONE option, the sum field mapping rule and the "contain" relationship. No need to iterate. Note that you can use the spatial join of watersheds on the parcels in order to know the values from the corresponding watershed for ...



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