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

learn more… | top users | synonyms (1)

4
votes
1answer
337 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
168 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
215 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
643 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
187 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
116 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
133 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
168 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
199 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
98 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
35 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
49 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
150 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
67 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
103 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
234 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
228 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
93 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
314 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
249 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
204 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
259 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
198 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
127 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 ...
4
votes
2answers
351 views

Checking current user privileges for an SDE dataset with Python/arcpy

I am managing data distribution via an ArcSDE Oracle gdb to a number of users (schemas?), each of which can only have read only access to datasets they have requested access to, and have then been ...
3
votes
1answer
191 views

Selecting raster values at random locations in a raster in python/arcgis

I have a large dataset of integer rasters, and was hoping to find a way to generate a "random" selection of pixels for four of the rasters, while making sure all 5 classes, which I've specified based ...
1
vote
0answers
137 views

Composite bands produces a single band image

Running this produces a single band tif and not a three band image. Has anyone seen this before or can suggest ways to trouble shoot it? Input_Rasters = path + parentdir + "/" + dir + "/" + ...
1
vote
2answers
217 views

How to use ArcPy to iterate through each grid cell and make it the current extent?

I have a topology that covers a big area. I cannot validate all at once 'cause I get errors. So I've created a grid that covers the area. Through a script runned from my .mxd I intend to: 1. itterate ...
6
votes
2answers
274 views

How to replace a cyrillic symbol in an attribute table using python?

I've tried searching for an answer and I've already seen some similar themes here, but I still haven't been successful in replacing Cyrillic symbols in an attribute table, which is why I'm asking for ...
5
votes
2answers
190 views

How to check if Waste-Water Manhole connect to lines with the right flow direction?

I have a waste-water geometric network with flow direction throw digitize direction. I want to check if each manhole have a line flowing in and a line flowing out. Is there an attribute of line vertex ...
0
votes
1answer
166 views

ArcPy Mark ALL duplicated values

I'm sorry if this is too similar to other posts but I'm an arcpy newbie and I can't quite get what I need. I have accomplished this task in the field calculator (thanks to another post here, but I ...
6
votes
2answers
2k views

Getting XY map coordinates on mouse clicks as input variables into a python script

This is my first time coding in python, so bear with me. I wrote a script to calculate an analytical solution to find the orientation of a plane based on three points. I'm using ArcGIS 10.1. # Input ...
1
vote
0answers
59 views

Obtain virtual output directory path in geoprocessing service

I am publishing a geoprocessing service and I want to be able to access the virtual output directory path configured for the service. Now I know that gp services will magically return virtual paths ...
2
votes
0answers
127 views

python.multiprocessing and “FATAL ERROR (INFADI) MISSING DIRECTORY”

I have a question which is closely related to this old question here: python.multiprocessing and "FATAL ERROR (INFADI) MISSING DIRECTORY" I have also looked at this, which seems to relate ...
0
votes
1answer
95 views

make a selection by attributes of the fourth part of a range of numbers with arcpy

I am using Arcmap 10.1 and I need to create a script (for use on shapefiles) where I have a input field named "sequence" which is numerical data. I need to select the fourth part of a range of ...
2
votes
2answers
249 views

How to add values in X column to dictionary or list using ArcPy?

My apologies if this question has been asked before. I've spent some time searching for a similar question with no results. Is it possible to add each value under X column to a list using ArcPy? I ...
1
vote
0answers
38 views

How to find out which layer had a Selection made on it? [duplicate]

If the user makes a select using arcpy.SelectByAttribute() or arcpy.SelectByLocation() how do you find out which layer they made the select so you can use arcpy.SearchCursor(layer)?
0
votes
1answer
91 views

Is there an event handler for a Selection being made using ArcPy?

I want to be able to capture an arcpy.SelectByAttribute() or arcpy.SelectByLocation() event being triggered. There doesn't seem to be an extension that is able to handle this. Is there a way to do ...
1
vote
1answer
715 views

How to turn off layers in ArcMap via arcpy?

I'm working on a script in ArcMap 10.1 that takes a screenshot and I need to know how to extinguish (turn off) a layer in my table of contents.
1
vote
2answers
205 views

How do I execute a script in the arcpy window?

I've been writing python in my text editor so I have a python script, script.py. I'm still developing it so don't want to put it in my toolbox yet, and at the moment this means copying and pasting it ...
1
vote
0answers
299 views

Arcpy Spatial Join Running Extremely Slow [closed]

I have a simple arcpy script that runs a series of spatial joins. However, the script is running extremely slow: one set of joins takes over 12 hours. There are a few for loops, but I have timed these ...
0
votes
0answers
26 views

ImportError: No module named arcpy - ArcGIS 10.1 and Python 2.7 [duplicate]

Traceback (most recent call last): File "C:\Python27\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 326, in RunScript exec codeObject in __main__.__dict_ File ...
1
vote
2answers
471 views

Field Filter and Value Pick List for an Arcpy Toolbox ValueTable Parameter

In an ArcGIS Python Toolbox (pyt file), how do I specify a filter for a Value Table parameter? In my value table I have two columns. The first is a a field name derived from a selected table view and ...
0
votes
1answer
60 views

Is the loop in this python code breaking because of duplicate values in the column?

This code is meant take a shapefile in the current mxd, loop through all of the values in a collumn of said shapefile. For each value it will create a definition query, zoom to features then save a ...
1
vote
1answer
266 views

How to zoom to layer with page definition query set in arcpy?

I have data driven pages enabled on a mxd, with a page definition query set on one of the layers to only show features that match the current index feature. This layer looks like this: After ...
0
votes
1answer
128 views

Error with save path. Does not exist or is not supported

The final save raster file errors without message with Does not exist or is not support. But it does exist. If you can find anything wrong with this script I would be very greatfull. I had a vast ...
2
votes
1answer
519 views

How to use GROUP BY with arcpy.da.SearchCursor in file geodatabase?

fc = "C:\Users\AuxS3-4\Documents\ArcGIS/Default.gdb\Malla" fields = ('OBJECTID','Sentido','Carriles','idMalla') sqlclause=(None, "GROUP BY Sentido") cursor = arcpy.da.SearchCursor(fc, ...
1
vote
2answers
310 views

How do you get all the results from a Selection made by Attribute or Location using ArcPy?

Using arcpy I'm trying to get the results of a selection, or what is currently selected as a list. Basically I'm attempting to build an addin which on click will either perform an operation where I ...