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

learn more… | top users | synonyms (1)

2
votes
1answer
329 views

Search cursor stops selecting after two iterations

I have a script which selects an extent from a grid and exports the data frame. import os, arcpy mxd = arcpy.mapping.MapDocument('CURRENT') df = arcpy.mapping.ListDataFrames(mxd,"Layers")[0] ...
5
votes
2answers
996 views

How to create Network Dataset for Network Assistant using ArcPy?

Is it possible to create a network dataset with ArcPy to be used with the network assistant? In the documentation I found the Build Network and Dissolve Network functions, but it looks like both ...
4
votes
1answer
880 views

Using matplotlib to create and export graphs automatically from ArcMap

I am going to start a project soon where, after the data has been processed in various ways, an output jpg showing a graph of the data should be produced. The workflow is as follows: 1. A feature ...
1
vote
2answers
935 views

Can anyone recommend an Arcpy GUI? [duplicate]

Can anyone recommend a GUI for arcpy? So if I want to run my script as an exe with some blank text boxes(or text boxes with default entries), radio buttons, check boxes etc.
1
vote
0answers
315 views

Problems running zonal statistics - not all zones represented

I have been working on a Python script to automate the steps illustrated by whuber here:Create points around the edge of viewshed results I am trying to create a horizon graph illustrating the ...
1
vote
1answer
250 views

How to add layer in Arcscene using script tool

import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd, "*")[0] addLayer = arcpy.mapping.Layer(r"F:\project\Final\Ground floor\steps.lyr") ...
2
votes
1answer
1k views

How to write point geometries with arcpy instead of gp syntax?

Can someone help me fix some code that simply writes points into a featureclass? It used to work in the older gp. syntax, but I'm having difficulties rewriting it in arcpy for ArcGIS 10.0. In this ...
5
votes
1answer
5k views

How to Export Selected Feature to New Shapefile Using ArcPy?

I currently have a search cursor iterating through a shapefile in ArcGIS 10.1 that selects a feature and runs a viewshed analysis on that feature (and only that feature). What's the easiest way to ...
1
vote
2answers
1k views

How to Add Shapefile with Symbology from Layer File to ArcMap MXD using ArcPy/Python?

Say I have a Shapefile: C:\DATA\points.shp A layer file: C:\SYMBOLOGY\symbology.lyr And a map document: C:\MAPS\map.mxd How can I add points.shp to map.mxd with the properties of symbology.lyr ...
3
votes
1answer
659 views

Why is my simple arcpy script failing? (sets raster cell value to null if below threshold value, ArcGIS 10.1)

As mentioned in the title, simple script to set null cell values below three standard deviations beyond the mean: import arcpy, sys, os #Accept input and output raster inRas = sys.argv[1] outRas = ...
3
votes
3answers
710 views

Help with Python and adding a grouplayer to Arc, renaming it from a folder name, then adding layers to it from that folder

I am trying to use os.walk to go through a directory tree, pull out all the .shp files in it, create a grouplayer in the mxd, rename the grouplayer the folder name, then add the layers from that ...
3
votes
2answers
2k views

How to save currently opened mxd and changes using ArcPy and Python?

Here is what I have so far... import arcpy import arcpy.mapping as map mxd = map.MapDocument() mxd.save() And yes I know that map.MapDocument requires an argument, but I want it to automatically ...
1
vote
0answers
306 views

How to embed a PDF into an Excel spreadsheet? [closed]

This is what I want to do: Create report using a polygon feature class to output areas of polygons using some logic and the ExportReport() function (This I have accomplished) Create a PDF of the ...
2
votes
2answers
254 views

How can I set the settings of an Address Locator within a Model or arcpy?

I am creating a model that processes a large road dataset, then creates an address locator from the roads. The Create Address Locator tool does not allow me to set options like Spelling Sensitivity or ...
1
vote
2answers
202 views

How to get an attribute of the selected feature and pass it into a URL?

As a total Novice with Python, I thought 2 weeks would be enough time to learn how to build some tools for our GIS... I was wrong and I'm running up on a deadline. I am attempting to get a value ...
1
vote
0answers
327 views

arcpy & TraceGeometricNetwork return ERROR 000584

I am developing a script to automate the creation of a road network following varying criteria. I have created a geometric network and I would like to get the connection between several points with ...
1
vote
1answer
121 views

How to Average neighboring county data and store in original?

