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

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

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

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


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

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


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

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

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

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

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.


1

I think you need to look into using model builder's in-line variable substitution properties to accomplish this. You can get info about that here http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Examples_of_inline_model_variable_substitution/002w0000005w000000/ (I've included a link to the v 10.0 help as I don't know the version you're using ...


1

there is also a built-in tool called Polygon Neighbors if you have ArcGIS 10. It "creates a table with statistics based on polygon contiguity (overlaps, coincident edges, or nodes)."


1

The images below are a different way to solve this. In the Summary statistics tool I am collecting the Count of the ObjectID field and then appending this into a pre-existing empty table.


1

You are close. In both models you will need to add the model only tool Calculate Value. The output of that tool should also be an output parameter of the inner model. You can't use the output of collect values as the input directly so set it as the precondition. Then set the expression of Calculate Value to: sum_counts('%Row Counts%') %Row Counts% is ...


1

A simple model using the tables iterator was enough to do what I needed to do, see the pic: When I have time I will try the "merge" option that artwork21 suggested, as I believe that would be another easy way around it. Thank you for your quick responses! A


1

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


1

Before going to this trouble have you looked at whether using Joins and Relates > Joins ... from the context menu of your Polys layer may not give you the result you are after in one step?


1

Evidently I was proceeding from the wrong assumption. The ModelBuilder Toolbox is not something that I would add in. I just needed to select "Insert", "Iterators" and "Rasters" in the model builder window.


1

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.


1

I do have the original feature class. But unfortunately I don't think it would have worked to start with that. As you can see, the buffers overlap the polygon boundaries. Clipping would bring in areas from other polygons. Intersecting would have created multiple sub-polygons. However, it turns out that this task was trivial to complete in Spatialite. ...



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