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

learn more… | top users | synonyms (1)

0
votes
3answers
71 views

Batch Re-projection script syntax error

import arcpy sourceWorkspace = "C:\\Users\\tx8p90\\Desktop\\Lesson2" targetProjection = "C:\\Users\\tx8p90\\Desktop\\python excercise data\\Lesson1\\contourlines.shp" listDataSet = ...
0
votes
2answers
77 views

User interaction with Python tool midway through script running? [duplicate]

I need to design a Python script that will take a CSV input, search for a matching polygon in our SDE data for each line, and then extract certain information about data that intersects with the ...
0
votes
1answer
69 views

What is expression for finding perimeter in ArcPy and Field Calculator?

What is the correct format for finding perimeter as an expression for arcpy. I was able to use expression !shape.Area! to find the area of my polygon. However when I use the expression ...
0
votes
1answer
77 views

Hiding selected features in ArcGIS for Desktop using ArcPy or ModelBuilder?

I'm using data driven pages to create a series of maps of point features. Some of my features overlap spatially and I only want to show some of them on each map. Once I select the features which I ...
0
votes
2answers
54 views

Check layer data type in gdb

I have path to layer or feature C:\base.gdb\test How to check is table or feature class by arcpy?
0
votes
1answer
205 views

How to write output from subprocess to disk (using multiprocessing)

This code was developed from another question I posted about how to kill an arcpy tool if it takes longer than a specified time. See How to cancel tool execution in python. Using the multiprocssing ...
0
votes
2answers
391 views

Export Raster Data to TIFF, BMP, or PNG File Using Python

I am writing a Python script to export a Raster Dataset to a TIFF, BMP, or PNG file, as I would manually by right-clicking on the layer, choosing Data | Export Data, and then make my choices in the ...
0
votes
1answer
194 views

Summing column values in table using arcgisscripting?

I need to create a python script that sums a column's values in a table. Thereafter, the script is supposed to get the percentage of each individual row in that column and populate this percentage ...
0
votes
1answer
96 views

Using os.walk to update broken links and save mxd

I've got code to walk through an entire directory and sub-directories repair broken links in each mxd and save the mxd. It works for the mxd's in the top directory but fails when trying to enter any ...
0
votes
1answer
75 views

Obtaining the coordinates of point through arcpy

I have a feature selected from a feature class based on user input through arcpy. How can I obtain the x,y coordinate of the selected point feature class (Points). How do I do this?: ...
0
votes
2answers
116 views

Python script to check node / edge coincidence

I have written a script with arcpy to test node and edge coincidence. Each edge (line) should have a node (point) at either end. If this is true, the script does not write anything. If there is node ...
0
votes
2answers
255 views

How to use Field Value from arcpy.GetParameterAsText()?

I want to to is have a user select a feature class, which then populates the fields that can be selected (this works), create a new field in that feature (works), and then populate the new field with ...
0
votes
1answer
71 views

How to programatically create point and use it in Select by Location query?

I have a section grid for a US state. I also have a quarter/quarter section grid which splits the section grid into 16 equal squares. I have written a Python script that finds the XY coordinates of ...
0
votes
2answers
714 views

How can I reclassify an integer raster to a float raster?

I have been using various arcGIS tools to try and do this. Unfortunately, the reclassify tool in arcmap can only output integers. A cool workaround that I found is using the raster calculator in ...
0
votes
1answer
312 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
0
votes
2answers
265 views

“ERROR 000840 | The value is not a Relationship Class”

I'm stumped here. I've seen this error in other posts but not quite in the same context. I'm trying to run the arcpy.management.CreateRelationshipClass() tool in ArcGIS 10.0. Absolutely everything ...
0
votes
1answer
454 views

Dissolving shapefile python script not working, syntax help please

I do not understand why this simple script won't work. I can get it to dissolve in model builder but not from a script that I run from inside the map document. My output results are 4 polygons, just ...
0
votes
2answers
268 views

How to create a route and add that route as layer to map using ArcPy?

I wrote a little script for ArcGis, and when I make it run by GUI it happens that it seems to create routes but the routes do not appear in the TOC. Consequently, when the script tries to execute ...
0
votes
1answer
1k views

ArcGIS/arcpy: Input of in-memory geometry object to Dissolve tool in arcpy script throws Error 000732, input doesn't exist or is not supported

In an arcpy script, I run a Union on a list of geometry objects. The output is set to an empty geometry object. The Union runs fine. What I am trying to do is then feed that output into the ...
0
votes
4answers
408 views

Resolving Arcpy “GetObject not point” Error

I'm new to Python (v 2.6.5) and am trying to write an ArcMap (10) script that reads the vertex coordinates of a polygon shapefile which includes a small hole (doughnut polygon). I've been working ...
0
votes
2answers
23 views

Trying to delete identical values within an update cursor

I'm trying to use the DeleteIdentical_management tool within an update cursor. I'm pretty sure I'm going about this the wrong way, I'd like to see if someone could help. I'm relatively new to python, ...
0
votes
1answer
27 views

Saving Feature Class Symbology into a Layer or Object to apply to another Feature Class

I am creating a tool to automate a data standardization process. Part of this process is saving the feature class (variable "filename") as a layer file, projecting it into another coordinate system ...
0
votes
1answer
75 views

Cannot convert string to int using ArcPy Calculate Field

When I load a csv file to join with ArcPy, it converts all string fields that are numeric to integers. Therefore, I have to add another field within the feature class that I'm using for joining that ...
0
votes
1answer
46 views

Passing ModelBuilder parameter to update cursor gives ERROR 999999?

