Tag Info

Hot answers tagged

5

It looks like the arcpy.SetParameterAsText() function takes two parameters: the parameter index position, and the parameter value. Rather than trying to assign the value to the function you need to provide it as the second parameter. This: arcpy.SetParameterAsText(0, decadesText) Not this: arcpy.SetParameterAsText(0) = decadesText


5

From there error message, it looks like you are using a custom (non-standard) toolbox. arcpy.ImportToolbox("Model Functions") Try finding where that custom toolbox is located. Easiest way is to right click on it and select properties. Then include the full path to it in your code and include the tbx extension. ...


4

You should escape the \ character, this way: def a(Status, User, Tile): if Status == "Available": return "C:\\Data\\" + Tile else: return "C:\\Data\\" + "Tile" + "_" + User


3

It lools like the problem is that pnt has no spatial reference and arc is having a spit, It's that or your field isn't being retrieved correctly, it's best to use row.getValue(field_name) rather than row.field_name as getValue is more flexible. Please ensure the fields X_Coord and Y_Coord exist in your layer (and aren't turned off) in the layer dialog. Try ...


3

There is an Esri blog post that describes the technique for doing this in detail called If you are stuck at "if" – Part 1: Part 1 – Gives examples of quick and dirty ways of using the Calculate Value tool to create branches using if statements in a model. In your case you want to check for the existence of a feature class rather than a product ...


1

It isn't possible to use more than one iterator in a ModelBuilder model. (Ref. A quick tour of using iterators for iteration, the first "Note" towards the end.) There are some ideas for getting around this limitation in Answers to this Question: Issue nesting two iterators for cost distance calculation (Model Builder)


1

Insert > Variable, and choose Raster Catalog. Create a set of raster catalogs in a geodatabase by right clicking on the GDB and selecting New -> Raster Catalog, and then right clicking on the newly created catalog and clicking Load -> Load Raster Datasets for your premade sets of raster groupings. Then right click on the variable and check the Model ...


1

If you are using model builder and want to create a list of values then use the Field Values iterator and send the output to a Collect Values tool. Expose the output values as a parameter, then embed this sub-model into the master model. Having created your list of values (in your example you are returning just two values) you can use the Calculate Values ...


1

First thing first is clean up the data. 1) Use the UNSPLIT LINE tool with the dissolve field set to the street names. 2) Use the 'Plannerize tool' on the output at step 1 to create segments between each crossing 3) Used the 'intersect tool' to create points at each intersection. (Join Attributes set to FID_Only and the output type should be set to ...


1

I don't consider this a complete solution as it relies on non-out-of-the-box tools and isn't fully tested. It also may require an Advanced license. For now I am removing the comments I made linking to questions with methods using the start and end nodes of the lines, as after some testing I'm not sure how to apply that to this problem (while at the same time ...


1

You can do it using QGIS, this way: Open QGIS and open the QGIS Python console (Plugins->Python console). Check the following Python code snippet. Adjust the lines below the block Settings (i.e., myDir, myTargetDir, refSys, separator, xField, and cyField) to configure your own data: import os import glob # Settings myDir = '/path/to/txt/files/' # For ...


1

Make XY Event Layer is the tool you're looking for. You could import your text files into a file geodatabase and iterate through the feature classes, creating a new feature layer for each of your text files.


1

You are making the classic mistake that a lot of people do. If you read the help file of the Append tool it takes a LIST of datasets. Currently your model is appending on ever iteration which is very inefficient. You can improve model performance by sending the output of the Select Data tool (Routes) to an in_memory workspace then feed that tool into a ...


1

So, the output data of your model is a single feature class that represents the analysis' results (buffering). After running the model and exploring the results in ArcMap, you are not satisfied with this and want to re-run the model using another input parameters' values (e.g., another buffer distance). The only thing you need is just to allow the model to ...


1

The issue strangely enough is caused by a dependency on Internet Explorer DLL dependencies of all strange things. It is triggered by opening the Item Description window - Try opening any tool, then opening the Item Description window for a tool, and then try re-opening that tool - the script error will occur. A quick fix for this is to go into the Internet ...



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