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

learn more… | top users | synonyms (1)

1
vote
1answer
81 views

empty file geodatabase error (nowhere feature class)using arcpy [closed]

i want to import a python(2.7) script to arcmap 10.1 my script has 2 inputs variables one for workspace and another raster dataset and i want o convert input raster as feature class polygon . i want ...
0
votes
1answer
68 views

Weighted Overlay - passing parameter as text error?

For some reason when hardcoding the save path for the wieghted raster just before runtime it works perfectly. Like such... arcpy.env.cellSize = "90" arcpy.env.workspace = r'G:\Xcel\Route ...
-1
votes
1answer
45 views

define error for python script to import arcmap [closed]

i want to create a simple python script for create one file geodatabase but show me define error # Import arcpy module Import arcpy import sys import os from arcpy import env from arcpy.sa ...
2
votes
1answer
63 views

Conditional SQL Query

I've been running a code that searches a desired field in a feature class and performs an specified SQL query based on whether the field is string or double. The variables are just temporary fillers ...
2
votes
3answers
289 views

How to set Definition Query on ArcPy layer from shapefile?

I'm trying to determine options to set a layer definition query using ArcPy. I know that it is possible when using arcpy.mapping.ListLayers(). However, in this scenario I am loading in ...
0
votes
3answers
407 views

arcgis python attribute error, object has no attribute [closed]

So I am very new to python and working through my first online course. Does anyone know how I can fix this error: ...
2
votes
3answers
438 views

Adding a new field and calculating area using Python

Using Python, how do you add a new field to your shape file and calculate the area in km2?
1
vote
0answers
96 views

Running python script outside of Arcmap's python console

My codes works fine in Arcmap's python windows. But when I try to run it in a command promt windows, It says that; ERROR 000837: The workspace is not the correct workspace type. But it works fine ...
0
votes
1answer
43 views

registering or unregistering as versioned a future dataset with python

As you know, you can store feature classes in arcsde in two ways. Firts, in the root path: sde_conn_file.sde/FeatureClass Second, in a dataset: sde_conn_file.sde/DataSet/FeatureClass How can I ...
1
vote
1answer
69 views

SQL within Python Script to get only part of the expression by GetParameterAsText

I was wondering if anybody could help me. Im trying to create a tool within ArcMap using a python script. Within the script i've been trying figure out how to change it so that I only need to get ...
2
votes
2answers
91 views

How to remove temporary layers so they don't show up in parameter lists

ArcGis 10.2, arcpy. I have several tools in a Python toolbox that have a feature class parameter. The parameter is defined as parameterType = “GPFeatureLayer”. When running several tools in ...
1
vote
2answers
63 views

arcpy 10.0 iterate through shapefile1 clip shapefile2 to shapefile1's polygons

I know that this question has been answered several times before, but for some reason I cant get this script to run...So I was hoping someone could point out where Im going wrong. I have 2 ...
0
votes
1answer
86 views

Unique Values in validation

