Tag Info

New answers tagged

0

From the perspective of someone using what you've created: there is no difference. Its a tool. Technically speaking a python toolbox (.pyt) is a python script but structured in a way that ArcGIS understands its a toolbox + tool. The model and script tool are something that live inside a toolbox (.tbx). The script tool references an independent python file ...


2

There is not an Iterate Fields tool in ModelBuilder. I can think of two possible workarounds: Modify the model to run as a Python script. Define a list of the fields you want to use, and define a loop to go through each one and execute the IDW/export functions. I would go with this one personally, but it would be (much) easier with some Python knowledge. ...


0

It sounds like you want to do a couple of nested loops, one for the feature classes in a workspace, and one for the features in each feature class. This is painful (but possible) to do with ModelBuilder. If you want to get your hands dirty with Python (which I definitely recommend for stuff like this), here is an example to get you started: import arcpy, ...


1

Here is the model, it uses inline substitution a described by Aaron. Note the output of the Polygon to raster tool is ..\fGBD_Scratch.gdb\ras_%Value%. Value is coming from the iterator which in this case was set to FID to hand out unique rows. So the first raster dataset would be ras_1, then ras_2, etc.


4

There are several ways to deal with naming in model builder. ArcGIS has a help section on this: A quick tour of using inline variable substitution. One slick way to quickly create unique names from an iterator is by calling the %i% or %n% system variables, which output files in the following form: file1, file2, file3, file4... The %i% system variable ...


0

I would use the Select tool and then write this expression: "Modified_date" >= CURRENT_DATE -1 It should return all your records greather than equal today minus 1 day (i.e. 24 hous), therefore yesterday at 6am. It definitely works with the Definition Query SQL as we use it in our organisation to only view our "incidents" in the last fortnight: ...


1

I'm not sure this is the answer that I was looking for (especially since the original model worked for another user), but I ended up getting it to run successfully with a bit of a work-around. I put everything after Add Join into a submodel and it worked perfectly.


1

I don't have an answer to avoid this issue but my typical solution is to backup the model occasionally. The "failed to save" error just happened to me. It is frustrating to say the least. If you don't have a backup, you lose everything. When you open the model later it is completely empty. I brought this problem up at the UC a couple years ago to one ...


2

Using QGIS 2.2 you can use the v.select function from GRASS to select features from one layer and how you want to select those features (if they overlap, touch, intersect etc) from another layer:


0

I wanted to provide another alternative to my previous answer I am more of a fan of using the python interactive window and an UpdateCursor for most of my attribute table changes. When I wrote my above answer, I wrote it in the interactive window and translated it to the field calculator. My interactive code was: replaceList = ["DRG", "2014"] ...


1

I am assuming you mean field value that needs changed and not your layer name since you mentioned Field Calculator Same logic could be applied in a script for actual layer names too though Ok.. I understand you and have it down. (1) Make sure your parser is marked for python. (2) In the Pre-Logic Script Code: def customReplace(fieldValue): repList = ...


2

I am not completely sure to understand the aim of your script, but here are some comments def customReplace(fieldV): # you must indent after your def repList = ['-', ' ', '.'] #remove the ; rep = '_' b=fieldV for old in repList: #I guess you want to replace the values in replist b = b.replace(old, rep) #here you need return, not ...


0

I'm not sure what you're trying to do exactly. Is Layer supposed to be a feature class or shapefile, or a field? One, all the lines in the function should be indented. Two, you can't have a semicolon end a line. Three, Layer is probably a reserved word, don't use it. Four, repList isn't in Layer; that loop will either error out or give you unexpected ...


0

Maybe try to iterate through all the fields using the "Iterate Field" tool in Model Builder. It will do all the fields in a feature clase.


0

You could explore using the batch processing function on the model. Right click (see image below) the model in your toolbox and select 'Batch'. From there you can add multiple instances and each will run through the model. Unfortunately, I am not aware of any way to easily enter the content into 'Add Row'. Thus, you would be required to enter the hundreds of ...


0

I was able to find a solution to this... Quite simple actually.... It involved rearranging my mess of preconditions as seen in the picture. I think the model was trying to run the create folder section prior to the actual iteration.


3

