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

learn more… | top users | synonyms (1)

3
votes
1answer
395 views

After ArcGIS 10.2.1 update, Arcpy 64 bit import Error

I've updated my ArcGIS desktop version from 10.2 to 10.2.1 and have noticed that when I run the 64 bit version of IDLE I now get an error when trying to import arcpy: Python 2.7.3 (default, Apr 10 ...
0
votes
1answer
66 views

How do I check spatial reference on all parameters during Tool Validation?

How do I check spatial reference on all parameters during Tool Validation? Just looking for recommendations. Here is what I have already. This must work with existing validation. import arcpy class ...
0
votes
1answer
61 views

ArcPy - Add Layer from Cursor Selection

I am trying to add layers from the fields of a reference layer using select by location and a cursor. Also, want to prompt the user with a message box asking if they want to add the selected by ...
6
votes
1answer
224 views

Is it possible to interrupt Select Layer By Location when first feature selected?

I´ve got a point feature class with some 7.000.000 points and I´m trying to check if any of these points is simply intersected by several polygon feature classes using 'for' loop and ...
1
vote
0answers
37 views

Why does clip only return the top polygon?

I'm running the command below on a data set with many stacked polygons. This is a county standard so I can't change the way they manage their data. Each type of polygon can be uniquely identified ...
1
vote
2answers
87 views

Change field map properties in ArcMap

I am trying to import csv files in ArcGIS to do a join. However, some of the fields are identified as double, some as long and some as long. Therefore the join results in bunch of columns with NULL ...
3
votes
1answer
60 views

Why is Mosaic or Mosaic To New Image causing a 1-pixel gap between adjacent images?

I have a series of adjacent PNG images, and I'm trying to merge/mosaic them into a single seamless image. The images have clean "cuts" between them, with no overlaps. However, when I use either the ...
0
votes
0answers
25 views

arcApplySymbologyFromLayer w/out adding to map

Is there a way to apply symbology from layer without adding to map. I have heard there an environment setting that may allow this? I am trying to both apply symbology and add layer at position in a ...
4
votes
4answers
495 views

How to convert all values in all fields of table to upper case using ArcPy & Python?

Does anyone know how to use the .upper() in a stand alone python script so it can be used to change all characters in a table into UPPER case? I don't want to use the field calculator since I have ...
0
votes
0answers
27 views

Min value (OD Cost Matrix)

I have an attribute table with columns that I have gained from running an OD Cost Matrix. In one column named "Total Minutes" I will select the lowest value (the shortest route). Then I will create a ...
0
votes
1answer
90 views

arcpy absolute file path failing with AddLayer()

I have the following code: import arcpy.mapping as mapping mxd = mapping.MapDocument("current") print mxd.title df = mapping.ListDataFrames(mxd)[0] print df.name layer = ...
1
vote
0answers
75 views

How can a script tool share (dynamic) variables among different modules?

I'm running a python script from the toolbox window (as a script tool). I have a second python (tkinter) module that I use as an input interface. Now, I know that the script tool can call the ...
2
votes
0answers
50 views

Is there a way to position parameters in a Python script tool dialog box?

I admit I haven't searched for an answer yet. I was wondering if there's a way to get these boolean parameters to be next to each other instead of one on top of the other?
1
vote
1answer
106 views

Transfer domain descriptions from coded values to string text at a new field

Further to my earlier question,I'm trying to develop a script that eventually should contain three parameters, feature layer, domain field and a new text field. How can i write a loop that will update ...
0
votes
2answers
103 views

How to return the first row of feature class as a list in ArcPy?

I need to return the first record of a feature class as a list. Is this possible? I can't seem to figure it out using row.getValue() as it does not allow me to put a wildcard in there.
3
votes
0answers
68 views

Basic arcpy script with cursors running SLOW!

I've got 2 polygons layers (no gaps): IDUs and crops. What I want is to identify the 3 largest crops by % area for each IDU. This seems common enough but I couldn't find a way to do it all using ...
0
votes
2answers
115 views

How to add data to a newly created folder using arcpy?

I'm writing a script to create a new folder and then copy a feature class to a shapefile and add the shapefile in the new folder. The folder gets created but the script is failing on the feature class ...
0
votes
2answers
111 views

