Tag Info

New answers tagged

1

The Calculate Field tool works for only one field at a time. You'll need to connect another Calculate Field at the end of that model. Repeat for every field you need to calculate.


0

I by mistake gave that answer to an old thread. So copied it here. Trying to find the thread I found this ESRI code for field calculator that iterate to find the right buffer for each polygon. Code attached in the end, and there is a link to the page. Note that this answer is un-related to the code below (but I worked to hard to make it, so I leave it here ...


4

Keep using the 'Iterate Feature Classes' iterator as this is the correct one to use. Ensure you use in-line variable substitution when naming the output from the IDW tool. If you don't, each time the tool is ran it will use the same output path/name and overwrite the previous output. See my example below:


7

I wouldn't do this, especially not with some home-brewed license "server". If you're certain your IP is valuable enough to protect by licensing, you should purchase a commercial licensing solution. But I don't think this is necessarily the best solution as any form of DRM only inconveniences legitimate users and will not stop determined people reverse ...


1

I figured out a simple way to do this in model builder. Lets say you're are iterating over a few files to do a clip to all of them. 1) Create an interator for feature classes. Right click on it and make a variable for the workspace. 2) Rename the workspace bubble to "Workspace", and also right click on it and select "make parameter". This will prompt you ...


2

You could use the Python parser in the Field Calculator and construct this function. This part goes in the pre-logic. Make sure to replace the feature classes with the one from your system. The feature class table called "Temp_Table" is a temporary table and must reside in a geodatabase. It will be deleted as the script completes. def normNum(num): ...


3

Using Python would open up some more elegant solutions, but you can do this entirely in ModelBuilder with the use of a couple of temporary tables. The model would look something like this (note that you can right-click on any process step and rename it): The Add Field operation adds a new column called [Normalized_Value] to your existing polygon table. A ...


1

You could do something like this... [Field2] = (( [Field1] - 0.24 ) / ( 2546 - 0.24 )) Basically you have to find the difference between the [Field1] value and the minimum value and then divide it by the entire range of data. normalized = (value - minimum) / (maximum - minimum)


2

Create a Model Parameter. Here is a tutorial.


0

Thank you very much for your rapid reply. In fact, by deleting rows 1, 2, 4, 5 and 6, I want the row 3 to become the first row (headline) of the table (i.e., Au, Pt, pd, SiO2...). The latter contains 150 rows of data below the 6 first rows, that begins with #59101 in the provided example. Thus, I do not want to keep just the row 3, but realy deleting the ...


1

I suggest few modification to your model and it should work, but in general you are on the right way. My data (hopefully as yours) include: Dealers point feature class and Sales point feature class. Each sale row has a dealer ID which relates the sale to its dealer. My modifications are: I used the Iterate by Row. Iterate by feature iterates through ...


0

If you want to extract just row 3 and want to keep using ModelBuilder then you'll be wanting something like this: Create a model with your DBF as one of the inputs Use the Make Query Table tool or the Select Layer By Attributes tool with the query "\"COLUMN_A\" = 'Analyte Symbol'" (Substitute the real attribute name for COLUMN_A) Optional: Use Copy Rows to ...


1

It sounds like you want to do something like this: for SubFolder in MainFolder: for raster in SubFolder: run Model This is the sort of thing that is possible with model builder, specifically with the Iterate Rasters tool. Put that into your model, set Recursive to TRUE and your input to your parent folder. You might have to modify your model with ...


0

I'm not sure if there's anything wrong with the text of the query itself, but, to avoid ModelBuilder freaking out on you, you'll need to set catid as a prerequisite to the Make Query Layer step. If you set up a query or other operation in ModelBuilder that is dependent on a variable generated within the model itself, ModelBuilder will usually try to ...


0

Have you considered putting your parameters in a table or list? Then you could insert an iterator into the model and iterate through the years. As for format of the table, DBF would probably work best, but CSV's still play well with Arc and are far easier to edit, so it's a question of preference. On a side note, the parameters as you have described them ...


0

Try refreshing the toolbox. The F5 key will refresh it, or you can right-click on it and select 'refresh.' That should update the contents of the toolbox to show your model saved under its new name.


1

I believe this is the solution to the issue of "stacking" layers or raster bands for multiple images. This model is set up using standard NAIP imagery so red=1, green=2, blue=3, NIR=4. In this example, I am taking only the three color bands from the original image--combining them--then converting the format to PNG. My model uses the same concept as the first ...


1

I think you might use Add Join as mentioned above. Yet I belive that Join Field will be of a better use. It simple works as Add join, but adds flexibility to the process, enabling to add only some fields, or all of them. Otherwise, "regular join" will join all fields, which can make quite a mess with big datasets. To elaborate on the "conversion" to ...


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)


0

Completely wiping everything python and ArcMap related and doing an install from scratch worked. Once ArcMap and Python were uninstalled, I went back to the python folder and deleted it (there were some remnants left behind on uninstall) and removed all PATH variables that related to either. Cause is still unknown. My assumption is that somehow something ...


2

