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

learn more… | top users | synonyms (1)

0
votes
1answer
110 views

How to filter shapefile using definition query?

I have a point shapefile which I want to interpolate using IDW interpolation. However, I want to interpolate only those points which satisfies a certain condition. I need to do it in python and I ...
0
votes
1answer
89 views

NameError: name 'finalPdf' is not defined

Could you please help me with this error: Traceback (most recent call last): File "C:\DDPeX\Export_GroupPDF.py", line 19, in finalPdf.appendPages(tempPdf) NameError: name 'finalPdf' is not ...
0
votes
2answers
258 views

ArcGIS 10.1 - Using Polygon Neighbors with dissolved polygons

I've used polygon neighbors to find all neighbors of a polygon layer, which I then use to look up all possible neighbor combinations and dissolve the polygons into all possible combinations of two ...
0
votes
1answer
424 views

Geographic Transformations using ArcPy vs. Coordinate Systems used by ArcGis online basemaps

I have 3 shape files with undefined projection, but I know which one it was used (Lisboa_Hayford_Gauss_IPCC). I need to 1st Define Projection. It works. I need to transform it from WGS_1984, so I've ...
0
votes
1answer
111 views

Is there a way to change environment settings of a dataset without creating a new one?

I am trying to change the environment settings of an existing dataset. I found a workaround by first changing the environment settings in the SDE-database and then create a new dataset with now ...
0
votes
1answer
158 views

ArcGIS Python Script Buffer [duplicate]

I have a problem, I'm trying to create a buffer as part of a code but I keep getting the following error: ExecuteError: Failed to execute. Parameters are not valid. ERROR 000735: Distance [value or ...
0
votes
3answers
237 views

Why does CalculateField set values to <Null> when output extent is in a different coordinate system?

I'm quite new to ArcGIS, and now I have to work on a script that goes through a list of feature classes to: add a field to their attribute table and fill that field with a number that I retrieve ...
0
votes
1answer
115 views

Trying (+ failing) to use a Function in Field Calculator

I'm trying to populate a field using a function. When I run this in Pyscripter, it works fine: d = {} # Function # def find_dups(val): d[val] = d.setdefault(val, -1) + 1 return d[val] # ...
0
votes
1answer
251 views

Apply Symbology to a group layer

I currently have around 200 features that all need have the same symbology applied to them. I have used the ApplySymbologyfromlayer_management however this takes much to long to process, at least a ...
0
votes
2answers
272 views

Add a time dimension in ESRI mosaic raster dataset

I am in the process of creating a script to pull daily .asc files from a ftp server, convert them to a raster format, and push them into a mosaic raster dataset. Ultimately, the raster dataset will be ...
0
votes
4answers
1k views

Arcpy to copy a layer in the ArcMap TOC, rename the copy, and paste back to TOC?

I want to make a copy of a layer in the ArcMap TOC (passed to my script as a Feature Layer), assign the copy a new name, set a definition query on it, and then add the copied Feature Layer back into ...
0
votes
1answer
121 views

How to add layer in Arcscene using script tool

import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd, "*")[0] addLayer = arcpy.mapping.Layer(r"F:\project\Final\Ground floor\steps.lyr") ...
0
votes
1answer
104 views

Error: Exception Raised on the “for row in rows” command line?

I am comparing fields in layers. I have the AADT layer and AADTAnno layer and I want it to search the fields FLAG and TFLAG. For Example: If there is a 29C9 in AADT layer in FLAG fields then there ...
0
votes
1answer
131 views

How to use wildcard when appending PDFs using ArcPy?

I'm working on a script that (as written) produces a large number of individual pdf pages (>100), instead of hardcoding the names of each of the outputs, I was thinking of using a wildcard. However, ...
0
votes
3answers
64 views

Using Sort_Management for multiple tables

I like to convert tables (100+) living in access database to a geodatabase tables, sorting them and deleting unnecessary fields in each table at the same time. I figured I use the Sort_management ...
0
votes
1answer
231 views

Clip data and add layer to second dataframe using python Add-In

I want to clip a layer from data frame 1 and add it to the data frame 2 using the following script. But instead it just add all grids to current data frame 1 and don't update data frame 2. Please ...
0
votes
1answer
120 views

How can you identify the feature OID from a geometry object

