A site-package created by Esri to expose ArcObjects to Python.

learn more… | top users | synonyms (1)

1
vote
2answers
86 views

Adding/updating field to polygon feature class that lists bordering (neighbor) polygons?

I have a dataset of zipcodes. I want to add a new field "NEIGHBORS" that includes bordering polygons in a comma delimited manner such as attached image:
2
votes
0answers
108 views

Data loss after compressing geodatabase in ArcSDE

I suffer sometimes from data loss after compressing ArcSDE geodatabase, this geodatabase contains versioned feature classes, so the compressing script reconciles and compress the geodatabase: # ...
1
vote
1answer
239 views

Why does FeatureClassToFeatureClass field mapping create shapefile with no attribute values on local machine from ArcSDE?

I have inherited taking over and supporting and ArcSDE GIS database. We have a process that we must do every 6 months to export certain features from the ArcSDE database into shape files so that they ...
2
votes
1answer
350 views

Automatic calculation in one attribute table based on values in another attribute table using python

I am trying to fill the fields of one gdb table based on some statistics over the attributes of another shape file. As it was not possible in ARCgis directly, I am trying to use python coe for this ...
1
vote
1answer
402 views

Why does ListLayoutElements give IndexError: list index out of range?

When trying to create a legend on ArcMap use the following Python/ArcPy code I received an error message: import arcpy mxd = arcpy.mapping.MapDocument(r"E:\cities\MyProject.mxd") df = ...
0
votes
2answers
438 views

What causes ExecuteError: ERROR 000358: Invalid expression Failed to execute (SelectLayerByAttribute) on shapefile? [duplicate]

My script runs perfectly for feature classes, but not shapefiles. It crashes at the point of selection, provided there is a query. gp.Workspace = "C:/someworkspace" fc = "featureclass.shp" query = ...
1
vote
1answer
273 views

Python problems with select by attributes and user input

I am attempting to create a tool where the user can input a census tract number within the city of Plano (there are 77 tracts) and it ultimately creates a map layout showing the population density. I ...
3
votes
1answer
461 views

Edit SQL Server table (not registered with geodatabase) with arcpy

I am trying to update some rows in a SQL Server database table (not registered with geodatabase) with arcpy.da.UpdateCursor. However, when running the deleteRow(), I get the error return without ...
0
votes
0answers
119 views

Change symbology of layer of unique symbol to unique with python

I have a problem concerning how can I change the symbology of a layer with unique symbole to unique values. I don't know how to update it. I used this code: import arcpy mxd = ...
2
votes
1answer
361 views

How to edit PostgreSQL geodatabase table using ArcPy?

I'm trying to update a table using a python script and it's not working. The table resides in a postgres geodatabase and is versioned. I have also verified my user permissions (I'm the admin). The ...
0
votes
1answer
68 views

How to programatically create point and use it in Select by Location query?

I have a section grid for a US state. I also have a quarter/quarter section grid which splits the section grid into 16 equal squares. I have written a Python script that finds the XY coordinates of ...
0
votes
1answer
82 views

Arcpy SelectLayerByAttribute for loop with “ADD_TO_SELECTION”

I am a little bit confused with the "ADD_TO_SELECTION" possibility. I process a point layer. First, the idea was to process the points with the different GBAUPS attribute separately. And it worked ...
2
votes
2answers
115 views

How to create ArcPy script that checks for duplicates and warns if adding one?

I am new to GIS(Arcpy)/Python programming , but I have experience in other languages. I have a question regarding the possibility to create a tool/script that does the following -- Check a specific ...
1
vote
0answers
58 views

Arcpy PageLayout.dll Errors in Python

import os import arcpy arcpy.env.overwriteOutput=True folderPath= raw_input ("Enter directory: ") filePath= raw_input ("Enter data repository: ") f = open((os.path.join ...
2
votes
2answers
167 views

How to create simple select script in ArcPy?

I am new to Python and want to create a script inside the ArcMap Python window. My current workspace is a series of rivers portrayed in the state of Ohio. I have a list of fish and the rivers (from my ...
4
votes
1answer
240 views

Where can I find ArcGIS logs when I execute a python script using arcpy?

I'm executing a python script locally on my computer where ArcGIS Desktop 10.0 is installed (Windows 7). The script uses functions from the arcpy library installed with the ArcGIS Desktop to manage ...
0
votes
2answers
90 views

ArcPy symbolize layer if a value is correct

I want to symbolize a layer in an active session and add to display if some kind of value is right. I found a way to symbolize in an active session here So i tried to extend it, but unfortunately it ...
1
vote
2answers
241 views

Alter validation in ArcGIS script tool

I have a script tool in ArcGIS 10.1. Some of the parameters are optional and if they are left blank, will not be processed. They are numerical parameters and I want to enforce this in the tool, so an ...
1
vote
0answers
109 views

update cursor to calculate field [closed]

This is my first post, so any help is greatly appreciated. I'm trying to use an update cursor to calculate a field. Basically, I'm trying to avoid division by 0 by looking in row[0] and see if it's 0. ...
2
votes
1answer
459 views

How to export Select By Location result to Excel using Python and ArcPy?

I have been using ArcGIS for a few years now but have only started using Python scripting for ArcGIS for a month or so. I am trying to create a script and I am having a hard time trying to get it to ...
1
vote
1answer
292 views

How to use 'remap' in reclassify tool code in ArcGIS Python Toolbox

I am making a reclassify tool in ArcGIS python toolbox (.pyt) ... I am able to use the remap datatype but am not able to parse the information present in Remap in the Reclassify function's third ...
0
votes
0answers
103 views

ArcMap: Append is really slow

I'm writing a Python script for ArcGIS 9.3.1 which is supposed to do the following: Create a new feature class in local FGDB Loop over a set of IDs (~40,000) Select features from an Oracle GDB with ...
1
vote
2answers
88 views

What is the most efficient method to delete points?

I have a script that takes a point featureclass (FC) through the following workflow: Select points that lie within individual polygons From the selected points within each polygon, randomly subset ...
1
vote
1answer
245 views

Arcpy ERROR 000732 when ApplySymbologyFromLayer

I want to split a shapefile by certain attribute and then apply a symbology layer, finally output it as a KMZ file. R1 = outpath + 'R1.lyr' arcpy.MakeFeatureLayer_management(fc, R1, "WHERE CAUSE") ...
2
votes
2answers
64 views

Need to understand desc.workspaceType to use in conditionals

I need to differentiate between two possible types of workspaces for an arcpy script. So I check the workspaceType: rootWorkspace = raw_input('Geodatabase workspace to analyze: ') desc = ...
3
votes
2answers
305 views

ArcGIS Python - Convert feature class names to lower case

Can anybody anyone point me to directions on how to convert file geodatabase feature class names to lower case by using python? Thanks
1
vote
1answer
87 views

Python Stand Alone ArcGIS toolbox output feature class becomes input feature class within same tool?

Developing a script in toolbox. I have a table that I use to make X Y layer (input 1) I am saving that created layer as a point feature class. (output 1) I then want to run kriging on that newly ...
4
votes
1answer
1k views

What is Python equivalent of ModelBuilder's Iterate Feature Selection?

My data consists of two featureclasses: Points = points representing trees Polygons = Polygons representing % canopy area by area. Each polygon in the FC has a % canopy measurement in the ...
3
votes
1answer
83 views

How to find number of fields in shapefile using Python?

I've been looking at the ArcGIS resources for python but I can't seem to figure this one out. I'm looking for a method to gain access to the number of fields that are within a shapefile / feature ...
1
vote
1answer
188 views

How to reset ObjectID after running Delete_Features on SDE feature table?

I have a python script that deletes all features on a SDE feature table and then inserts new features to it. I noted that the ObjectID keeps incrementing from where the last feature was with before ...
6
votes
1answer
262 views

How to call arcpy.RefreshActiveView() every 5 seconds using ArcGIS Python?

I have an Excel macro that generates random values after every 5 secs and I am reading it in ArcGIS for Desktop... to refresh the view I have to press f5 and the view gets updated. Now I want to ...
0
votes
1answer
61 views

missing values w/ updatecursor and addfield - gp

I added a feature to my 'overloading' field update script which adds a new properly named field if there is no space left to append the value into the record. This appears to run well, however upon ...
0
votes
1answer
147 views

Automating calculation of Population Density in Census Tracts?

I am quite new to Python and I am attempting to practice by making a simple program with ArcGIS. I wanted to make a script that automated the calculation of population density of selected census ...
6
votes
1answer
191 views

Pull Data from Specific Excel Cell into ArcPy

I am new to Python and ArcPy, and wish to create a short script that pulls in a value from one specific Excel worksheet cell (namely, A2) and then performs an 'if' statement, whereby if the value of ...
0
votes
1answer
56 views

How to store both fixed and variable attributes as a feature class?

I have a live data feeds as an XML file from the Internet. I need to use Python and ArcPy lib to store each feed as a point feature in a feature class of an ArcSDE datbase. The xml looks like: ...
0
votes
1answer
135 views

Failed to use InsertCursor to add point features

I have following python script to create a feature class in an SDE database and try to add point features to it. sde_conn = "d:/sde.sde" st_fc = arcpy.CreateFeatureclass_management(sde_conn, ...
1
vote
2answers
422 views

How to add shapefile as layer to map using Python and ArcPy?

I am working on an application and I am a beginner in Python :( I want to add a shapefile, the execution is successful and everything but no result appears on ArcMap, here is the code I use: import ...
0
votes
1answer
170 views

Copying Network Analysis Layer - Service Area Polygon in Python Script

I have built a geoprocessing tool using arcpy modules in python. Screenshot shown below: In this tool I am creating Service Area Polygons and selecting census boundaries within those Service Area ...
4
votes
1answer
127 views

Convert linear polygons to lines

Hi I have some long linear polygons that I'd rather store as lines but I'm not sure how best to do this. Ideally I'd have a line goiung through the centre of the polygon lenthways. I have two ideas of ...
2
votes
2answers
158 views

How to check if vertex exists (on polyline) based on location of point layer using ArcPy?

Using ArcGIS for Desktop Advanced 10.1 (with all extensions) I am building a centerline network that will be used by a MapObjects program to do routing based on "turns at any vertex" (as opposed to ...
4
votes
1answer
65 views

Programatically detect the format/version of an arc toolbox (e.g. 10.0,10.1 etc)

Is there a way to tell programatically (from the command line) what format a given ArcMap toolbox was saved in - 10.0, 10.1 and so on?
2
votes
1answer
74 views

Mystery duplicate values

I'm using a unique list to populate up to 10 fields for a fc with correct geometry, in an "overloading" manner as you would in excel. I noticed on my first run through I had an "index out of range" ...
1
vote
1answer
57 views

Field's name with numbers: why not?

I have tried to create field in TOC called with numbers with python. But, it has a problem: it couldn't do it because name's of fields are numbers. It is strange for me. When I do new field in shape ...
-1
votes
1answer
38 views

Error after code completion

Why arcpy throwing an error after completed code execution ? import os import arcpy import xlrd arcpy.env.overwriteOutput = True inWS = r'C:\Excel' excelDirectoryName = inWS arcpy.env.workspace = ...
2
votes
1answer
235 views

How can I put the name of file in add field with python?

In my script, I have to create field in 15 layers. The name that I wold like to set in this new field is the same of the file's name. But all attempts that I did were worng. My script: ...
3
votes
1answer
831 views

arcpy - Calculate field in a joined table

I've to calculate a field based on another field in a joined table, but an error occurs: "Parameters are not valid. ERROR 000728: Field !Table_A.field_A! does not exist within table" My code: ...
0
votes
2answers
412 views

How to List Tables from current map document (mxd)?

We have many maps containing Feature Classes and Tables in a Personal Geodatabase that need their information updated. Is there a function to List Tables from the current map document like mxd = ...
0
votes
0answers
113 views

Lock file on shapefile persisting with arcpy.ImportMetadata_conversion

I've got a script that does a number of things to two shapefiles, and it appears that the metadata import step is creating a lock file on only one of the shapefiles that persists even after del arcpy. ...
3
votes
2answers
573 views

Why does import arcview/arceditor give gp.setProduct() RuntimeError: ERROR 999999: Error executing?

I am developing a script that will be used in ArcGIS Desktop 10.2 of Standard (formerly called ArcEditor) license level and thus importing arceditor to make sure I don't use GP tools that require ...
0
votes
0answers
77 views

Model Run from Python script

Ive broken a complex task down to a very simple excersise and still cant get it to work.... I need to set up a Python Scpript to Run a Model. model: "SelectTest" toolbox: ...