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

learn more… | top users | synonyms (1)

2
votes
1answer
51 views

Exporting an ArcGIS model to a script, with a script?

I would like to automatically export ArcGIS models to python scripts (and graphics for the model diagram). In order to apply version control to ArcGIS Models my current workflow is to: a) build and ...
3
votes
1answer
42 views

Keeping the Highest Valued polygon

I have a single polygon feature class that contains large polygons which represent signal strength. Often times these polygons overlap. I dissolve to get multi-part polygons with a value range of 3 ...
2
votes
2answers
58 views

arcpy.Dissolve fails; need a arcpy dissolve to multipart workaround

I have a arcpy script in which I am using arcpy.Dissolve on a single feature class with multiple features to get a single multi-part feature in the output. The script is successful only part of the ...
2
votes
2answers
35 views

How to specify service publication parameters with arcpy?

I publish map services on a ArcGIS server using the typical arcpy script below. I need to better specify some service parameters. For example, the service should be available in WMS instead of KML, ...
2
votes
1answer
81 views

How to generate landmark-based route description using ArcPy?

I am now using ArcGIS 10.1 and currently a beginner in ArcPy. There is a project requiring to generate landmark-based route description. I am wondering how to use a buffer to find the landmarks in ...
-1
votes
1answer
41 views

arcpy calculate zero number instead of negative number

I want to develop a model using python.When i want to calulate negative numbers using the model,my script get zero number. Whats wrong in my script ? How can i solve the problem ? Thanks for advance ...
2
votes
2answers
36 views

Why is arcpy.StackProfile_3d -> arcpy.SaveGraph_management creating empty graph?

In a python script I'm trying to save a graph to a .png file with graph output from arcpy.StackProfile_3d but the .png file shows an empty graph. The table created from arcpy.StackProfile_3d shows ...
2
votes
2answers
51 views

raster standard deviation stretch python script

I am looking for ways of applying a permanent standard deviation stretch to rasters via python script. Are there any arcpy raster stretch functions? I was looking for a reference but could not find ...
1
vote
1answer
60 views

Using 'construct points' on all lines in a shapefile (arcpy)

I need to use the editing tool 'Construct Points' on several shapefiles that each have ~1300 polylines. I need to do this to create points every 1km along each of the polylines, which represent the ...
1
vote
0answers
24 views

Error in cliping raster with multifeature polygon shape with arcgis9.3 using python

I have raster and I have a multifeatured polygonshape file. I Need to Clip my raster Image. Python code was developed for arcgis 9.3. It was working before and suddenly it stoped working. my codes is: ...
0
votes
1answer
23 views

replace data source for all layers that point to shapefile

Hi I'm trying to do something quite simple but its not working. I want my python script to change all of the layers that point to the same datasource (a point shapefile) to another point shapefile. ...
2
votes
1answer
32 views

Find maximum and minimum value in a list of raster

I trying to write a standardisation script that standardises each raster dataset in a list of rasters by the highest and lowest values found in the list of rasters. The standardisation code is as ...
2
votes
1answer
61 views

Map algebra for loop

I have never coded in Python before and I am trying to loop a simple map algebra equation across 365 rasters. I am trying to calculate total water flow over cells but in the raster I have a negative ...
5
votes
2answers
88 views

Is there a way to refresh imported modules in a ArcGIS Python Toolbox?

When using a python toolbox (.pyt) in ArcMap, I'll typically follow a pattern where the .pyt file itself is simply a wrapper to collect input arguments and define the tools themselves. Supporting ...
1
vote
1answer
66 views

Arcpy Script tool

I'm creating a script tool and using the SelectLayerBy Attribute function (below), arcpy.SelectLayerByAttribute_management("cities_lyr", "NEW_SELECTION", '"CRIME_INDX" <= 0.02') However, I keep ...
1
vote
1answer
47 views

Python syntax error -can't figure out why? [closed]

This should be simple. I hope I don't get down votes! I just got the following code from an article about using Google Maps API and ArcGIS to calculate routes without network analysis and just can't ...
0
votes
1answer
16 views

whereClause syntax for Cost Distance parameter

I am looking to create a sql expression regarding point feature class and selection based on 'Name' field to pass to arcpy.sa.CostDistance() param[0]. similat to: savepath = env.workspace = ...
0
votes
0answers
39 views

How to extract raster using corresponding polygon using ArcPy?

I have to perform a simple raster extraction, but I can't find the way to do it. In a polygon layer, I have watersheds with their ID's. And in a folder, I have rasters, each one corresponding to a ...
1
vote
1answer
58 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 ...
-2
votes
0answers
26 views

the functions In python

I work with ArcGIS 10.1 and I want to create a python script and I don't know with what I will replace these functions in ArcGIS 10.1: gp.SingleOutputMapAlgebra_sa() gp.Divide_sa() ...
0
votes
1answer
44 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
42 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
47 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
90 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 ...
2
votes
3answers
270 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
60 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
26 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
57 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 ...
1
vote
2answers
58 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
41 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
68 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
19 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 ...
2
votes
1answer
51 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
50 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
118 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
80 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
39 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
35 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
71 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) ...
-1
votes
2answers
243 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
51 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
128 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
51 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
38 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
44 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
70 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
21 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
85 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
38 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.
7
votes
1answer
79 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 ...