Tag Info

Hot answers tagged

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


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

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


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

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


2

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


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


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?



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