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

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


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


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


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.


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


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

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


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.



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