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

learn more… | top users | synonyms (1)

1
vote
1answer
93 views

3D roof polygon creation from polylines in ARCGIS 10.1

I am Working in arcgis 10.1,I would like to create roof polygons from lines, the lines are captured with photogrammetry technique. As per my requirement I have found tool "3D Building Generator ...
1
vote
0answers
126 views

Why do I get different results running a script in PyWin and loading it to the Python shell in ArcGIS? [closed]

I've been trying to teach myself Python scripting for ArcGIS and have gotten frustrated on multiple occasions when I try to debug my script endlessly, only to later find out that it actually works ...
-1
votes
1answer
52 views

Help interpreting open text file [closed]

I have an existing Arcpy script written by others that I need help interpreting. The script reads records from a feature class and loops through and writes them to a log file. Here is the section I ...
2
votes
1answer
107 views

Arcpy.GetRasterProperties_management values do not match values found via ArcCatalog or ArcView

I am using Arcpy to extract the mean and standard deviation values of tiff Landsat satellite images and I get very high values. Values in the thousands rather than in the low hundreds! If I look at ...
5
votes
1answer
185 views

How to get the editor's current layer in ArcPy?

In ArcObjects, it is possible to retrieve the currently selected editable layer using IEditor3.CurrentTemplate.Layer, or IEditLayers.CurrentLayer. Is it possible to do the same thing in ArcPy? In ...
2
votes
2answers
256 views

Create python script to update field based on change in another field ArcGIS

I am trying to update a field "TPN" based on another field "PASS_NUM". In my script "TPN" is a newly added number field and thus blank, "PASS_NUM" is also a number field but it contains the wrong ...
3
votes
1answer
78 views

Python objects in my ArcMap addIn aren't instantiated

I've got a weird problem. My addin throws problems intermittently where it doesn't recognize buttons or tools when I try to toggle the visibility in my code. It seems as though the objects aren't ...
2
votes
1answer
118 views

In arcpy, if I subclass the arcpy Spatial Reference class, what is the object argument I would use in the subclass definition?

I want to do something like the following: class SubClassOfSpatialReference(arcpy_spatial_reference_object): def __init__(self, input_data): ... etc. Can I even do this? If so, what exactly ...
0
votes
0answers
97 views

Arcpy Closest Facility Layer unable to retrieve CFRoutes table

I am using the following code: import arcpy, os, sys from arcpy import env arcpy.env.workspace = "C:\\Users\\Ant\\Documents\\ArcGIS\\ITN.gdb" ...
1
vote
1answer
96 views

How to add Table View to Data Frame using ArcPy in ArcMap 10.0?

How does one add a table to the current map in ArcMap 10.0? 10.1 has the function arcpy.mapping.AddTableView, but this function does not exist in earlier versions. Must the table be made into a layer ...
2
votes
2answers
298 views

Measure area of a polygon in specific units using ArcPy

I am trying to find the area of a particular polygon (OriginalPolygon, below), and I can do that... But, I'd like it in acres regardless of the original units of the polygon.(Data is coming into this ...
4
votes
2answers
177 views

How to get XY coordinates and field values for each row in a SearchCursor?

I am trying to enumerate each row of a points shape file and get a certain field's value (elevation) and the xy coordinates. But I see I can only use: arcpy.SearchCursor to get the field; OR ...
4
votes
1answer
380 views

How to automatically generate useful scales for data driven pages in ArcGIS desktop

I have been tasked with creating several hundred maps of properties that intersect a long pipeline. The maps will zoom to the part of the property which shows the intersection. The lengths of ...
2
votes
1answer
68 views

Why is arcpy.mapping.ExportToPDF losing layer symbology?

When exporting a map it does not export the symbology within the data frame. I am using the code snippet below. >>> myMap = arcpy.mapping.MapDocument("C:/USERS/NISUSER/DESKTOP/mxd_map.mxd") ...
2
votes
2answers
148 views

Why use “ from arcpy.sa import * ”

Previously on the following post: How to get an extent for Raster using python A user edited the original Python script by adding the following code: from arcpy.sa import * Why did he do this and ...
0
votes
1answer
64 views

Apply lyr file to Arcpy

I am new to ArcPy, and don't know how to assign different layers to the same lyr file. The layers have "pol" in common. Replacement is a single layer, and so must be walked through the entire ...
0
votes
1answer
136 views

How to read shapefile of road segments into Python data structure to get begin and end point coordinates? [duplicate]

How can I take a shape file that has road segments and read it into a data structure in python that I can use to get begin and end points with? For example x, y to x2, y2. It's not a large shape ...
1
vote
0answers
21 views

Fix broken SDE layers with Arcpy - unexpected error [duplicate]

We are in the middle of our ArcGIS 9.3 to 10.1 migration project and we have a lot of custom map documents (from different users) that among others, point to our current 9.3 SDE database. After our ...
2
votes
1answer
94 views

Why does arcpy.ListFields list GUID field as SmallInteger?

