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

learn more… | top users | synonyms (1)

1
vote
1answer
200 views

“dataset does not exist or is not supported” using large GRID raster

I am trying my hand at arcpy for the first time to create a conditional raster from a set of threshold values. I have 3 large GRID format rasters (mos_zb3, mos_zb4, pca_finb2) I am trying to feed into ...
7
votes
3answers
667 views

How to Receive an Email after a script has run?

I'm working my way through my first attempt at scheduled tasks with modelbuilder and python. So far I have: Created a model that reconciles our SDE versions and then compresses the database. ...
0
votes
1answer
58 views

Creature individual Feature Classes from Features in a Feature Class

I have a feature class called Tracks2012. In the feature class I have 4 fields (MMSI, Ship_Type, Vessel_Name, IMO) as well as the usual Object_ID, Shape and Shape_Length field (as these features are ...
4
votes
1answer
745 views

Managing symbology in Feature Classes

I'm using an enterprise db to store my data and I'm writing a python tool that allows me to interact with that data in ArcMap. However, all my layers someone have "OTHER" for the symbologyType (not ...
2
votes
1answer
146 views

Invalid SQL Error when using InsertCursor on table created using CreateTable

I am trying to write a list of items to a new table in Arc. When I attempt to add a new row to an Arc table, I get the following error: Runtime error Traceback (most recent call last): File ...
2
votes
2answers
314 views

Calling variables within ArcPy functions

I have a defined function (ex. def my_function(x,y)). def my_function(x,y): """algorithm""" my_variable = my_function(filex, filey) How can I call this variable within the code block section of ...
2
votes
1answer
217 views

How to Buffer based on SQL expression?

Is there any way to optimize this code? It creates two buffer feature classes based on two different fields in the shapefile attribute table import arcpy from arcpy import env ## Set Workspace ...
2
votes
2answers
678 views

ArcGIS 10.2 Geoprocessing Service based on Python Fails with IOError: “SDE” does not exist Failed to execute

I have a Python Script that inserts X,Y Point in the SDE Point Feature Class. It works fine when executed in ArcMap 10.2, but it fails with IOError when published as Geoprocessing Task service in ...
1
vote
1answer
46 views

How can I avoid creating a new cursor object repeatedly while counting features in a large SDE Database?

I would like to get a script running much faster than it is now. The script completes on my machine in about 33 minutes. It generates a report that counts features with specific attributes in one ...
1
vote
0answers
83 views

How can I output an arbitrary number of file urls from a Synchronous Geoprocessing Service?

Scenario: Custom Export Service. The service creates zip files with shps in them and return the url to the file. I understand if you intend to to run this in synchronous mode, you must have a tool ...
1
vote
1answer
74 views

Weird Error when setting the source path in the “PICTURE_ELEMENT”

I am trying to set the sourceImage to a tiff file using this code: m=1 pic = arcpy.mapping.ListLayoutElements(mxd,"PICTURE_ELEMENT" , str(m))[0] pic.sourceImage = ...
2
votes
1answer
386 views

Python getting area of multipart features with SearchCursor()

I am tasked with programatically getting the area of each individual part of a multi-part feature. I have a script already to read each individual part and print its XY coordinates and it works fine ...
0
votes
1answer
57 views

populating one field value based on another field value

I have a feature class in a personal geodatabase with 2 fields. They both have domains set up to ease the editing process for my users. If my WaterType field is set as "Not Irrigated" (or code 4) then ...
3
votes
3answers
278 views

How does one replace characters in a layer name using Python (“_” with “ ”)? [closed]

I can rename layers easily enough, but I really need to replace any "_" with a " ". This code just renames layers, but I would like to do a find and replace on each layer name mxd = ...
1
vote
2answers
268 views

Reducing number of decimal places after X/Y coordinates in a FC

I'm using arcpy.AddXY_management to add coordinates, and I want to reduce each X/Y field by x number. I've tried to reduce it by string slicing and that obviously didn't work. I also tried setting the ...
2
votes
0answers
44 views

Near Analysis takes much longer in ArcPy? [duplicate]

I have a feature class of about 12 points, a feature class of hundreds of roads, and need to find the nearest road to each point. So the obvious solution (Near tool) takes about 20 seconds, and the ...
2
votes
1answer
82 views

Python scripting for making rings from the city center

Problem description: I have two layers: 1) [Polygon] city blocks, and 2) [Point] the city center. The City blocks layer has 110,681 records. And The city center layer has just one record because ...
2
votes
1answer
159 views