How do I ensure the same selection is not made on param[2] and param[3] both of which are populated from the same field using tool validation? import arcpy class ToolValidator(object): """Class ...
0
votes
0answers
31 views

problem saving GRID to .img keeping original names (export by attributes)

I am really new in Python programming. I try to make a loop for Extract by Attributes tool in ArcGIS 10.1. I have a huge dataset of raster (760pc) and I want to extract a specific value. This part of ...
3
votes
1answer
93 views

How can I exclude a field on a table from being copied?

I have a query "layer": >>> r = arcpy.MakeQueryLayer_management(r'C:\path\to\connection\file\connection.sde', 'TEST', 'SELECT T.ID AS OBJECTID, T.* FROM MY_TABLE T WHERE T.SOME_COLUMN = 1', ...
1
vote
1answer
208 views

Using arcpy.da.InsertCursor to insert an entire row that is fetched from a search cursor?

This is a simple process using the legacy cursors, but I cannot figure out how to do it with the newer Insert Cursor from the Data Access module. I basically want to take the entire row from a Search ...
4
votes
1answer
147 views

Determining Shape Area Field Name

I'm dealing with a varierty of spatial polygon files (shapefiles, file/personal gdb feature classes, sde feature classes (some with spatial views)) and depending on the file type, I get a mulittude of ...
1
vote
1answer
117 views

How to create sequential field based on sorted data? (or extract pop-up data?)

I downloaded a kmz field and converted it to a GDB fc on arcmap. However, the field I need to label the layer by is stored in the pop-up html field... It looks like this: <html ...
3
votes
2answers
55 views

Using arcpy, is it possible to check if a thumbnail exists for a specified file?

I have written a very simple tool that builds thumbnails for every map document in a folder : root_fld stands for root folder and rec tells if search must be recursive. import arcpy import os import ...
0
votes
1answer
51 views

How to set parameter filters in ToolValidator?

I am populating parameter[2] using validation code provided by ESRI. How can I modify this code to repeat for parameter[3] what was done for parameter[2]? To elaborate...param[0] is a user supplied ...
0
votes
1answer
141 views

Why does arcpy.SelectLayerByLocation_management give ERROR 000368: Invalid input data?

When i trying to do Select by location i got : arcgis scripting. ExecuteError: Failed to execute. Parameters are not valid. ERROR 000368: Invalid input data. Failed to execute (SelectLayerByLocation) ...
-2
votes
2answers
813 views

How to avoid ImportError: No module named arcpy causing Failed to execute (Script) error?

I have a proplem with arc hydro in arcpy,i want to create a simple script where automated some tools from archydro in arcpy.. I use arcmap 10.1 and python 1.7,my import is one dem and my export is a 6 ...
1
vote
1answer
140 views

Convert decimal latitude/longitude bounding box to SRID 26910

I have a bounding box specified in decimal latitude/longitude, and need to convert this into a bounding box in the SRID 26910 coordinate system. I've never had to work with different GIS co-ordinate ...
4
votes
2answers
162 views

How to transfer attributes to thousands of local points from ArcSDE feature class with millions of polygons?

I have a set of points and a huge feature class with topographic information (OS MasterMap for who knows it). I'm talking millions of polygons huge. I want to transfer attributes of the polygons to ...
2
votes
1answer
59 views

Problem adding dates into an existing feature class from an excel spreadsheet [closed]

I've been trying to load data from an excel spreadsheet into existing feature classes, but I've been having some trouble with the dates. I've written a script that compares the values in the ...
0
votes
2answers
48 views

Arcpy GetRasterProperties returns odd results

I have this simple piece of python code to test whether a raster has integer values or not: res = arcpy.GetRasterProperties_management(ws, 'VALUETYPE') res = res.getOutput(0) ...
0
votes
1answer
63 views

How to identify a selected graphic element(s) in python

I have a situation where I am inserting items from Excel into maps a lot. When I insert the items it always makes them a fixed width and then adjusts height to maintain aspect ratio. What I would ...
0
votes
1answer
87 views

Counting how many times a point goes through a loop and write the count to a text

I have a several feature classes that go through a loop to calculate points. I want to add up how many go through it each time so I can archive that number. I'm using ArcGIS 10.1. Lets say I have ...
0
votes
0answers
23 views

Points Missing on Import of LongLat data to SHP using ESRI script CreateFeaturesFromTextFile()

In ArcMap 10.0 I am using a 9.1-era ESRI script in Python called CreateFeaturesFromTextFile. There appears to be no ArcMap 10 update. The input text format is the strict format ESRI point,X,Y layout ...
2
votes
1answer
109 views

How to calculate a field in using updatecursor?

I'm trying to simply add a string in front of a group of numbers from another field in a new field. The filed I'm using update cursor in is GIS_ID_PAM and I'm trying to bring over numbers from a ...
0
votes
1answer
39 views

Is there an equivalent to arcpy.ImportToolbox() in 9.3.1?

Is there an equivalent to arcpy.ImportToolbox() using ArcGIS 9.3.1? I'm assuming it would use arcgisscripting instead of arcpy but I can't find any documentation.
6
votes
1answer
137 views

Handle annotation layers with arcpy

I want to access annotation layers using arcpy (the purpose is to verify few text strings in text annotations). By annotation I mean draw tool annotations, not dynamic labels. These annotation layers ...
2
votes
1answer
26 views

Setting the output parameter in a toolbox to be a PDF

I need to allow a user to input a path and name where they would like to save their new map book PDF on their computer/drive. I have created a script where the user can input their mxd with data ...
0
votes
0answers
77 views

I could use some help with a bit of code optimization

See edit below. I posted here a couple weeks ago looking for some advice on the best way to iterate through data. You can find that post here. I have since done some tweaking to the code, and ...
0
votes
2answers
83 views

Python script to check node / edge coincidence

I have written a script with arcpy to test node and edge coincidence. Each edge (line) should have a node (point) at either end. If this is true, the script does not write anything. If there is node ...
0
votes
1answer
46 views

Using MakeFeatureLayer to select by location in arcpy

I'm trying to assign a state plane zone based on if a point intersects it. I make a feature layer from a feature class. It gets through the loop once and calculates everything correctly, but when it ...
0
votes
1answer
49 views

How to schedule a model to run at a certain time?

I'm trying to schedule a model to run at a certain time and have found this ESRI Blog post which is providing a good start. What I can't figure out though is where in the importToolbox function I tell ...
0
votes
1answer
61 views

automatic save outputs variables in the folder workspace using pyhon for arc map 10.1

I want to create python script with aim to import him in environment arcmap 10.1 and to make a hydrologic analysis because the scipt meybe can have many outputs raster file or feature class would ...
2
votes
1answer
73 views

Table analog of MakeQueryLayer

As of 10.1, arcpy provides the rather handy MakeQueryLayer function. This allows us to use arcpy to create query layers programmatically instead of having to go through MXDs (as was the case in 10.0). ...
2
votes
1answer
157 views

Using Arc 10.0 update cursor to replace <Null> value

I have been combing the help associated with (None) values in arc, and have not been able to solve the following problem: I have a a field with mixed Null and integer values: 0 100 I would like ...
0
votes
1answer
138 views

Polygon Neighbors Analysis script (ArcPy 10.1) producing erroneous results?

I'm struggling with a python script that is supposed to calculate a field for a polygon feature class. The calculation is of the average of a field value (P_TOT_DEV) for each of a given polygon's ...
0
votes
0answers
90 views

Using ArcPy, is there a way to change the color of a symbol in a UniqueValuesSymbology object?

I have an template mxd I reference with several pre-defined layers. The only variable I need to modify is the color of certain symbols in the layer. I have tried to modify and dig around the Symbology ...
0
votes
2answers
182 views

I get an ERROR 000622 when it checks for arcpy.DefineProjection_management

So the purpose of my code is to create a loop that copies shapefiles from a folder to my folder and change its projection 'GCS_WGS_1984'. Each shapefile starts with the year follow by the month and ...
1
vote
1answer
56 views

When using arcpy can I only calculate fields of a subtype and not the entire feature class?

I'm appending two sepearte shapefiles into one feature class with different subtypes. Is there a way to only calculate fields from a certain subtype?
0
votes
1answer
93 views

How can i use unicode characters in select by attribute?

I'm new to use python scripting for ArcGIS . I have unicode characters (arabic) in attribute table. I want to use these characteres in my script .when i use these characters in the script, the script ...
2
votes
0answers
37 views

Create custom raster pyramid using arcpy in ArcGIS 10.2

I have a arcpy script that runs the Point Density tool several times for the same extent, using the same number of neighborhood cells, but with cell size increasing at an multiple of 2 with each pass. ...
1
vote
2answers
78 views

Using Python to connect to Multiple SDE Database Connections

I am writing a script that accesses multiple sde Database connections. I have set the script to include accessing the environment workspace: import arcpy arcpy.GetParameterAsText(0) ...
1
vote
3answers
208 views

ArcPy Cursor iteration update

I'm trying to get the cursor to iterate through rows and fields looking for blank or null values and change them to 999999 but it's not changing anything. fc = ...
5
votes
1answer
158 views

Arcpy Pythonaddins Equivalent of arcpy.GetParameterAsText

I've build a neat little search arcpy script. The user opens any mxd, zooms to a location, chooses a corporate fGDB, and runs the tool. The user gets a list of all the populated feature class that ...
0
votes
0answers
39 views

Arcpy Closest Facility script not running correctly

I am running a script in ArcGIS 10.2 to automate the Make Closest Facility tool, as below, to identify the nearest chemist. This works fine. However, I then want to run it for another facility (a ...