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

learn more… | top users | synonyms (1)

0
votes
0answers
72 views

Model Run from Python script

Ive broken a complex task down to a very simple excersise and still cant get it to work.... I need to set up a Python Scpript to Run a Model. model: "SelectTest" toolbox: ...
3
votes
1answer
169 views

Using update cursor in a while loop to perform analysis on individual polygons gets stuck on first row

I am working through an open courseware project from PSU found at https://www.e-education.psu.edu/geog485/node/145 I am trying to use an update cursor in a while loop to perform an analysis on ...
3
votes
1answer
367 views

How to perform Tool Validation in Python Toolbox?

I'm trying to make sure there is no '-' in the output filename, and if there is, to set an error (circle with the red 'X') so that the tool can't be run, and have a tooltip that explains the issue. ...
0
votes
2answers
65 views

Trouble using saveACopy with group layers [closed]

This code works fine on layers in the TOC that are not group layers, but errrors out if there are any group layers in the TOC. import arcpy, re, os arcpy.env.overwriteOutput = True #loop through ...
5
votes
1answer
263 views

data driven pages format

I have an issue, but I don't even know the terms needed to search for an answer. I'm exporting the pages to png files. The pages are divided by lots. Each page has a label with the lot number. In ...
1
vote
1answer
259 views

Insert Vertex into Polyline based on Point layer using arcpy

This is essentially the same question asked here that was not answered... Using ArcGIS 10.1 Advanced I have a point layer with points that represent the intersection of a driveway with a street ...
1
vote
0answers
139 views

building a progress dialog with pythonaddins in ArcMap

As a component of my add-in, I compute a bunch of summary statistics when the user clicks a button. This can take a while to process and it can appear as though the program has stopped responding. I ...
0
votes
1answer
153 views

Manipulating distances in python. Problem with ShapeLength

I have a question more than a problem. I'm getting the distance of a line using python with arcpy.da.SearchCursor or FeatureClassToNumPyArray. The result I get is a double. Example: ...
0
votes
2answers
485 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 ...
3
votes
2answers
237 views

How to rename points by clockwise direction or change starting point in polygon features?

I have a polygon feature class. I convert it to a point. Name of field (for example !Number!) in a point feature converted from polygon "A2"(The first point should be in the upper left corner ...
1
vote
0answers
117 views

problem in using schema.ini to force ArcMap recognize field types

I have a folder of csv files (500+), and created a very long schema.ini file to force ArcMap recognize field types as I want. However, for some reason, ArcMap can read some CSV files properly; but ...
0
votes
2answers
98 views

How to save all layers in a MXD with arcpy

I'm using this code and it does not work. I simply want to save the layer after I repair the source/symbology/etc without manually clicking, save as layer file and overwriting the file. import arcpy ...
2
votes
2answers
115 views

Labels placement in ArcGIS

I need all labels to be placed outside of the boundary (polyline features). Most of the labels are placed outside the boundary line, while others (marked with red color) are placed inside the ...
1
vote
1answer
136 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
152 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 ...
2
votes
1answer
116 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
269 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
323 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
84 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
163 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
115 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
151 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
400 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
252 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 ...
5
votes
1answer
544 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
88 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
163 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
65 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
161 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
110 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
96 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
59 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
311 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
128 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
508 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
307 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 ...
5
votes
1answer
387 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
228 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
300 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
89 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
167 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
101 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
429 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
255 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 ...
3
votes
1answer
461 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
298 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
113 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
351 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
779 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 ...