Tag Info

New answers tagged

1

Problem "solved". I just deleted the Select Layer By Attribute (9) and re-replaced it with a new Select Layer By Attribute process. When I revalidated and ran the model, the intersect worked, and everything looks like it's supposed to. Maybe I don't get some fundamental thing about ModelBuilder, but it looks like the order you place tools on the whiteboard ...


1

So you've confirmed that the select layer by attribute is definitely selecting your polylines. Well here is a list of potential problems: Your polyline and erase layers are different coordinate systems The erase layer has a selection on it so it never clips the area you expect? The erase layer must be a polyline or polygon layer (i.e. higher geometry ...


1

Right click on Active_ESA, select Add to Display and rerun entire model


1

Assuming your model is in a tbx file (so a toolbox not inside a geodatabase) you could check the modified data of this file using Windows Explorer.


0

You need to use the %Name% inline variable for your output table names


0

It looks like you are looking for the "select data" tool in the model builder. This tool, when marked as a parameter, gives u a list type GUI. For more information: http://resources.arcgis.com/en/help/main/10.1/index.html#/Examples_of_using_Model_Only_tools_in_ModelBuilder/00400000001m000000/ESRI_SECTION1_D2DFA72326C54E05B1CB2DAC24FCBCFC/


0

One suggestion is to double check the projections of the layers you are working with to make sure they are the same. I see you wrote "All three of them have the same adjustment," not sure if that means projection or not. I have had very strange things happen using files that line up in the data frame using projection on-the-fly, but are not actually set to ...


1

How about making a script tool via Python? I use the scipy Python module... scipy.stats.linregress() http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.linregress.html Installing scipy on the top of the ArcGIS Python install is not very straightforward, so beware...


0

I think it is your Select tool which only selects grid_code= 1. The Select Tool selects only what you tell it to select and leaves everything else behind. Therefore with your Copy Feature you are only saving grid_code=1 but nothing else. # Process: Select arcpy.Select_analysis(polygon, polyselect, "\"grid_code\" = 1")


1

I came up with a solution. It sounds complicated but we are looking at six tools and an iteration here! I copy my Shapefile A, use the dissolve Tool to dissolve shapefile A by Name. Then I use this created Shapefile as a in the Split Tool as the Split feature for Shapefile A. I insert into my model Iterate Feature and chose my Split output as a Workspace ...


0

It seems that: Use Summary Statistics on "Shapefile A" with Statistics Field Size and Case Field Name to generate a table with Name frequency and sum_size. This table can be reused as an input in your iteration if you have multiple "Shapefile B"s. Use Join Field to join the summary statistics output table to "Shapefile B" based on Name, adding only the ...


0

You mentioned that you are open to a Python solution, which is good because automating this process with Python is much easier and more flexible than a ModelBuilder approach. First, import the necessary modules import arcpy, os Define the workspace that contains all of the folders with the Landsat imagery arcpy.env.workspace = r'C:\imagery' Specify ...


2

I actually just did something very similar to this in another script, so I'll drop this here if anyone finds it useful. It's 10 lines if you remove the comments. import collections #Summarizes the second number in a list of tuples by the occurrences in the first #e.g., [["a", 1], ["b", 2], ["a", 3], ["c", 7], ["d", 0], ["c", -1]] -> #{'a': 4, 'c': 6, ...


0

Ok, The model is ready: It takes every Band from the main folder and sub folders to do a "Composite Bands". The result is saved in an "Ouput Path". A "Calculate Value" was used to just rename the result with the desirable part of the original name, avoiding, for instance, the double ".tif.tif". The SubModel didn't change :)


0

I've just written this for a similar task. It's for 10.2 but I think it will still work: def unique_values(table, field): with arcpy.da.SearchCursor(table, [field]) as cursor: dict = sorted({x[0] for x in cursor}) print type(dict) #testing to find type for i in range(len(dict)): whereD = dict[i] fname = whereD[0:5] + "_" + whereD[-4:] #just to ...


2

Before getting to the solution to your question, I need to clarify exactly what you're wanting to divide/compare. If you're wanting the areas in all of red vs all of green, you can skip this part. However, if you want to directly compare the areas of name and type within the same total boundary, you'll need to first clip red to the extents of green. Your ...


1

I've made some modified and an additional tools to make this Model Builder a final one. I ran this on test and this works very nicely !! I would like to thank Erica for her help to make this possible


2

I would use an UpdateCursor approach. You will first need to add a new text field to your FC so that you can store the commas. You cannot add commas to integer, float, or double type fields: arcpy.AddField_management(fc, "newField", "TEXT") Then loop through your rows and apply the proper formatting (e.g. convert 300000.456 to 300,000) newValue = ...


2

What's the end goal? If you simply want to display the numbers rounded to whole values with thousands separators, you can do so using Number Formatting within ArcGIS. Search the documentation for "thousands separator" to see all the places this formatting can be configured. You can use that Python string in a Calculate Field function. Before you can ...


1

This is a pretty straightforward task. Hopefully this will get you started: import os, arcpy folders_in = [] #Build this manually or with os.walk()/os.listdir() folders_out = [] exp = '"{:,}".format(!SUM_Acres_!)' #Loop over each folder and get the shapefiles inside for f_in, f_out in zip(folders): arcpy.env.workspace = f_in shapefiles = ...


2

Create two models. One main and one sub. In the sub model, iterate through a folder to pick up the individual bands. Add Collect Values at the end of the model. Refer to the tool documentation for usage info. In the main model, call the sub model and pass the output from collect values to the composite bands tool.


1