I want to get a list of all GUID fields in a feature class, but it seems that arcpy.ListFields is listing my GUID field as a SmallInteger. What am I doing wrong? global_id_fieldnames = [f.name for f ...
1
vote
0answers
78 views

Is it possible to get field type information from FieldInfo object in ArcPy?

I'm looking at the FieldInfo object documentation for ArcGIS 10.2 and am not seeing access for field type (e.g. short, string, double). Is it possible to get field type information from the ...
3
votes
1answer
55 views

Can I access the Error Log in arcpy?

Can the error log created by validate topology be assessed through arcpy? I can validate the following topology - arcpy.ValidateTopology_management(r"C:\WorkSpace\CWD.gdb\FD\FD_Topology") Can I ...
2
votes
0answers
228 views

How To Export Selected Data Driven Pages to PDF?

I have a map book with data driven pages that shows the fire boundaries, roads, etc for our fire rescue department. I want to automate the process of creating individual mini map books for each fire ...
1
vote
1answer
107 views

Consuming Forecast.io Radar Data in an API or ArcMap

I want to consume forecast.io's radar data as an ArcGIS Server REST or JSON to use in an API or ESRI's ArcMap GIS Software. MapBox is doing it here. I don't think forecast.io is currently making the ...
3
votes
2answers
397 views

Why does ArcPy Excel To Table give AttributeError: 'module' object has no attribute? [closed]

I'm trying to import an excel workbook using arcpy. ExcelToTable, but I get the following traceback: ERROR updateParameters Execution Error: Runtime error Traceback (most recent call last): File ...
1
vote
1answer
221 views

How to convert shapefile to KML file using ArcPy? [duplicate]

Python script that checks to see if a specific layer file exists in the current workspace and, if it does, converts the layer file to a KML file. Does it work with a shapefile? Code so far: for file ...
4
votes
1answer
217 views

How to check if feature class or table contains field with specific name before adding it?

Im trying to write a script that finds out if the shapefile has a specific field and if not to add the field. I get it to show me the field, but the loop goes through each field, so it would create a ...
3
votes
2answers
185 views

How to change the style of the north arrow from “ESRI North 4” to “ESRI North 1”?

I have a Python assignment where I have to write a script to change the style of the north arrow from “ESRI North 4” to “ESRI North 1”. I wrote the following code: import arcpy mxd = ...
0
votes
1answer
220 views

ArcGIS ModelBuilder pass arcpy.SetParameterAsText as input to next tool

I am trying to build a model which uses two simple scripts, Script A and Script B. I want to use arcpy.SetParameterAsText to set an output in script A, which is then used as an input in script B. In ...
3
votes
1answer
78 views

Any case when one must use older ArcPy cursors (not da module based)?

I was using the arcpy.da cursors in ArcGIS 10.2 to iterate for quite some time now yet didn't use "classic" cursors that became available in 10.0 a single time. Is there any situation where one would ...
0
votes
1answer
135 views

How to compute geometric intersection using ArcPy?

I want to take geometric intersection of line and polygon shapefile. ArcPy has a tool: arcpy.Identity_analysis but it is available with "ArcGIS for Desktop Advanced" and I have "ArcGIS for Desktop ...
0
votes
1answer
91 views

How to format SQL expressions for ArcPy with ArcSDE for PostgreSQL feature class?

I'm trying to use SelectLayerByAttribute to find the last point added to a FC. I figured I could use the objectid field because it's serial. I wrote the following: ...
3
votes
3answers
386 views

How to create button that calculates acres on selected polygon features?

I'm looking to create a simple button that calculates acres on selected polygons and can't quite find what I'm looking for. I read through this thread: automating a python script..., but found it ...
1
vote
2answers
194 views

Get and compare area of arcpy geometry from extent object

I'm trying to get a numerical value for the area of a polygon that I am generating from an extent object. In this case, I am using the "onRectangle" function in the python addins for arcpy. The ...
2
votes
1answer
298 views

layer.visible command not working in arcpy.mapping module

I am using the arcpy.mapping module for the first time, and the lyr.visible command is not working as it should (or I am not using it as I should). I have a list that contains the the layer names of ...
2
votes
2answers
232 views

Find index location of a lat/lon point on a raster grid in ArcPy

This question has been confusing me for a while, and I'd love y'all's help. I'm trying to find the index location on a raster (in terms of column and row#) of a specified lat/lon point. My first ...
2
votes
2answers
101 views

How to define workspace as input for GP tool in order to select from list CAD layers as the second input?

How to define workspace (folder) as input for gp tool in order to select CAD layers as the second input that will be obtained from the first input?
1
vote
0answers
248 views

Why does CON statement give ERROR 010240: Could not save raster dataset to (value) with output format GRID?

I am receiving the following error when trying to run the following code: import arcpy from arcpy import env from arcpy.sa import * arcpy.CheckOutExtension = "Spatial" env.workspace = ...
2
votes
1answer
503 views

ArcPy findAndReplaceWorkspacePath not working with Raster Datasets

Situation: I am working on creating a Python script that will replace workspace paths for every layer in a map document in order to fix broken layers after a data migration. The script works except ...
-1
votes
1answer
168 views

What does [missing] on ArcGIS 10.2 for Desktop Python addin mean? [duplicate]

I need to load all layer names into a combo box. I did the same using esri site. But the tool is showing [missing].
1
vote
1answer
136 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
476 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
46 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
421 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
110 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
222 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
182 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
451 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
38 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
56 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
0answers
56 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 = ...