The Online Help for Multipoint (arcpy) provides sample code to do this: import arcpy # A list of features and coordinate pairs feature_info = [[[1, 2], [2, 4], [3, 7]], [[6, 8], [5, 7], [7, 2], [9, 5]]] # A list that will hold each of the Multipoint objects features = [] for feature in feature_info: # Create a Multipoint object based ...


1

If it were me I would process your folder of shapefiles then import the lot into your geodatabase. Doing it this way you can use an iterator to step through a folder of shapefiles. The output being the shapefile and its name then you enter a series of Add Field > Calculate. In the Calculate field tool you are using string functions to pull out the project, ...


0

The vb script version is basically the same as the Python version posted by radouxju in terms of its logic. The code below also handles Null values in the Cities field. If IsNull([Cities]) Then Output = [Township] ElseIf [Cities] <= " " Then Output = [Township] Else Output = [Cities] End If Expression: Output


1

1) I would suggest that could drive structure / permissions. For example, a working directory is set that exists in the 8 folder structure but not 7. Not inputs or outputs but working or scratch. 2) As above but more likely a user profile structure that is different. 3) Check the error report as this likely tells you what is the exact cause (Geoprocessing ...


2

If you export the ModelBuilder to a Python script, the sources will all be listed somewhere in the resulting file. (I don't recommend trying to run Python generated automatically by ModelBuilder, but it will quickly show you all the data sources the model/script is using.)


0

One model builder option without info license may be to... In model builder could you create a distance raster using Euclidean Distance and check the box for creating a Euclidean Direction raster (limit the extent by the extent of the merged features) and then just use Extract Multi Value to Points Tool"\ to bring the distance and direction values into the ...


0

the easy way is to use the near tool, but you need an ArcInfo licence. otherwise, you could try to create a buffer of the size equivalent to the distance, intersect the buffer with other features, and use the point coordinates to compute the bearing.


1

here is an example with the Python parser code block def fillBlank(city, township): if (city == ""): return township else: return city expression (name of fields between ! !) : fillBlank(!cities!, !township!)


0

Could you do it where you first spatial join to the city polygons, then do an attribute select to find where this column is blank, and then spatial join to the township polygons? Most Arc tools respect selections and only operate on selected records.


2

When you create a join the field names get prefixed with the table name, for example: Table1 joined to Table2 Table1 field OID becomes Table1.OID Table2 field OID becomes Table2.OID This is to distinguish fields from each of the tables that may have the same name. Shapefiles have a limited length of field names and as you will exceed that it's truncating ...


0

I eventually created a tool at work to do this and thought I would share it if anyone is interested. It is pretty simple as I am not a programmer. The script will make a list of all rasters in the input workspace and clip them to an input feature class. Each output raster will be named the same as the original raster plus "_Clip". import arcpy #Set ...


0

You should add a Collect Values before the Append tool, it will collect the iterated and processed features uphill, then append and delete once for the whole collection. Connect the output of 'Split Line at Vertices to Collect Values, the the output of Collect Values to Append:


1

I don't recall ever having much joy when trying to use Series variables in ArcGIS Desktop 9.3 so I did not worry when I saw it gone and Iterators introduced at ArcGIS 10.0. I any event, I think the issue you are having may be related to NIM053898 which is currently treated by Esri as a Known Limit. However, I think it should be addressed with priority ...


0

If I have understood then it sounds like you want to run the summary statistics tool setting the case fields to be your ID field AND your GRIDCODE field whilst counting on GRIDCODE. This then feeds into the pivot table tool. The Pivot tool requires an ArcInfo(Advanced) license.


0

With ArcGIS 10.1 and higher, you can use "tabulate intersection" if you have an advanced licence. You'll need to run it once per field but it gives directly what you need. Otherwise you need to do the process in several steps: 1)union of the two datasets 2)summary statistics for the resulting table, based on the ID field and each of the value field, ...


1

The Union tool in the Overlay Toolset is probably the easiest and quickest - then you can get the size of each polygon feature through the attribute table. However, if that is not the exact output you are looking for, browse the example outputs shown on the Overlay Toolset Overview page.


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


4

Can you link the first precondition to the second precondition (so the first precondition must be true before the second fires) then link both (or just the second) to the final process? Perhaps you can use If-Then-Else logic as output from your "Sum Field Insert New" process, and then link the output variable as the precondition to 'Altered Input?" In ...



Top 50 recent answers are included