I know arcpy allows you to access geometries directly using the CopyFeatures_management method. Note in their code sample for the Geometry object, it is very simple to copy the geometries to in-memory ...
0
votes
1answer
380 views

Failed to open raster - ArcGIS 10 SP2, Python 2.6.5, Windows 7

I have an arcpy / python script that is working fine with ArcMap 10 no Service pack (Build 2414) on windows XP, but consistently failing on using ArcMap 10 SP2 (Build 3200). Getting the ESRI 99999 ...
0
votes
1answer
175 views

How to check if a layer exists in a geodatabase through ArcToolBox or Python?

I have got a python to update a file geodatabase (*.gdb). Every time the code executes, it needs to check if a certain layer has been already there in the previous geodatabase; if so, delete it and ...
0
votes
1answer
194 views

Check multiple feature classes have same spatial reference

As the title says I've several feature classes. I want to check whether they have same spatial reference using arcpy
0
votes
2answers
950 views

arcpy layer issues

This should be a really simple process but I am having issues. I want to search a workspace for all files with a certain string and then add them to the current workspace with a selected symbology. ...
0
votes
2answers
521 views

Arcpy: replaceDataSource, cad_workspace

I am having trouble replacing the data source on CAD files using arcpy. Everything I have tried runs into this error: Runtime error type 'exceptions.ValueError' : Layer: Unexpected error Here is a ...
0
votes
1answer
811 views

How to use variable field name in arcpy.SearchCursor?

I have code that says fld = fieldName rows = arcpy.SearchCursor(fc) for row in rows: x = row.fld How do I use a variable for my field name in python ArcGIS 10 on windows? Thanks.
0
votes
1answer
360 views

Calculating length with Python and the PYTHON_9.3

(Please critic wholly if possible) If I have polyline data in NAD83 and I want to calculate geometry using the PYTHON_9.3 parameter from the arcgisscripting.create(9.3), I am getting mixed results. If ...
0
votes
3answers
27 views

Using search cursor to determine renaming of feature class

What I am trying to do is create a list of shapefiles based on field name values. From there I would like search on 1 field (each shapefile will only contain 1 row) and if the value in that field is ...
0
votes
1answer
37 views

Split a line from point but with a certain distance [duplicate]

