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

learn more… | top users | synonyms (1)

3
votes
1answer
144 views

Can folder connection in ArcMap Catalog window be added using python?

I have created a set of general scripting tools for map automation etc. in one of my tools a geodatabase is created in the workspace folder the script points to. Just out of curiosity is there any way ...
3
votes
1answer
118 views

Creating a polyline from point data that represents multiple linear features in ArcGIS 10.0

I have a problem where I have to somewhow create a polyline feature class in ArcGIS 10.0 from points that were collected in the field using a Trimble GeoXT that represent the start and end of multiple ...
2
votes
1answer
369 views

How to define a Feature Set parameter for an ArcGIS python toolbox tool?

I'm trying to create an ArcGIS python toolbox tool which use a polygon for input. I want the user to be able to create the polygon when the tool is run. I know how to do this using both a ...
1
vote
1answer
751 views

How to get sum of table column values into Python variable?

Im creating a script to calculate some new fields in Arcgis10.1 using the arcpy library. I need to sum the total of a table column in order to calculate a new field. I wanted to ask if it is possible ...
1
vote
1answer
244 views

Using arcpy.GetParameterAsText() or arcpy.GetParameter() to pass datetime.timedelta to script?

I have a function that takes a datetime.timedelta as an argument in a script that I want to use in ModelBuilder. I don't see an option for that as a parameter type, so for now I have a solution that ...
2
votes
1answer
95 views

How to get Network Analyst data from script file back into Model Builder?

I am running a script which takes some input parameters and runs some Network Analyst processes. The script is imported into a toolbox and is setup in Model Builder with the necessary input and output ...
0
votes
0answers
75 views

Why Add Join does not work in ArcMap and Arcpy?

I have problem with joining feature class with table from the same location (GDB) using Python script. When I use join Join and Relates -> Join... in ArcMap TOC it does not work because I do not get ...
3
votes
1answer
256 views

How to calculate angle of polyline at its midpoint using Python/ArcPy?

Trying to calculate the angle of a line at its mid point using python; this will be used to display flow direction on a water network. I've developed this script, which works in terms of generating ...
3
votes
1answer
69 views

How to Create Feature Layers and Search by Location for all Feature Classes in Geodatabase?

I'm very new to python, but I'm having trouble finding the answer on my own. I need to loop through a given file geodatabase, select any features that intersect a project polygon and then search the ...
2
votes
2answers
407 views

How to merge dbf files in Python or arcpy?

I have over one hundred dbf files to merge. Each of files have two columns: ID and another field which differs from one file to another. I want to merge those fields based on ID such that each raw ...
0
votes
1answer
46 views

How to use the local macro to do ZonalStatisticsAsTable in batch

I have a series of files named as 'rawfile200101', 'rawfiles200102',...,'rawfile201104'. I want to do ZonalStatisticsAsTable for each of them with names corresponding to the time of the raw files, ...
2
votes
1answer
207 views

How to convert arcpy.InsertCursor to arcpy.da.InsertCursor in Python code?

I have some working code using arcpy.InsertCursor which I want to convert to arcpy.da.InsertCursor. This I want to do primarily as ESRI claims that da methods are more optimized. The code I have is ...
2
votes
1answer
87 views

ArcPy: Drop fields from list of fields for arcpy.da.SearchCursor

I have a feature class with several fields in the attribute table, and I want to export a few but not all of those fields out to a tab delimited text file. The code below sort of works, half of the ...
2
votes
1answer
90 views

Create lines from points arcpy

I have a points shapefile, and a file that tells me which of the points have a line between them. I am using arcpy to create a new shapefile to hold the lines and then create the lines based on the ...
5
votes
1answer
124 views

Is there a way to find out which pixel values are around the current pixel?

I would like to write a cycle which takes a current pixel, look at the surrounding pixels, choose the pixel with max/min value and skip to that pixel...and so on. Is there in arcpy such a function ...
1
vote
0answers
40 views

Is there a way to test if a feature class is registered with geodatabase?

I've got feature classes inside an Oracle 11g ArcSDE geodatabase. I'd like to perform the arcpy method RegisterWithGeodatabase_management on all those feature classes. But before that, I'd like to ...
2
votes
1answer
54 views

GDS Workspace Path resovles as owner not user

I am having trouble retrieving the correct path to the current map layer dataSource path. I am using ArcGIS Desktop 10.2 (10.2.0.3348) The workspace path that gets returned is correct apart from the ...
0
votes
1answer
143 views

How do I edit a Direct Connection Workspace using arcpy.da.Editor?

