Tagged Questions

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

learn more… | top users | synonyms (1)

1
vote
1answer
59 views

ExecuteError: Failed to execute. Parameters are not valid. ERROR 000732: Layer Name or Table View: Dataset L does not exist

Hi I am trying to create a loop so that each layer is produced in its own map. This is my code: import arcpy path = "C:\Users\Et\Documents\ArcGIS\Default.gdb" mxd=arcpy.mapping.MapDocument(path ...
1
vote
1answer
29 views

Wrong coordinates after Usage of NumPyArrayToRaster(…)

My Project I am currently working at should enable cellvalue manipulation on raster files using ArcPy. My Script works fine except I am not getting the right Y-Values (northing values) for the ...
3
votes
0answers
64 views

Select and copy attributes features in ArcMap using Python add-in tool?

I'm trying to add a tool to an add-in toolbar to select features from an existing feature class and copy attributes to another feature class,from point to point. TopoHeight_Field_Name='Comment' def ...
4
votes
1answer
58 views

SQL-query in arcpy - SELECT WHERE feature between two values

I need to select features between two values in python with arcpy. However, whenever I try to run the code below, it returns with error message "An invalid SQL statement was used". whereclause = ...
2
votes
0answers
84 views

Error with da.UpdateCursor and SDE feature classes

I am making my first attempt at editing an ArcSDE feature class with python through a da.UpdateCursor. I'm essentially taking code I've written for a file geodatabase feature class and applying it to ...
2
votes
1answer
37 views

Arcpy PointGeometry does not carry forward the ID

I used this as starting point I have the following code: Test data data = numpy.array([(0, 51.1047664, -114.3722785, 1205, ...
0
votes
1answer
70 views

How to list attributes in a field using Python?

I'm using ArcGis 10.2.2 and I'm creating a model in ModelBuilder. I want to know how I can list the attributes of a field and then make a selection for each unique attribute using Python. I have a ...
3
votes
1answer
122 views

ArcGIS 10. Convert dbf to csv or similar in ArcPy without cursors

I have many dbf's created by the Spatial Analyst Sample tool. I would like to convert those dbf's into csv's or space delimited (or any text for that matter). I can't seem to find the ArcPy equivalent ...
2
votes
1answer
67 views

How to use the tool “Polygon to Raster” with arcpy when the polygon is a row from a Shapefile?

I tried to iterate over the rows from a Shapefile with the search cursor. Every row is a polygon and I want to make a raster out of this polygon so I tried this with arcpy.PolygonToRaster_conversion. ...
2
votes
0answers
29 views

A list of layer names that you want to be turned off when Layers name are in Right to Left Such as persian

When I ran this code I got "UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal" error I don't know why I tried many way but I ...
1
vote
2answers
35 views

How to read page size from a MapDocument object

I hope this isn't a duplicate question, I have had a look but couldn't find an answer. I have a set of 30 MXD's with different page size. I would like to export maps with their name file which include ...
3
votes
1answer
32 views

Clearing data frame projection of current mxd using ArcPy?

I am required to open a bunch (50 per week) of mxd's and 'Clear' the Coordinate system from the data-frame to make sure my students have all of their data projected in the same (correct) Coordinate ...
1
vote
2answers
42 views

Specify a GDB feature class using Python Tkinter dialogue box

I tried to specify a feature class from a GDB dataset through Python Tkinter tkFileDialog.askopenfilename. Below is the script. It worked for me in the past when I was dealing with .txt or .las files. ...
0
votes
1answer
34 views

Error Applying Symbology to Shapefiles

I'm trying to apply symbology to my dataset after it is populated to the map display, but I am getting the following error. Have I placed the ApplySymbologyFromLayer code incorrectly? Traceback ...
0
votes
2answers
25 views

Con function loop doesn't calculate for all the fifty rasters in a list

I have been trying this for hours and I know it should be easy but I can't make it work yet. I have a list of 50 rasters that I need to change the NoData to "0" values. I have the right arcpy ...
1
vote
1answer
26 views

Add Layers to Map Display from script with default symbology

I have a script that runs IDW iterations and I'd like for the files to be automatically added to the map display after they are produced and contain the default symbology that ArcMap generates when ...
0
votes
1answer
45 views

Convert python from arcpy.da.SearchCursor to work in 10.0

I am using code such as for row in arcpy.da.SearchCursor(polyFC, ["SHAPE@"], spatial_reference=SR): # create inner buffer polyBuff = row[0].buffer(buffNum * -1) # create hull rectangle to ...
1
vote
0answers
57 views

Mosaic many rasters in ArcGIS is slow

I am trying to merge 166 tiles into a single world raster (500 meters resolution) through ArcGis "Mosaic to new raster" tool with a simple Python script. The process seems incredibly slow. Before ...
2
votes
1answer
34 views

Clip_Management seems to delete shapefile?

We have some python code that clips a very large shapefile for further processing. We can see the process create all the output files, but then just as the process is finishing, they get deleted. ...
4
votes
2answers
56 views

How to get arcpy to work with Anaconda?

I am trying to follow the step-by-step directions in the answer to "how to separate Python installation with ArcGIS" but cannot find the path file, DTBGGP64.pth, in ...
1
vote
0answers
46 views

Combining duplicate points while preserving their associated attributes

I'm working with building routes for a lit of technician's stops. In some cases, they have two "stops" at the same customer location -- turning on two types of service at a house, for example, is ...
0
votes
1answer
45 views

How to copy layers between MXD's with arcpy?

In ArcGIS I need to being able to have a couple of MXD documents open and copy-paste groups of layers from one MXD's table of contents to another with python script. Is this possible and, if so, how? ...
1
vote
0answers
28 views

Field mapping for append crashes python

I am trying to append multiple feature classes to a new one. As they come from different sources, the fields are all different, so I have to map the fields of the input feature classes to the fields ...
1
vote
1answer
37 views

Multivalue input from a chosen field gives patchy inputs strings

I made a small tool that can be run from a toolbox. It has a validation code to choose multiple values from a specified field from a specified feature layer. It looks quite ordinary: The validation ...
0
votes
2answers
72 views

Same python code works in arcgis python window, but fails in pyScripter

This code works in the arcgis python window but in PyScripter, this warning message had been written: Traceback (most recent call last): File "", line 16, in File "C:\Program Files ...
1
vote
1answer
44 views

Arcpy ListFeatureClasses in same workspace differs when run from ArcMap VS IDLE

This Works The following python script works when connecting to my dev ArcGIS server, from both the ArcMap python window and the IDLE python GUI/shell running on my dev workstation: import arcpy ...
0
votes
1answer
66 views

Copying XY to clipboard using Python Add-In (ArcMap)

I am trying to create a simple tool to copy XY from where i click the mouse button. What i have done already is: create add-in files using Python Add-In Wizard create toolbar and tool inside it in ...
2
votes
1answer
43 views

Trying to preserve attributes using SearchCursor

I am writing a python script for ArcGIS. I'm fairly new to this so I hope I'm not missing something very obvious. I am having trouble preserving the attributes of a polyline feature class when ...
3
votes
0answers
56 views

Most efficient way to intersect overlapping polylines

I have 4 multipart polyline shapefiles (download a sample dataset here). The geometries are identical, except for the length of segments in each shapefile. They represent 4 variables describing an ...
2
votes
1answer
48 views

Exporting results from Select By Location comparisons of each line in one shapefile with polygons in another?

I use ArcMap 10 and I am trying to export multiple selections (a.k.a 'Select by Location') from one file against another. I start by selecting the first line of shapefile A and I want to select all ...
4
votes
0answers
42 views

how to compare geometries (contains, within) in arcpy?

I am trying to use 2 geometry objects to check if a line is within a (rather complex) polygon. The geometry check always fails, even if the line is clearly within the polygon. I use the following ...
2
votes
1answer
31 views

Setting ArcPy environment variables with Python multiprocessing?

I have a script which uses ArcPy + Python multiprocessing. Are ArcPy environment variables shared between separate Python processes? If I write to arcpy.env.extent from within each process am I ...
1
vote
1answer
40 views

Change sde connection parameters with ArcPy

I know you can create a database connection with Arcpy using the CreateDatabaseConnection_management function. I am wondering if anyone knows a way in which to change the parameters of that file. ...
3
votes
3answers
79 views

Calculate field using variables as fields

When I calculate a field like this: field_0="field_name0" arcpy.CalculateField_management("Layer", field_0, '!field_name1! / !field_name2!', "PYTHON_9.3") It works! The field "field_name0" in the ...
0
votes
1answer
68 views

Painfully slow performance with Join and Calculate Field

I have a point layer and a table with approximately 100 fields. I need to join the table to the point layer based on a key field and create a new shapefile / feature class. This script has been ...
1
vote
1answer
49 views

How to add IDs of the links composing a polygon?

I built up a polygon layer from a road network for finding roundabouts using the compactness factor of a polygon. Then I have to intersect the extracted roundabout polygons with the road network so ...
2
votes
1answer
57 views

How to refresh display for newly added labels with ArcObjects

I've added a shapefile to an MXD and Edited the symbolization of it with ArcObjects. Now I'm trying to edit the labeling with ArcObjects. I've successfully been able to edit the default class in the ...
2
votes
0answers
51 views

Correcting addresses with Python or Model Builder

I am trying to make a script in Python (or Model Builder in ArcGIS) for correcting addresses. I have a point shapefile with the addresses (it has X and Y, and fields for "number", "street name", and ...
1
vote
1answer
41 views

Flip multiple vectors

I have thousands of vectors (out of several million) which I need to flip, for directionally purposes (Network Analyst). The vectors in question are annotated that their directionality has been ...
3
votes
1answer
118 views

How to convert polygon singleparts to multipart?

I am interested in converting a polygon featureclass created via Create Fishnet (Data Management) from singleparts to multipart. QGIS has a very handy tool called singleparts to multipart that does ...
0
votes
1answer
37 views

Sorting an UpdateCursor [duplicate]

I'm trying to sort a dataset by field StartTime (datatype date, indicates when a technician is supposed to start a visit). I am including a SQL where_clause to avoid an earlier problem when it ...
2
votes
0answers
65 views

Nested conditional statement in ArcGIS on multiple rasters

I have a list of rasters in ArcGIS and I want to create a conditional (Con) nested statement based on all the rasters of the list. I want this to be reiterate through many lists (the number of rasters ...
1
vote
0answers
28 views

Arcpy and pyqgis on same IDE

I have question: is it possible to set up arcpy and pyqgis on the same IDE (I use Pycharm). I have some problem with running my pyqgis scripts from pycharm. When I first configure Pycharm to recognize ...
1
vote
1answer
27 views

Multiply raster by Numpy derived float value

So I have a python script that uses numpy to calculate the mean of a field, then I try to use that mean value in a raster multiplication as follows: na = ...
2
votes
0answers
56 views

Developing workaround to arcpy.asShape truncating all values to 3 decimal points?

I've read a few questions\answers about converting a GeoJSON Shape into an ESRI Object. Unfortunately most of the answers pointed to decoding the dictionary's manually. Im a bit more lazy ^_^ The ...
0
votes
1answer
35 views

integrating arcpy with other packages [duplicate]

I have the windows installation of python 2.7 that came with arcgis 10.2. In my linux installation of python, I've become fond of other packages, and I'd like to incorporate them into the windows ...
1
vote
1answer
42 views

ArcMap Export PDF vs arcpy Export PDF scale differences

I'm experiencing differences from exporting features to PDF from within ArcMap and using a stand alone python program. Basically, I'm selecting a feature from a layer, zooming to the selected extent, ...
4
votes
3answers
79 views

Maximum number of shapefiles for merge tool?

I have over 180,000 shapefiles that I have to merge (or append) into a final shapefile. I have written a python script to do so which uses the acrpy.append_management tool. However the runtime is too ...
0
votes
1answer
51 views

Arcpy MakeFeatureLayer won't loop

The arcpy snippet below is intended to generate a list of technicians scheduled to work, and then generates a unique feature layer for each one's stops. fcStops = "TaskRoute1016" with ...
3
votes
1answer
41 views

PageLayoutObject error when exporting to a TIFF using arcpy and Python

I am having an issue when attempting to export to a TIFF in arcmap, using arcpy in Python. The full process I have scripted is as follows: Add rasters to a raster catalog panning to the raster data ...