Embedded python script module import issue

I have two ArcGIS python scripts. One is a primary python script that calls a number of functions from a second python script. Everything works well, i.e. primary tool calls and uses functions from a ...
4
votes
2answers
496 views

Automating a Python expression to calculate acres

I'm not new to GIS but very, very new to using Python and using scripts. I successfully use a Python expression !shape.area@acres! to update a field with acres in a feature class. What my users ...
1
vote
0answers
58 views

iisnode with ArcPy

I am calling the child_process in Node to trigger a python script which is importing ArcPy. This works fine until I start sending requests through IIS. Python runs, but importing ArcPy fails. I have ...
6
votes
4answers
521 views

accessing the output of a python script tool dialog ArcGIS 10.1

Hi I have a a fairly simple script tool dialog which has been setup to get 6 parameters from the user and return them as the tool output as a list. the aims is that the out put would then be used ...
2
votes
0answers
83 views

ArcGIS License question: Any restrictions on calling arcpy from non-esri web service?

I recently saw some success calling a python geoprocessing script from Node.js. I was also thinking of using flask instead of an arcgis server geoprocessing service. Does anybody know if there are ...
1
vote
1answer
253 views

Set visible/ratio for make feature layer based on a list

So, I have a feature class with three integer fields. I need to create a feature layer based on this feature class to use it later for running some GP tools where the values of the integer fields will ...
1
vote
1answer
204 views

Cursor Update Python Script for Multiplying Several Fields against a Ratio (Real) in ArcGis

Disclaimer: Python Neophyte, Uber-reliant on GUI, working to wean... I have a Python script for replacing multiple Field values with another table value that was graciously provided by the inimitable ...
4
votes
1answer
398 views

copy feature class and retain selected fields with arcpy

I've got a featureclass (fc) that I want to copy, but only retaining a selected number of fields, let's say field 9, 11, and 12 from the total of 15 fields. I want to use arcpy and suspect that ...
3
votes
2answers
199 views

How to work with OGR and GDAL in GP Service in ArcGIS for Server 10.1

I have got a lot troubles with GDAL and OGR in the context of ArcGIS Server on 64 bit server machine. I can run script that use GDAL in ArcGIS as Tool and in the debug mode in PyScripter, then ...
3
votes
2answers
245 views

arcpy.SearchCursor loops one time but then does not repeat

The part of the script I'm having trouble with is the arcpy.SearchCursor. The cursor runs 1x and then does not re-run. The goal was to re-retrieve the field value and apply it to the image layout. It ...
3
votes
1answer
798 views

set values in feature class attribute table to null

I've created a point-data featureclass (fc) containing data from a simple .txt file using Arcpy as follows: arcpy.CreateFeatureclass_management(out_path= outPath, out_name= 'fcTest', geometry_type= ...
3
votes
2answers
201 views

How to publish GP Service with importing of numpy in ArcGIS for Server 10.1?

I use a lot of scripts as GP Service almost all use the arcpy functions but one (and very important) of my scripts needs a gdal/ogr and numpy imports. I can run this script in PyScripter or as a tool ...
4
votes
1answer
135 views

How to modify script published as GPService in ArcGIS Server?

In ArcGIS 10.1 before publishing script as a new GPService I have to run it in ArcMap. It is a good solution when I handle small amount of data. When I want to change something in my script I have to ...
1
vote
1answer
143 views

How to recode and recalculate Field Values using ArcPy?

I am trying to figure out how to do several calculations through python and the arcpy set. I have an large dataset (7+ million records of individuals), and I am trying to code a value of 1 that ...
2
votes
2answers
185 views

How to select parcels in ArcPy situated in a different county than is written in the attribute table?

I have two polygon feature classes: one with parcels, the other one with counties (40 counties) I have to identify the parcels that in the attribute table belong to county 'X', but spatially they ...
1
vote
0answers
241 views

arcpy symbology colors changing on RefreshActiveView()