I have two point layers. I trust the geometry (read: x and y coordinates) from one of them, but not the attributes data. I trust the attribute data but not the geometry from the other one (the ...
0
votes
1answer
42 views

ArcGIS Spatial Analyst in arcpy - FATAL ERROR (INFDEF) DIRECTORY FULL

I have been running into this error in several geoprocessing scripts I've written lately. When I call a spatial analyst function I return this error: FATAL ERROR (INFDEF) DIRECTORY FULL import ...
0
votes
1answer
33 views

GetParameterAsText(arcpy) does not work

I am new in this area. I was practicing the function GetParameterAsText(). I know that when you run the code (for example in PythonWin) it works like the function raw_input(), therefore it should ...
0
votes
1answer
41 views

For Loop Batch Copy Raster TIFF to BMP in ArcMap

I need to convert TIFFs to BMPs using CopyRaster from ascii to raster output TIFFs. I am not sure how to define the "outRaster" so that it will convert the rasters to BMP. I'm guessing that the line ...
0
votes
1answer
37 views

Cloning a transactional version in ArcGIS

In ArcGIS documentation, I cannot find any references to cloning a transactional version. Is there a built in method for it? I think I know how to do it manually in Arcpy, basically creating a new ...
0
votes
1answer
69 views

AssertionError: Invalid MXD filename from arcpy.mapping.MapDocument()?

I'm trying to write a script that allows me to list the layers of each map document in a folder. However I keep getting this error after it displays the layers in the first map document: Traceback ...
0
votes
1answer
53 views

Search layer in MXDs

I work on arcview 10.3 and i try to find layer called "ways" in several mxds. i try this code but it does not work. anyone know how to do it?: import arcpy,os,sys,string import arcpy.mapping from ...
0
votes
1answer
44 views

Ignoring group layers when iterating through layers

I have this nice code that goes through each dataframe in the current MXD, and through each layer in the dataframe, and generates a list containing the name of the dataframe, the name of the layer, ...
0
votes
1answer
42 views

Creating a spatial reference in arcpy from projection name

I am using ArcGIS 10.2.2, Python 2.7. I want to create a spatial reference from the name of a projection, e.g. NAD_1983_BC_Environment_Albers, using the arcpy tool ...
0
votes
1answer
55 views

Loop stops before expected without error message

I try to run a script that clips all the feature class of a geodatabase by the successive features of a clip layer (named pochoir). Thank to support here and here, the test of the intersection is ...
0
votes
1answer
51 views

arcpy insert cursor problem - adding multiple polygons

I am reading rows from a database with a field "Coords" that contains polygon coordinates in the format 40.090170,-83.007704|40.089878,-83.007724..... and inserting each row as a polygon. The first ...
0
votes
1answer
57 views

Trapping error messages with arcpy.getmessage issue

I am trying to capture an error with arcpy.getmessage(2) within a try/except statement but when it fails it tells me the issue is with the getmessage, it is not returning the error that occurred in ...
0
votes
1answer
43 views

add feature class by a Checkbox python

sorry for the changes but this is the overview of my problem I'm using 10.2.2 arcgis I have a geodatabase that every day enter new feature class I want to create a tool that lists all the feature ...
0
votes
1answer
39 views

Add checkbox python tool

I'm using 10.2.2 arcgis I have the following script import arcpy mxd = arcpy.mapping.MapDocument ("CURRENT") df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0] addLayer = ...
0
votes
1answer
93 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 ...
0
votes
1answer
59 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? ...
0
votes
1answer
96 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 ...
0
votes
1answer
580 views

'List indices must be integers not tuple' Error

I'm using an insert cursor to write rows to a destination feature class where the input Shapefile field names do not match the destination FC names. To accomplish this, I'm trying to use the indices ...
0
votes
1answer
82 views

Using insert and search cursors on same feature class to clone row?

I'm using the code below in order to attempt to clone a row in a feature class and add that same row to the same feature class after updating its metadata (Name, date_start, date_end, etc.) The ...
0
votes
2answers
326 views

How to copy attribute table values from one feature class to another

I am looking for a way to copy attribute values from one attribute table to another. I am mainly looking to do this using python, so would prefer a way to do this with a tool or a a stand-alone python ...
0
votes
2answers
79 views

How to handle list variable in a where clause

I am calling a list of names in from a text file and would like to use each of those to make new layers. I am running into an issue where I get "TypeError: cannot concatenate 'str' and 'list' objects" ...
0
votes
3answers
149 views

UpdateCursor 'is not defined' Python

I have several files (shapefiles). Table 1 has only one row with several fields whereas Table 2 has several rows. What I want is to take a value from Table 1 and populate all rows in Table 2. I used a ...
0
votes
2answers
67 views

Select and export by attribute iteration

I'm trying to do a loop for select and export layers by attribute and name them based on the field value. I've written the script below and it creates the shapefiles which picks up field values as ...
0
votes
1answer
132 views

How to programatically modify the placement properties for labels

Does anyone know how to modify the location of a label programatically? I'd like to make the labels sit directly below the symbol!
0
votes
3answers
279 views

Using ArcPy and Python to export Table View as PDF format?

I am using ArcPy to select from a layer and display the result on map as a table view. Now I want to export the table view as a PDF format. Anybody know about it? If it is beyond ArcPy to export ...
0
votes
2answers
210 views

I need an arcPy script for choosing objects from a table at random

I am trying to write an ArcPy script that will select X number of rows from a table with N number of objects in it, then output that selection to a new layer or shapefile. I need to be able to ...
0
votes
1answer
84 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 ...