I am using ArcGIS 10.2. I need some suggestion about this problem, maybe there is a certain tool, but I think no. I think some python code... but I do not know from where to start :( I have two ...
0
votes
1answer
37 views

How to create polygon feature class from UTM coordinates?

I am working to create a polygon from UTM coordinates. The script I am using fails with a "must be a sequence, not float" error: Traceback (most recent call last): File "F:/sample/clipTiles.py", ...
0
votes
4answers
49 views

Using Arcpy, how can I determine min and max elevation from a raster DEM layer within my current extent?

Using Arcpy, how can I determine min and max elevation from a raster DEM layer within my current extent? I'm currently using Data Driven Pages to centre the layout on each feature extent. I need to ...
0
votes
1answer
39 views

Using a Search Cursor with a list

I'm hoping someone knows the answer to this as I am pretty new to Python. What I'm attempting to do is create a list of .dbf tables using a wildcard which I've managed to do. From there my goal is to ...
0
votes
1answer
59 views

Create polylines from point array Python

I am working on building polylines from an array of points I have created from a csv file and am completely lost in building the lines. My code works as follows: I have the point array working, I need ...
0
votes
1answer
46 views

Updating file geo database table

I have an input csv file that I process using a python script and generate a new output csv file. I then, in the same python script use Table to Table (Conversion) in order to store the data from the ...
0
votes
1answer
29 views

Clip a shapefile based on raster extent with high accuracy

I am trying to clip a shapefile based on the extents of a smaller raster. I find the extent of the raster using this code: Extents = arcpy.sa.Raster(MyRaster).extent` Then, I use these lines to ...
0
votes
1answer
39 views

Converting Raster datasets into layers using ArcPy/ModelBuilder?

I am new to ArcGIS and ArcPy (just started using them on Wednesday). I am using a model to create a Point Density plot from a Shape File, with the output being a Raster dataset. I want to ...
0
votes
1answer
40 views

Creating new layers using ArcPy to define Definition Query for each field value?

I am trying to set multiple definition queries for one layer based on one field using python. ie. I have a City layer with a field that holds the city name. I want a copy of the layer in an MXD ...
0
votes
1answer
60 views

Executing tool comes back with an error arcpy.JoinField_management

I have this script snippet, written by Aaron. import arcpy import os #set workspace arcpy.env.workspace = "C:\\Users\\lambioch\\Documents\\Wetland\\New_Folder" #in the folder "New_Folder" is a ...
0
votes
1answer
41 views

Definition Query then Zoom to Layer Automation?

I'm trying to create something in here. I want to have an automated process of doing a DEFINITION QUERY then ZOOM TO LAYER with one step. the concept is like that, a dialog comes up with one form ...
0
votes
1answer
35 views

Adding field to table without path to table (python) [closed]

I want to add a field to my table in the FieldCalculator. import arcpy arcpy.AddField_management("veg8", "test", "TEXT") An error message occured doing this and I figured out that I need to set a ...
0
votes
1answer
65 views

arcpy Make Feature Layer using a where clause

From a table of lines and polylines I am I'm building a seperate table of points (nodes) with their X and Y coordinates stored as attributes. I want the nodes to be unique, so I'm checking to see if a ...
0
votes
2answers
46 views

Make lists of shapefiles using loop

There are the following shapefiles in workspace. L01-1983_01.shp L01-1983_02.shp ... L01-1983_46.shp L01-1983_47.shp L01-1984_01.shp L01-1984_02.shp ... L01-1984_46.shp L01-1984_47.shp ... ...
0
votes
1answer
30 views

I'm Having trouble with the Arcpy geometry.disjoint function

I have points along along a line. Points that intersect the segment of the line to return attribute information. My line as three connected segments. ESRI Docs says disjoint (second_geometry) ...
0
votes
1answer
43 views

Loading graph (.grf fle) into MXD using ArcPy?

I have hundreds of pairs of FGDB and associated MXD files. I need to insert a graph in each mxd linked to its corresponding FGDB. No problem creating graph, but stuck on how to get graph into mxd ...
0
votes
1answer
62 views

DeleteField_management gives ERROR 000308 Invalid field type?

I am attempting to delete a list of fields in a feature layer but am getting an error: Execute error: Failed to execute. Parameters are not valid. ERROR 000308 Invalid Field type Here is a code ...
0
votes
1answer
32 views

Update rows based on number and position in table

I'm trying to update rows using the update cursor, but based on the number of rows in a sequence of three list items. Looking at the list below, it needs to update first four rows to 'B', then the ...
0
votes
1answer
101 views

ArcGIS 10.2.1 Table To Table tool in Python script gives ExecuteError: ERROR 001156?

I work for an organization that just upgraded from esri arcmap 9.3.1 to 10.2.1 and I'm currently in the process of updating the python scripts. When running a script I'm getting hung up on a portion ...
0
votes
1answer
27 views

How to group numbers based on first digits and then find min/max? [closed]

I have been struggling all day with this. I wish Python were more like SQL it would be so easy for me, but I am still learning. Basically, I just want to group numbers based on their first four ...
0
votes
1answer
73 views

How to select a feature and get its fields by mouse click using Python Addin in ArcGIS?

I'm building a python addin tool in arcgis and I would like to click a feature, say a polygon on the map, and get the polygon's attributes,i.e. ID=3,NAME = "CITY3"...It's similar as the arcmap tool ...
0
votes
2answers
34 views

A tool as part of a dialog box

I have a button created using Python Add-Ins which pops up a dialog box which is built using wxpython. I am wondering if I can place a tool (Select Layer by Location) within that dialog box to get ...
0
votes
2answers
42 views

CalculateField_management no-success

The following script is suppose to do the following, similar to what was done here: Renaming a field using arcpy. Create a fieldlist. Read thru the fieldlist and create a new field named "OLD_" + ...
0
votes
1answer
25 views

arcpy to handle topology error inspector

I am now want to do topology check use python, but I don't know whether arcpy can realize the function in error inspector. May I call error inspector and get the error records(something like attribute ...
0
votes
1answer
44 views

Can I validate topology using python script when ArcMap is open?

I am testing on validating topology using python.The situation is when I run the script when arcmap is open, an error occurs which indicates the topology has already been opened (FDO error: ...