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

learn more… | top users | synonyms (1)

0
votes
1answer
96 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
126 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
74 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 = ...
1
vote
1answer
125 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
43 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
38 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
73 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 ...
0
votes
0answers
38 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
132 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
103 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
75 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 ...
2
votes
1answer
60 views

update cursor to calculate field

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
157 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 ...
0
votes
0answers
65 views

Arcpy ERROR 000732 using tools from Toolbox (Copy, FeatureToFeature etc.)

I have got a lot of feature classes in my sde postgreSQL database. When I check the existence of sde database using arcpy.Exists(inGDB) I get the True result. In the case when I check the existence ...
1
vote
1answer
140 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
68 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
74 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
92 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
55 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
141 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
40 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 ...
3
votes
1answer
226 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
70 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
52 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
128 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
46 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 ...
6
votes
1answer
91 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
36 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
48 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
122 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
78 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
73 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
81 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
57 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
61 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
30 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
136 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: ...
2
votes
1answer
235 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
169 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
64 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
240 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
53 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: ...
3
votes
1answer
106 views

Using update cursor in a while loop to perform analysis on individual polygons gets stuck on first row

I am working through an open courseware project from PSU found at https://www.e-education.psu.edu/geog485/node/145 I am trying to use an update cursor in a while loop to perform an analysis on ...
3
votes
1answer
139 views

How to perform Tool Validation in Python Toolbox?

I'm trying to make sure there is no '-' in the output filename, and if there is, to set an error (circle with the red 'X') so that the tool can't be run, and have a tooltip that explains the issue. ...
0
votes
2answers
54 views

Trouble using saveACopy with group layers [closed]

This code works fine on layers in the TOC that are not group layers, but errrors out if there are any group layers in the TOC. import arcpy, re, os arcpy.env.overwriteOutput = True #loop through ...
5
votes
1answer
181 views

data driven pages format

I have an issue, but I don't even know the terms needed to search for an answer. I'm exporting the pages to png files. The pages are divided by lots. Each page has a label with the lot number. In ...
1
vote
1answer
114 views

Insert Vertex into Polyline based on Point layer using arcpy

This is essentially the same question asked here that was not answered... Using ArcGIS 10.1 Advanced I have a point layer with points that represent the intersection of a driveway with a street ...
0
votes
0answers
58 views

append records for selected features with update cursor - arcgisscripting

Using arcgisscripting (as opposed to arcpy) I'm trying to append a new field for a fc which has unique geometry. Calculate field fails to perform for only selected records, as I'll note, so I switched ...
1
vote
0answers
94 views

building a progress dialog with pythonaddins in ArcMap

As a component of my add-in, I compute a bunch of summary statistics when the user clicks a button. This can take a while to process and it can appear as though the program has stopped responding. I ...