I have data for several rain stations, i have averaged the data and given each county a value. Some counties have null values and I would like to pull the data from the all the bordering counties and ...
-3
votes
2answers
974 views

What does Runtime error : 'NoneType' object has no attribute '<field_name>' mean?

Here is my code #arcpy import arcpy,sys from arcpy import env env=r"C:\Users\Jaya\Desktop\python_practice" totalRec=arcpy.GetCount_management("river") rows=arcpy.SearchCursor("river") ...
1
vote
2answers
2k views

How to list Feature Classes of Multiple geodatabase in Multiple Folder?

I'm new in python scripting and try to list polyline feature classes of multiple Geodatabases. The Geodatabases are in many nested folders.For example in folder "A" I have 20 folders and in each ...
1
vote
2answers
2k views

What might cause invalid syntax from ArcPy with Raster Calculator and Multiple Rasters?

I am having trouble for writing script in Python (ArcGIS 10.1). The task is generally divide each raster by 100. I have many of these raster files.... So what I've done is the following: from ...
0
votes
1answer
306 views

Rendering layer in ArcMap using ArcObjects and Python?

I succesfully wrote a script to render a Uniquevaluerenderer in a layer in ArcMAP using symbols from 4 parameters (values) read from the attribute table of the layer. I used ArcObjects and VBA, but ...
1
vote
2answers
458 views

How to Append to rather than overwrite single table using ArcPy?

The code thus far works to create multiple output files, but I'd like to set it up so that the data is all exported onto a single table across multiple rows. The issue is I believe with the part in ...
1
vote
0answers
243 views

ArcGIS opposite to pivot table

fellow GIS-ers :)! I've been trying to find a tool to do the opposite to what the "pivot table" tool does but I dont thin there is any tools for that. I have a raster data set derived from Landsat ...
3
votes
2answers
933 views

Csv to Shp conversion? [duplicate]

I am working on a really big script right now where I have a csv file that I have removed rows and columns from, and edited the headers. I need to create one big shapefile for the entire csv file then ...
1
vote
1answer
231 views

arcpy: can I use SelectLayerByAttribute to compare fields from joined tables?

I can't figure out the syntax to select table records where one field's value exceeds that of another. The fields are from a pair of table views connected w/AddJoin(). One view is of a fgdb table and ...
1
vote
1answer
665 views

Make Table View with field_info Output

I am using Make Table View to copy data from one table to a table view object and in the process hide and/or rename some fields. When I output the data to a dbf it hides and/or renames the fields ...
2
votes
1answer
238 views

Clipping buffers to census tracts

I have donut buffers generated to protect anonymity of household locations. They need to be clipped so that they are only inside the census tract that the original point was in. The code takes about 8 ...
3
votes
1answer
544 views

Arcpy: Troubleshooting parameter error for Export Report

I'm running into what I believe is a parameter error in writing an arcpy exporttoreport script. I've written several successful scripts of this same type, but the difference is that this one has a ...
0
votes
1answer
111 views

Error: Exception Raised on the “for row in rows” command line?

I am comparing fields in layers. I have the AADT layer and AADTAnno layer and I want it to search the fields FLAG and TFLAG. For Example: If there is a 29C9 in AADT layer in FLAG fields then there ...
6
votes
1answer
270 views

How much database bloat is reasonable?

I use personal geodatabases to hold all the data for my projects (probably around 10-20 feature classes across 2-4 datasets on average). I use the personal gdb because I like being able to hook into ...
4
votes
2answers
522 views

Does ArcPy leak memory when importing CSV files?

I'm trying to import a great number of csv files of about 250MB each. I wrote a python script for that as follows: import gc import glob tables = ...
3
votes
2answers
749 views

How to efficiently check for feature overlaps with Arcpy?

In an effort to reduce processing time, I am looking for ways to pre-process data within my script. I have ~18,000 featureclasses with ~500 features each (all simple circle polygons) from which I want ...
1
vote
0answers
62 views

Are polygons created in Arcpy built in any order?