How to start editor to edit version data for ArcGIS 10.1 direct connection. I tried as given below code but it is throwing an error "Operation only allowed by the owner of the version [SDE.DEFAULT]". ...
4
votes
1answer
89 views

end execution of script and send email if schema has changed

I would like to append the data from one feature class to another after confirming that the schemas match in both feature classes. I can append the data from one FC to another by using this simple ...
-3
votes
2answers
93 views

How to get layer extension info via Arcpy

I want to get file format of a layer with using Arcpy. I am writing a tool that needs to take raster or feature extension like SHP, TIFF etc. Which functions should i use ? Note: I use ArcGIS 10
2
votes
1answer
400 views

arcpy FieldMappings for Spatial Join

I'm trying to create a python script tool to use within ArcMap 10.1. I created a Model and exported it as a python script and added custom field mappings for the first Spatial Join by reading through ...
2
votes
1answer
168 views

How to copy values from field to another using arcpy?

Can some one please let me know how I can do simple field calculation like Copying From "A" to "B" in ArcPy? I have found lots os example on web which they all used extra expression and they were ...
0
votes
1answer
65 views

How to delete Field From Shapefile by Arcpy [closed]

I am using the following code to delete a field from a shapefile but I am getting an error! def main(): # Import arcpy module import arcpy # Local variables: point_shp = ...
0
votes
1answer
37 views

How to Add Field Between Two Existing Field in Shapefile

Can you please let me know if it is possible to add a new Field between two existing field using ArcPy? For Example if I have "Name", "Area", fiels already in my shapefile can I add a new field called ...
4
votes
1answer
356 views

Issue on using Pyscripter with ArcGIS 10.2

Can someone please let me know how I can set the Pyscripter 2.5.3.0 x64 works with Python 2.7.3 which comes with ArcGIS? what I did was: 1- I installed the ArcGIS 10.2 2- I installed Pyscripter ...
4
votes
1answer
123 views

Is it possible to store a default symbology layer in an arcpy add-in?

Since arcpy is limited in how symbology can be manipulated, I was curious to know if a symbology layer can be stored in an arcpy add-in. Does anyone know if it is possible to store a .lyr file, or ...
2
votes
1answer
75 views

How to specify units when using SelectLayerbyLocation_management WITHIN_A_DISTANCE?

Can anyone help by suggesting how to specify the units when using the SelectLayerbyLocation_management tool. I am selecting by "WITHIN_A_DISTANCE" and the ArcGIS resources do not suggest how to do ...
6
votes
1answer
85 views

Is setting the env.workspace var necessary for python add-in buttons in ArcMap?

I made a custom add-in for ArcMap (10.2 in my case) and was reviewing my code with a colleague. We're not sure if the setting the workspace is required in the code since the button's script is only ...
1
vote
2answers
484 views

Fastest way to Join tables in python automation

My issue comes form the fact that doing Joins manually is actually relatively quick (5mins), but python automation of this process is 6hrs! Here is my code: import arcpy GDB_MARK_TO_MARK_VECTOR_VIEW ...
3
votes
3answers
165 views

How to convert Midpoint of Polyline into Point Feature using ArcPy?

I am trying to write a python script to determine flow direction on a water pipe network. I've used this script to find the mid point along each polyline, now i need to convert this data into a point ...
2
votes
2answers
85 views

How to determine stream channel Reach locations?

I have a stream network and want to determine stream reach locations In attached figure, Reach 4 is at the junction of sub2 and sub5, and Reach 3 is at the junction of sub1 and sub4. Any suggestions ...
0
votes
1answer
277 views

NameError: name 'Con' is not defined

I have 365 rasters with the same extent, and I am trying to sum them together by month. I have the script below, which was working until I added the line out1 = Con(IsNull(raster), 0, raster) which is ...
1
vote
1answer
262 views

Insert Cursor fails to write results to table

Insert Cursor fails to write results to table. The Search Cursor is returning the results, but errors when trying to insert into field. # Insert Cursor for GDB table to GDB table # Import modules, ...
2
votes
2answers
245 views

Why cant I use SelectLayerByAttribute_management while a cursor is set

I've been having a problem with arcpy in that the simple line: arcpy.SelectLayerByAttribute_management ("TEMP_LINES") produces this response: Runtime error : ERROR 000358: Invalid expression Failed ...
1
vote
2answers
73 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
92 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
122 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
259 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
243 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
213 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 = ...
0
votes
1answer
124 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
262 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
99 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
208 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
49 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
57 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
89 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
44 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
146 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
151 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 ...