Script tool
Hello, excuse me can someone make this code for me a script tool, I do not know what is the problem with me... the code is working in python window... import scipy.ndimage as ndi import scipy import...
View ArticleModel Builder - Calculate Field (Area)
Hello, I'm a totally newbie to Python and have problems to calculate the area of an input feature in my model (model builder). I use the "Calculate Value" function to calculate the area (in square...
View ArticleInvalid Expression Error in Loop
I'm extremely confused. I set up a loop to select features by attribute from a list of feature classes. The script runs completely through the list doing exactly what it's supposed to do. But then I...
View ArticleSecret to edit.stopEditing(True)
Can someone please inform us/me on why the edit.stopEditing(True) method does not work? I have been using it in a Python add-in with a da.UpdateCursor. edit.isEditing prints True but when the script...
View Articlearcpy.tableToTable doesn't work on server???
Server problem: arcpy.TableToTable doesn’t work on the server, but works fine on the desktop. The exact same code works great on the desktop, but errors out saying that the ms excel spreadsheet that...
View ArticleBasic python in ArcGIS, need help!
Okay, so i had to take this copy of the random_sample.py script and call it random_percent.py. Now im being asked to modify the script so that the third parameter is a percentage of the number of input...
View ArticleCannot delete... May be locked by another application.
I've written a long script that selects a bunch of different feature classes and exports them to a file geodatabase by an attribute. Then I export those feature classes to shapefiles. Next, I zip the...
View ArticleScript to Filter and export an Access 2007 database using a Feature Class.
Hi, I was wondering if anyone could help me. I am relatively new to python so please keep that in mind with any replies. I am writing a script which will be exporting from a 1.2GB Access 2007 file...
View ArticleUsing Python in Field calculator to update null values
I am trying to update some entries in an attribute table so that where I have blanks I now have information based on another field in the table using the following code: def firstupdate(DescGroup,...
View ArticleProblem running arcpy.CopyFeatures using arcpy.da.SearchCursor
Hi, I'm trying to run the following script using python that uses the 10.1 introduced arcpy.da.SearchCursor (with a group by sql clause) to run over a feature layer, select two features with the same...
View ArticleHow to create a shapefile from a python list using ArcPy?
I've been looking for a way to create a shapefile from a python list (in the case below, uniqueList). Basically, I have been using SearchCursor's to iterate through a shapefile, and I would like to...
View ArticleDefine a function in Tool Class of PYT
I'm pretty sure this is possible and I'm just missing something relatively basic. I wrote a little function to do something (proprietary) and I want to leverage it within the execute function of a...
View ArticlePython toolbox output parameter
Hello, I'm using ArcGIS 10.1 and having trouble trying to set and get an output parameter in the execute() method of a Python toolbox. To illustrate, I've created a simple Python Toolbox which takes...
View ArticleHow to utilize layer name to populate attribute field
Hello everyone, Fresh to the forum and new to python. Would highly appreciate if someone can help me with the following: I have a large pile of shapefiles that are named by the date of their creation,...
View ArticleCreate a unique identifier with a suffix, hyphen, and number with leading zeros.
I hope this is the correct place to post this question. I need to populate a field that is 9 characters wide I created called (CG_ID) with a unique attribute. The attribute needs a suffix (PV) then a...
View ArticleBatch process to find nodata values = 0
I am wondering if it is possible to query a directory, returning results of any raster that has no data values of 0. I have been building mosaics, making the nodata values = 1. However, some have been...
View ArticleArcPy data analysis SHAPE@XY token centroid different than SHAPE@ centroid value
Working with a dataset of municipal parcels (polygons) I've noticed a difference between the XY centroid value accessed through the SHAPE@XY token VS SHAPE@. While I can't post an example, I found this...
View ArticleI need a script for Display Expression of Mile Markers
Hi- I am trying to show only the "whole Number" mile markers from my data file of State post Mile Markers. The data right now has tenth displayed as well. I am not savvy in scripting but think this...
View ArticleBouncing Ball Program with Tkinter
I am new to the forum as well as new to object-oriented programming. I have code that bounces balls around the tkinter window but I want to make the balls also bounce off one another, but am not...
View Articlerandomly select polygons and stepwise omit overlapping polygons
hi there, I have ~300 buffer polygons (see attached) and want to randomly select ~50 of them. when one polygon is selected, I want to omit all other polygons that overlap that selected polygon from the...
View Article