My script uses a search cursor to evaluate polyline coordinates and build polygons based on those coordinates. The script works well, but I am curious as to whether anyone knows the order (if there ...
4
votes
1answer
458 views

Switching between background 64 bit processing and 32 (so I can use 3rd party ie XTools)

I often run scripts now with 64 bit background processing enabled but when I want to use certain tools like Xtools table to text I have to turn it off as these tools are 32 bit. Is there a way to ...
5
votes
2answers
261 views

Cancel event in Python Gp tools with arcpy

In GP-tools written in C# (ArcObjects) we can listen for the Cancel-event and react on that. I wonder if there is anything similar in Python GP-tools applying arcpy. I googled that issue and the only ...
7
votes
1answer
277 views

Reduce processing time in Erase function using Arcpy in IDLE

I am processing 18,000 feature classes (saved in a file GDB), each with ~500 records (polygon features) in ocean areas, and I am running a script to remove area overlapping with the coast, using the ...
8
votes
2answers
2k views

How to access Esri ArcPy modules from Enthought Canopy?

I have ArcGIS 10.1 running on my windows system and I have also installed the new 32-bit Canopy Express Enthought Python Distribution. Is it possible to load and use the Esri ArcPy modules from ...
2
votes
2answers
160 views

Trying to use an integer in a WHERE clause

I'm trying to use an integer value in a WHERE clause (looking at an integer field). expression = "'SERVICE' = 'Service' " expression = expression + 'AND ' expression = expression + "'GPS_TIME_TOTAL' ...
1
vote
1answer
780 views

arcpy.mapping Graduated Colors Symbology

I'm trying to figure out how to apply graduated color symbology to a feature class by using arcpy.mapping in ArcMap 10.1. To start, a script runs and a feature class is added to a map document, no ...
1
vote
1answer
250 views

ArcPy: DDP Error in exporting only occurs with “SELECTED”

I'm trying to use DDP (Data Driven Pages) and am running into a problem. I'm using arcpy.SelectLayerByAttribute_management to select a series of records, and then trying to use the ...
2
votes
2answers
682 views

Why does ArcMap crash if I try this Join Field (which ArcPy does not like either)?

I'm a little uncertain whether this question belongs here or on http://gis.stackexchange.com Have an "AddJoin" that results in no shared records, which is not what I'm expecting. Is it because I'm ...
0
votes
1answer
232 views

How to use wildcard when appending PDFs using ArcPy?

I'm working on a script that (as written) produces a large number of individual pdf pages (>100), instead of hardcoding the names of each of the outputs, I was thinking of using a wildcard. However, ...
2
votes
1answer
330 views

Why do no Labels appear on .pdf output from ArcPy when turned on in Layout?

Do labels needed to be coded into an arcpy script in order to be visible on an arcpy .pdf output? In ArcGIS the labels are visible for various features, but when I use the arcpy script (either in IDLE ...
6
votes
1answer
487 views

ModelBuilder: How to extract data by date, export to separate tables and interpolate tables to rasters

I've been using ArcGIS for a couple years, but when it comes to model builder I've only worked with very simple models. I'm hoping someone that is much smarter than myself can help me in building a ...
3
votes
2answers
612 views

What causes RuntimeError: ERROR 010240 saving after CellStatistics?

I am having trouble saving outputs from CellStatistics but only when I run it on a list of rasters. This was working on python 26 but not 27. I know this example is nonsense, but: env.workspace = ...
4
votes
1answer
1k views

Select by attribute expression invalid in python

I'm not sure how my expression is failing. Any ideas? inPoints = "points.shp" i = 0 arcpy.MakeFeatureLayer_management(inPoints, "pts") arcpy.SelectLayerByAttribute_management("pts", "NEW_SELECTION", ...
1
vote
1answer
426 views

Does Identify tool of ArcGIS for Desktop have Python script behind it?

Can anyone let me know the Python script for "Identify" tool in arcmap10. I need to create a customized script tool for that and add in a toolbar.. Pls help...
2
votes
1answer
1k views

How to Export to PDF after zooming to extent of each feature that meets SQL where clause?

I realize that I've asked two similar questions recently, but following suggestions in the comment chain, I'll make this a separate question (separate as it is not the no output problem in ArcPy: ...
3
votes
2answers
191 views

Is it possible to have tool parameters appear only if clause met?

I'm writing an arcpy script for a tool that has a large number of parameters (around 10). About half of these are "dependent" (perhaps not in the technical sense of the term), as in [first ...
3
votes
1answer
314 views

Calculate Field using Esri Python Addin

I am trying to select a polygon then it must automatically change (calculate) the status to "C". The tool seems to work in the background but nothing actually happens (the status is not updated). I ...