Find the minimum elevation pixels from an elevation raster using arcpy

I want to create a python script to find the minimum elevation pixels from an elevation raster (aster,srtm) using arcpy and arcmap 10.1. The purpose is to reclassify these pixels. I have tried but I ...
1
vote
0answers
67 views

How to Build Query Table from two OLE DB tables using ArcPy?

When I run the following code to create a subset of a table, the error says "An invalid SQL statement was used" [Query]. The error shows in line 39. Is there any idea you can figure this out? import ...
1
vote
2answers
127 views

How to get/set label scale ranges (e.g. minScale) in ArcPy?

For a layer object lyr, one can programmatically set the minScale in arcpy as such: lyr.minScale = 150000 For a label, one can manually set the scale range within a dialog in ArcMap. In arcpy, is ...
-1
votes
4answers
183 views

Issue with UpdateCursor and if/else statement

I have been working on this code for awhile and I can't make it work the way I need it to. The code is suppose to move a feature according to a set distance from types in a designated field. As the ...
0
votes
0answers
51 views

Error building pyramids/statistics on raster with arcpy

I am building a script to process rasters with the option of adding the extra step of building pyramids and statistics at the end. For some reason, it will not recognize inputs as legitimate raster ...
0
votes
1answer
119 views

arcpy.ListDatasets() returns emtpy list

I'm having trouble getting the ListDatasets (or any of the list functions) to return anything but an empty list when pointed at our SDE geodatabase, but the same code works for a file geodatabase. I ...
1
vote
0answers
63 views

using arcpy to query sde database in python

I have three variables: view_name, column_name, and column_content. column_name contains id, name, address, etc. column_content contains 123, John, 200 King st, etc. user specifies the column_name ...
2
votes
2answers
89 views

Update raster value to reflect total number of points within cell- python

I have what should be a fairly simple task, but I can't seem to figure out how to do it. I have to do it in python/arcpy/gdal/whatever because I'm trying to automate this process for a hundred or so ...
3
votes
1answer
51 views

How to obtain the width and height of an image using arcpy

This Stack Overflow question shows how to obtain the pixel dimensions of an image using Python. Is it possible to find an image's height and width using arcpy and ArcGIS? arcpy.Describe would seem ...
0
votes
0answers
26 views

How to intersect widget using script python arcpy and geoprocessing service? [closed]

Is it possible to develop an intersection widget with geoprocessing service using script python arcpy? I try to do that with ModelBuilder but after publishing, in geoprocessing service i don't find ...
1
vote
2answers
372 views

Import CSV column into existing feature using arcpy

My goal is to take a CSV that contains 50 rows and one column and import the data into a feature class with over 3,000 rows using arcpy. I want to pick a random row from the CSV and then iterate ...
0
votes
2answers
99 views

Intersecting Polygons

I have 10 shape files containing polygon features. I would like to produce a single polygon layer containing portions of the input polygons where no fewer than two of the aforementioned feature ...
3
votes
1answer
147 views

Multithreading in Arcpy

I am learning multithreading and thinking about using it with Arcpy. The example I am working on doesn't have much practical reasons. However, I don't know why it fails on the line ...
3
votes
1answer
418 views

Arcpy Update Cursor (arcpy.da.UpdateCursor()) not saving changes to 'SHAPE@LENGTH'

Looked around and found other Cursor questions, but nothing dealing with updating 'SHAPE@LENGTH'. I am running ArcGIS 10.2.1 and have a multipoint shapefile that I am grouping into polygons based on a ...
6
votes
1answer
406 views

Are there any distinct advantages of creating a Python Toolbox over a Custom Toolbox?

I enjoy making different geoprocessing tools to practice Python and to become more familiar with the arcpy modules. I've just been using a Custom Toolbox and then importing the Python script and ...
2
votes
1answer
57 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
56 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
108 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
329 views

How to specify map service parameters when publishing 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
116 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
48 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
114 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
105 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 ...
2
votes
1answer
143 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
63 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
71 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
99 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
95 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 ...
7
votes
2answers
285 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
74 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
133 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
21 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
67 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 ...