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

learn more… | top users | synonyms (1)

4
votes
1answer
95 views

Convert linear polygons to lines

Hi I have some long linear polygons that I'd rather store as lines but I'm not sure how best to do this. Ideally I'd have a line goiung through the centre of the polygon lenthways. I have two ideas of ...
2
votes
2answers
132 views

How to check if vertex exists (on polyline) based on location of point layer using ArcPy?

Using ArcGIS for Desktop Advanced 10.1 (with all extensions) I am building a centerline network that will be used by a MapObjects program to do routing based on "turns at any vertex" (as opposed to ...
4
votes
1answer
64 views

Programatically detect the format/version of an arc toolbox (e.g. 10.0,10.1 etc)

Is there a way to tell programatically (from the command line) what format a given ArcMap toolbox was saved in - 10.0, 10.1 and so on?
2
votes
1answer
74 views

Mystery duplicate values

I'm using a unique list to populate up to 10 fields for a fc with correct geometry, in an "overloading" manner as you would in excel. I noticed on my first run through I had an "index out of range" ...
1
vote
1answer
57 views

Field's name with numbers: why not?

I have tried to create field in TOC called with numbers with python. But, it has a problem: it couldn't do it because name's of fields are numbers. It is strange for me. When I do new field in shape ...
-1
votes
1answer
35 views

Error after code completion

Why arcpy throwing an error after completed code execution ? import os import arcpy import xlrd arcpy.env.overwriteOutput = True inWS = r'C:\Excel' excelDirectoryName = inWS arcpy.env.workspace = ...
2
votes
1answer
212 views

How can I put the name of file in add field with python?

In my script, I have to create field in 15 layers. The name that I wold like to set in this new field is the same of the file's name. But all attempts that I did were worng. My script: ...
3
votes
1answer
671 views

arcpy - Calculate field in a joined table

I've to calculate a field based on another field in a joined table, but an error occurs: "Parameters are not valid. ERROR 000728: Field !Table_A.field_A! does not exist within table" My code: ...
0
votes
2answers
350 views

How to List Tables from current map document (mxd)?

We have many maps containing Feature Classes and Tables in a Personal Geodatabase that need their information updated. Is there a function to List Tables from the current map document like mxd = ...
0
votes
0answers
103 views

Lock file on shapefile persisting with arcpy.ImportMetadata_conversion

I've got a script that does a number of things to two shapefiles, and it appears that the metadata import step is creating a lock file on only one of the shapefiles that persists even after del arcpy. ...
3
votes
2answers
470 views

Why does import arcview/arceditor give gp.setProduct() RuntimeError: ERROR 999999: Error executing?

I am developing a script that will be used in ArcGIS Desktop 10.2 of Standard (formerly called ArcEditor) license level and thus importing arceditor to make sure I don't use GP tools that require ...
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
172 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
371 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
264 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
140 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
492 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
238 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
99 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
271 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
326 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
164 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
153 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
403 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
254 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
550 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
164 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
112 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
98 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
313 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
511 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
309 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
388 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
231 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 = ...