Try to use ead of cell statistics instead of raster calculator and use the sum operator. Also mark ignore no data. That is under the assumption that there are no "NoData" cells you wish to retain. Before running the tool, set the processing extent to UNION of both inputs under tool's environment setting.


1

Check to see that you have the following file: C:\Python27\ArcGIS10.2\Lib\site-packages\desktop10.2.pth If you don't, open notepad as administrator and add these lines: C:\Program Files (x86)\ArcGIS\Desktop10.2\bin C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy C:\Program Files (x86)\ArcGIS\Desktop10.2\ArcToolbox\Scripts saving the file like you see ...


3

Error 010246 from ESRI support describe either a state that all input points have the same location, or that one or none point were selected. I believe that the second one applies to your model. I suggest you manually check whethear some polygons don't contain points at all, or contain one point - you might use spatial join to get the counts. After that ...


1

Actually, it turns out that I had made an error with my preconditions. The code works and it deletes the empty feature classes. The only thing that now bothers me is that i don't recieve any warning messages arcpy.AddWarninng( 'Error in + 'inFC) . I'll try and look into that now and if you have any ideas you are welcome to share them:-) Thank you for all ...


2

As suggested, the 'clip feature' in your model is going to be of 'feature set' data type. First, create an empty feature class that will hold the schema of your feature set. This can be simply a polygon feature class with nothing else than a name: Now in your model, right-click the Clip tool > Make Variable > From Parameter > Clip Features. Once the ...


1

While setting the properties for the input polygon, set the data type as a Feature set, and import a layer file created from a temp polygon layer for the schema and symbology input. Make it a parameter and this will allow users to draw in a polygon when the model runs.


0

I will answer my own question. After some more research I found that the answer is to use feature layers (see ESRI's help page)rather than saving intermediate results in shapefiles. The select tool which was taking up to 6-7 minutes is now taking around 0.9 seconds. Quite the difference!


0

I would like to suggest a way to work this out (refering to your first question), yet without more information about your workspace it will remain abstract. Anyhow this Solution assumes you save all Raster: Model#_A and Model#_B within the same dataset/folder. It also assumes that the number of A tyoe raster equales the number of B type rasters. Consider ...


2

Would you consider a Python solution, especially if you have to do a lot of separate calculations in your model? The problem with the field calculator for a script process is that it is slow and not expanding your thinking beyond a manual process. Why process every row in your table every time you do a field calculation when a cursor can process all of ...


1

This page is pretty helpful explaining the various inline model substitution variables: Examples of inline model variable substitution %Data Workspace% should resolve to the geodatabase name.


2

EDIT: I realized my first answer was incorrect, this is an update (I forgot that the function needs a Layer object, not a dataset path). I think the issue is that the you are passing "Tioga\Tioga" (which is a technically a string) but the Apply Symbology function needs a Layer object. You can create the layer object like this: mxd = ...


0

You are making the classic mistake with the iterator and collects tool, this needs to be in a sub-model as shown below: Note Raster and output_value are preconditions. The code in the calculate value tool is different too as Lou suggested:


0

How about: Producing an RGB raster Exporting to vector Loop through each polygon's centroid and interrogate the rgb in the raster Put the RGB value in the polygons attribute table (maybe you could ninja / modify a bit of code from the link below) Symbolise a layer file for your range of RGB values, and apply that to your newly attributed vector polygons ...


0

The Help page entitled Exporting a model to a Python script lists a number of caveats when using this technique as an aid to learn Python/ArcPy. I far prefer to run tools manually via their tool dialogs and then to use Geoprocessing | Results to access Copy As Python Snippet and then Paste that well-formed code into a Python script instead. In your case ...


1

As both your add fields are adding fields to JoinedPermits you don't have to split it in the manner that you have. Simply link the output Formation Field Calculated as the input into Add Well Status Field. You can then connect your Featureclass to Featureclass to the Well status field calculated.


0

I figured out the issue, but I can't say I fully understand it. On the far left side of my screen shot, you can see a wMain layer, this was being used to select the pipe sections intersecting the building points. This wMain layer was one that was loaded into the MXD I was working off and that gets copied to the server. Turns out the correct building points ...


0

If the cursor on your input_table ever returns no records from the query then I think it will either error or lead to numbers_facilities not being set. Perhaps use Get Count to test whether the query will return no records before opening a cursor using it.


0

Create the second iterator in a separate model in ModelBuilder. Once you've got that working you can insert it as a submodel into Iterator 1. ModelBuilder won't ordinarily let you nest iterators, but it will let you include a submodel. If that submodel has an iterator in it you can get around the "1 iterator only" limit.


2

Your model fails because your input shape files have names that contain spaces. As feature class names cannot contain spaces, you need to use add the Calculate Value tool to your model to remove spaces from your inline variable "Name" and replace them with underscores. In the model below, the Name variable is precondition to the Calculate Value tool. ...


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


1

Assuming you want to split any field with an underscore you can use ListFileds (which returns Field Objects) with a wildcard to get the fields to split then string.split("_") to break it up into parts then calculate with quotes to populate the string: import arcpy, os, sys InFolder = sys.argv[1] # folder for shapefiles, or database for feature classes ...



Top 50 recent answers are included