How about this: Manually add the 2 fields to your watershed featureclass because at the moment the iterator will try and run that logic every time. So the Rb_Test_EZG layer feeds directly into the iterator. Your iterator output I_Rb_Test_EZG could feed into 2 Field calculate tools that pass in the integral and value values using in-line substitution to ...


4

Alternatively, you can create a string field and calculate the following into it using python: {:,}'.format(!SUM_Acres_!)


12

Two approaches are possible, depending on what your goal is. Display Purposes Only, Don't Want Extra Field This isn't a function in ModelBuilder, but rather a question of how the number is being displayed in the attribute table. Here's how to change that (based on these instructions): Right-click on the field heading (SUM_Acres_) and choose "Properties" ...


2

The simplest solution is probably to create a topology with the Must Not Overlap rule, select all errors in the Error Inspector window, right-click and choose Substract: You can find out how to create a topology here if necessary. You can create the topology, add feature classes and rules with ModelBuilder with the tools from the Topology toolset, but you ...


0

The code below (which comes from one of my training courses) does the key part of what you are describing. Basically, it takes an input polygon feature class (testFC) on which you have run Polygon Neighbors to create a table (NEIGHBOURS). The feature class has an extra field called NEIGHBOURS (Text, 100) added. What the code does is to: Make a Table ...


4

A shapefile is a kind of feature class, like an FGDB feature class or an SDE feature class. Use iterate feature classes in modelbuilder. You can then output as a feature class, and if it is named correctly (c:\path\to\directory\that\exists\output.shp) you will get a shapefile out.


5

It has already been created. Try SplitLayerByAttributes


0

One way this can be done is in a python script. You'd need to ask for the name of the field you are interested in (in your case it would be the county code) and extract unique values from its rows with a SearchCursor. You could save the data to a list and then iterate through the list and use a where clause with arcpy.Select and output each separate ...


1

I'm guessing based on your final image that while the green does provide 100% coverage, it is broken up into separate polygons - otherwise (if it were a single giant polygon) you'd be getting nothing selected. The problem is your Relationship choice. Within means that only whole polygons (not areas or parts of polygons) from layer A that lie within a ...


2

As far as I am aware you can not get the sequential display of interactive model dialogs that you want in standard model builder. Chaining the submodels in model builder gives you the complete list of all the parameters in the GUI, as you have found out. To simplify the GUI, you would have to switch to a Python toolbox, which gives the option of ...


1

Unfortunately, at the moment (ArcGIS 10.2.2) you cannot initiate opening multiple models. You would need to have several models created within a toolbox and then user will need to run each of them. I suggest taking a look at Python toolboxes. There you can create categories for parameters (this can move you a bit closer to what you want). You will be able ...


1

The raster equivalent to the Make Feature Layer tool that is often mentioned on this site is Make Raster Layer (Data Management): Creates a raster layer from an input raster dataset or layer file. The layer that is created by the tool is temporary and will not persist after the session ends unless the layer is saved to disk or the map document is ...


2

I use this function in python to test if a layer has a selection: def hasSelection(lyr): ''' Check whether specified layer has a selection. ''' import arcpy desc = arcpy.Describe(lyr) if len(desc.FIDSet) == 0: # Layer has no selection return False else: # Layer has a selection return True


0

You'd use an iterator if you've already got the expressions to feed in... In combination with that, you need logic Get Count, see this below - ironically in the very 1st picture it shows the very ModelBuilder logic you want to apply before a buffer execution: Get Count (Data Management) Desktop » Geoprocessing » Tool reference » Data Management toolbox ...


2

Yes, if ModelBuilder finds a corrupt file or if any of the processing fails at any point, the model will stop and you will receive an error message. You may be able to handle, or bypass, some of these errors within ModelBuilder. ModelBuilder has rudimentary error handling capabilities using Python code block in the Calculate Value tool. There is a very ...


1

If you are running a model you created using Model Builder and one of your datasets fails for whatever reason, the tool will stop running. However, if you are using an iterator, any data created as an output prior to the iteration with the failure should still exist. For example, if you are using Model Builder to iterate through 100 rasters and perform ...


0

I ended up having to use Feature Analyst (extension from Overwatch) and used "Image Fusion" tool and clicked "custom", clicked band 1 and input a script assigning values to elevation classes. Then I used batch processing in Lidar Analyst extension to batch process all of the rasters this way. I think regular GIS tools sometimes have trouble handling a lot of ...


3

I adapted the solution to move / shift points point into a certain direction (angle) and a given distance. Looks like: def shiftXYCoordinates(shape,angle,distance): point = shape.getPart(0) point.Y += distance * math.cos(math.radians(angle)) point.X += distance * math.sin(math.radians(angle)) return point and be called like shiftXYCoordinates(!SHAPE!, ...


2

You would need to have a column in your input feature class which will represent the RouteName (i.e., feature1 and feature2 belong to routeA; feature3 and feature4 belong to routeB and so on). After you've prepared the input feature class (or maybe you already have one), you would need to use the Add Locations GP tool to load the stops into an existing ...


0

To address your first question of how "to sum the acreage of matching "WUNAME" and populate the "WU_Acre"", I would use the Summary Statistics (Analysis) tool which: Calculates summary statistics for field(s) in a table. You would use a case field of WUNAME to get the SUM of your WU_Acre field. I recommend you get this first part working before ...


1

The problem in your current method, and the reason summarizing afterward as @Branco suggests would not work, is that your spatial join operation creates the first attribute you want (total points per poly) while it destroys/eliminates the second variable (owner) you want to summarize. In order to summarize, you need whatever variables you want in the same ...



Top 50 recent answers are included