I have a problem that I'm not sure is functionality not built into arcpy or I'm just doing something wrong. I'm using arcpy.mapping.UpdateLayer() to apply symbology to a layer, but afterwards some ...
3
votes
1answer
103 views

How do I use variables inside a arcpy toolbox function? [closed]

I have a point file and I need to make a lot of buffers in specific increments but I can't figure out how to interate through a list inside the buffer function. Here is what I have: import arcpy ...
2
votes
1answer
37 views

Filtering out Annotaion Feature Classes using arcpy.da.Walk()?

Is there a way to use: for dirpath, dirnames, filenames in arcpy.da.Walk(): to filter out annotation feature classes? The help doesn't specify them as a type, which is strange because using the ...
2
votes
0answers
50 views

Arcpy - deleted my entire workspace? [closed]

I've got a script which runs through some GPS data and creates several outputs (tables, shapefiles etc.). However, when I've just run it, the folder where all the input data lies (along with most of ...
2
votes
1answer
44 views

How to determine if a raster has rowattributes?

I have a raster file which is the result of extract by mask geoprocessing tool. If it has no rows then I take it as no overlap between input raster and shapefile. Following is the way I am reading it ...
2
votes
1answer
179 views

ArcGIS 10.2 Copy Rows error

I'm very confused by this one. I have run a polygon neighbors analysis in ArcGIS 10.2 and appended some data from another table to help me whittle down the neighbors list before my next action. So I ...
2
votes
2answers
71 views

How do I skip rows with searchcursor based on an interger value

For example, if I have 100 records, and I want to sample 10% of the records. How do I tell the search cursor in arc10 to read the value of the 9th record, or every 10. I tried to do row[0 + count] and ...
0
votes
1answer
109 views

Prefixing graduated color labels using Python?

I have a series of (many) layers in an ArcGIS 10.1 map that are all symbolized using graduated colors. Each layer has the same number of breaks; however, the break values are different for each layer. ...
2
votes
1answer
1k views

How to use ArcPy to copy selected features to an existing feature class?

Is there a way to copy a selected feature into an existing feature class? Sort of like append would do, but only the selected features. I want to iterate through a table and select features with a ...
1
vote
1answer
299 views

issues with updating data source, script runs but nothing happens, arcpy

I have seen many questions posted that are similar to mine but still havent found the answer so figured I would post my script. I want to change all the data sources found in all mxds in a location to ...
2
votes
1answer
278 views

How to run OGR in ArcGIS Scripts?

When I run my script outside ArcGIS it works because during execution script uses a GDAL and OGR modules from osgeo. When I use script as a tool in ArcGIS it does not work. In PySripter I can import ...
2
votes
3answers
98 views

How to write FIDs of points within each polygon to polygon field?

I have two feature classes one with points one with polygons (in ArcGis 10.2). Now, I want to write into a String Field of the polygon layer a list of all the Point-FIDs that are within each polygon ...
2
votes
3answers
376 views

ArcPy nested loop problem

I have a question connected with ArcPy. I was trying to make a nested loop with 2 cursors - 1st with 2 elements and 2nd with 5 elements. The statement should return 10 connections, e.g. 1-1, 1-2, ... ...
1
vote
1answer
282 views

How to set up parameters in Python toolbox tools?

I build a model builder and export it to python. How can I define parameters for python script in python properties? May you explain about Data type in script proprties? thanks alot
2
votes
0answers
234 views

Finding coordinates from a nested grid as a numpy array

So this is a pretty basic question, but I'm trying to figure it out. I've written a script that allows a user to read in a raster and provide a cell resolution, and outputs the amount of cells ...
3
votes
0answers
295 views

Move shapefile from one folder to another using python [closed]

I'm working with shapefiles and using the ArcPy library. My script is creating a new shapefile based on a join and I want to know how to move the newly joined-shapefile from the environment location ...
3
votes
1answer
219 views

IO Performance of ArcPy in virtual machine

The following script just copies a file into RAM, performs some simple operations and writes the result back to hard disc: import arcpy import random import time arcpy.management.Delete("in_memory") ...
1
vote
1answer
133 views

trouble deleting data in an fgdb using python

I am trying to use delete_management to delete files in a gdb based on whether or not they are in a list. I keep getting an error with the delete_management tool that says the file either does not ...