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

learn more… | top users | synonyms (1)

1
vote
1answer
94 views

turn a Result object into a number

**import arcpy from arcpy import env from arcpy.sa import * import math # Check out any necessary licenses arcpy.CheckOutExtension("spatial") # OverwriteOutput arcpy.env.overwriteOutput = True ...
3
votes
2answers
289 views

Using python to Raster clip the extent to be the same as the display?

I've been trying to figure this out for almost a week now. I am creating a tool which first needs the raster to be clipped out to the current display. I have tried all sorts of things. Below is the ...
5
votes
2answers
380 views

Download data via a ftp server using polygon features

The attached script loops through the features of a polygon featureclass and uses that attribute information to download particular files via a ftp server. The script works great for downloading ...
4
votes
1answer
1k views

Finding duplicate records in field using ArcGIS for Desktop?

im looking for duplicate records in dbf files based upon the attribute called 'ID'. I have various dbf files from 500,000 records to 1.5 million and I know there are a host of duplicates. I would ...
2
votes
1answer
101 views

How to re-arrange attributes of a polygon based on attributes of polyline file?

I have a polyline (subrivers) and polygon (subshed) shapefile with both of them are shown along with tables. Their FID index don't overlap spatially, e.g. surivers second row attribute doesn't ...
1
vote
1answer
445 views

Why does copying ArcSDE datasets and features in Python give ERROR 000732 & 000735?

Go easy, I'm new to python I keep getting a kick back that says this: ERROR 000732: Input Features: Dataset 'Database Connections\Wyoming.sde\Supporting_MT_DBO_Geology' does not exist or is not ...
9
votes
4answers
241 views

How to determine if point is surrounded using raster processing?

I am attempting to improve a currently extremely cumbersome vector/python process for a natural hazard model. At the moment we have a lengthy script which generates distance/bearing lines from a given ...
0
votes
0answers
112 views

recording pixel value with Python script in ArcGIS 10.x

A scripting newbie question... I'd like to write a Python script for ArcGIS 10.x that would record the pixel value for all pixels in a raster. Furthermore, I'd like to only record a given value once ...
5
votes
1answer
635 views

How to select specific row in attribute table using ArcPy (without iterating through whole table)?

I am using ArcGIS 10.2 and have assumed until now that it is possible to select a specific row in an attribute table. However, I can't seem to find a way to do this. The only available methods seem to ...
0
votes
0answers
43 views

recording pixel value with Python script in ArcGIS 10.x

A scripting newbie question... I'd like to write a Python script for ArcGIS 10.x that would record the pixel value for all pixels in a raster. Furthermore, I'd like to only record a given value once ...
0
votes
1answer
575 views

Arcpy ListLayers function returns only the first sub layer in a group layer (as opposed to the group layer AND all sub layers of that group)

I thought the arcpy.mapping.ListLayers function in ArcGIS 10.1 was supposed to return group layers AND all of their sub-layers, but my script is only outputting the first sub-layer in a group layer. ...
4
votes
1answer
657 views

Generating a multivalue choice list in ArcGIS using Validation [Not availalbe for Standard License]

I'm trying to adapt a model and script combination found on ESRI's blog site titled 'Generating a multivalue choice list'. However, I've concluded that part of the validation used in the embedded ...
2
votes
2answers
180 views

Python Def Query Help for multiple layers

I have Three layers in a .mxd, all three layers have a common value I can use, but a different Label in each Layer. As an example, the Value I want to use is "100" In Layer A, the Value is in [Name] ...
1
vote
2answers
156 views

Copy rasters slow, increases file size

I have a folder with ~1200 aerial photos in both jp2 and tif format, of which I need about 380. I wrote a python script to get the names of the files I need, which works fine. But when the script ...
2
votes
2answers
289 views

How to programmatically change raster symbology after reclassification?

I have created a code in Python that I will use for a custom tool in ArcGIS, the code will create a Eucledian Distance of 6000m around a point and Reclassify the distance from 0-2000, 2000-4000, ...
6
votes
2answers
274 views

Can a 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 ...
3
votes
1answer
157 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
644 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 ...
5
votes
2answers
2k 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
390 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
121 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
108 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
500 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
81 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
628 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
52 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
385 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
97 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
127 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
197 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
56 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
72 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
191 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
102 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 ...
-2
votes
2answers
121 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
733 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
344 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
137 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
42 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
599 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
134 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
127 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
106 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
861 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
194 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
90 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
492 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
430 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
352 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
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: