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

learn more… | top users | synonyms (1)

1
vote
1answer
62 views

Extract area of polygons inside larger polygon and sum their values to a new column

I have two landcover classifications (as shapefiles) created using eCognition. "Level0 (FID)" consist of larger polygons and "Level1 (FID, ClassName, Area_Pxl)" of smaller polygons within these. I ...
2
votes
2answers
172 views

How do I count occurrences of unique field values?

I have a feature class with a field which contains values 1, 2 and 3. I need to write code that reports the total count for each value: 1: 29 features 2: 52 features 3: 57 features ...
1
vote
0answers
20 views

Changing Area Output - PUMAS

I currently have shapefile of US PUMAS and another feature shape file (call it feature X). I am using arcpy to project both of these files to the following projection coordinate system (using ...
3
votes
2answers
287 views

How to calculate a value based on another field under arcpy.da.UpdateCursor and cursor.updateRow?

I am trying to do a calculations under arcpy.da.UpdateCursor. I want to calculate the values for the records that have FIPS=06037. I want to take the values from "kg" column and populate the new value ...
1
vote
1answer
130 views

Limit of Python Add-in for Arcmap?

I am running ArcGIS 10.2.2 Version 10.2.2.3552, using ArcMap. I've watched the tutorial here (http://training.esri.com/Courses/ts_PythonAdd-Ins/player.cfm?) and I'm still not understanding this. I ...
1
vote
1answer
78 views

how to find that two polygon boundaries are connected?

I am working on a Geo database where there is a layer with many polygons. i want to find that which polygons boundaries are connected so that i can create new layer from that polygons and which ...
3
votes
3answers
171 views

Creating polygon from 2 txt files (Parent ID + Coordinates)

Here is what I am trying to do: I want to create polygons based on two separate text files: the first one (as parents) lists the Polygon ID (ID_el) and three to four Points ID (IDpt1, IDpt2, IDpt3..) ...
0
votes
1answer
35 views

add-in works at once only

There is a sample in ArcGIS 10.1 help on creating a add-in using python. This works only once when a layer is selected in combobox, if i need to use this functionality again it does not work and i ...
1
vote
0answers
89 views

arcpy, CalculateField: 'geoprocessing sys.stdout object' object has no attribute 'flush'

Working with 10.2.2, 64bit geoprocessing arcpy installation. Getting this error from arcpy.CalculateField_management() command. From Spyder IDE in an ipython console, I get the error: [IPKernelApp] ...
-3
votes
1answer
40 views

Extracting script of tool in ArcGIS? and combining the tools join by attribute and join based spatial location?

my subject is to match between two data bases related to cartography details and second toponomy. I have ArcGIS 10.0 and I want to combine the tool of join by attribute and based by spatial location. ...
2
votes
0answers
125 views

Arcgis arcpy toolbox multiply files: error - module object has no attribute

I have a big .pyt script (python toolbox) and now i trying split it to many files (1 file - 1 tool). In single .pyt file everything works perfectly, but when file is splited i get this message: ...
2
votes
1answer
133 views

Using ArcPy to Read from Excel Spreadsheet to Python Dictionary

How would I go about creating a script that reads a specified excel spreadsheet and places the values in a dictionary? I have read about the xlrd library and how the library in such endeavors to read ...
1
vote
1answer
44 views

Getting error in running ExportReport Python code in ArcMap

i am unable to generate pdf report using ExportReport function of Arcgis 10.2. getting error of IOError: Could not open report template tried different template files but still getting this error. ...
1
vote
2answers
53 views

How to remove repetitive text in attributes?

I would like to clean up fields that contain repeated "Street Names". As seen below, I have fields "Name_From" and "Name_To". These fields sometimes repeat the same name (highlighted). I would like to ...
2
votes
0answers
33 views

Algorithm to put label of bounds (bounds layer) inside of polygons (polygon layer)

I hope to put labels of bounds inside of the polygon in intersection with like you can see in the picture below I checked multiple solution as a topology or maplex but it doesn't give relation ship ...
1
vote
1answer
71 views

arcpy.da.UpdateCursor - How to update last column from Field Name List?

examples: for field in arcpy.ListFields(fc): if field.name != 'Hi': arcpy.AddField_management(fc, 'Hi', 'FLOAT') else: print "kolona Hi vec postoji" with ...
1
vote
1answer
89 views

arcpy.da.UpdateCursor - how to make multiplication of each column with the selected column, for each row in particular?

If I have a table with a number of columns [col1, col2, col3 ... col_n] how to perform multiplication of each column with one selected column, for example: multiplication = col1 * col_def, ...
1
vote
1answer
56 views

Which arguments are incorrect when running ArcGIS example for arcpy.mapping.ListBookmarks and eporting to PDF arcpy.mapping.ExportToPDF?

I want to use the bookmarks in ArcMap 10.2.2 and 10.3 MXDs to loop through the bookmarks, zoom to the extent of said bookmark and then export a PDF by renaming the PDF with the name of the bookmark. ...
-1
votes
3answers
105 views

Sum fields from ListFields - RuntimeError: A column was specified that does not exist?

Does anyone have a suggestion on how to otherwise solve the problem ... The need to automatically generate all the columns from the table, the calculation of the sum, the results are updated in the ...
1
vote
1answer
50 views

Select the first 5 rows of a selection after reverse sorting using an attribute field in ArcGIS 10.2 with Python

I have a feature class containing 380 polygons representing sedimentary basins and another polygon feature class representing oil discoveries within said basins. My plan is to: Iterate through all ...
0
votes
2answers
39 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, ...
1
vote
0answers
74 views

Update Layer Symbology based on 1 field with changing data

I am running ArcGIS 10.2.2 Version 10.2.2.3552, using ArcMap. I have quite a big task here and before i attempt it i want to know if it is even possible. I've looked up some similar questions on ...
3
votes
2answers
87 views

How to trigger a Python script from an ArcGIS Desktop “save” operation?

Similar to the question Run a Python Script when opening an MXD, I'm looking for a way to run a Python script that is triggered when the "Save" command/button is pressed. I've read the Creating a ...
0
votes
1answer
34 views

Export as Python script from ModelBuilder never completes?

The script below was exported from ModelBuilder and runs within ModelBuilder in about 7.5 seconds. However when I export it and try to run it as a standalone script in either PyScripter or the ...
3
votes
1answer
33 views

What does InsertRow() return if the insert is not successful?

I have some basic code that inserts rows using an InsertCursor. oc = arcpy.da.InsertCursor(outputFC, someFields) for item in rowsForInsertCursor: tmp = oc.insertRow(item) del oc It seems the ...
0
votes
1answer
72 views

How do you project a single pointGeometry object with arcpy?

In an attempt to create a python add-in for ArcMap that will pass x and y coordinates to another application via a mouse click on the map, I have written the following code. I need the output ...
0
votes
1answer
91 views

Python Toolbox Parameter List Update/Refresh?

I am using a python toolbox in ArcGIS 10.2.2 and want a drop down list of all the versions for the person reconciling to choose from. (And I do not want to include dbo.DEFAULT and DS.Draft). But this ...
-1
votes
1answer
84 views

Understanding Python / ArcPy code? [closed]

I am looking for a walk through of the Python code below to explain how it works in ArcGIS. #import modules import arcpy, os #set env arcpy.env.overwriteOutput = 1 ws = ...
1
vote
1answer
50 views

Planarize tool in ArcPy?

Is there a way to use the Planarize Tool (Editing tool) in a ArcPy script. I want to create a script for a question I posted and with the help of the community resolved that problem. Please see the ...
0
votes
0answers
127 views

How to use python in arcgis to create new layer from selection and export into individual maps

I am trying to create county level maps by looping through a master file for each county. However, I get an error message when I try to run the code. I'm not sure what is wrong with my code and I ...
1
vote
1answer
64 views

When using Data Driven Pages is it possible to tell if a feature is contained within the layout?

I'm using polygons to drive my DataDriven Pages in ArcMap Standard 10.2. I have a point feature that shares a common attribute with the driver polygon, and using the Page Definition, I am showing ...
0
votes
1answer
58 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 ...
1
vote
2answers
70 views

How to create folders from shapefile attributes using ArcPy/Python?

I am wondering if anyone has solved this or can help me on my code. I have a Parcel shapefile, and I would like to create folders based on the attribute data (per row) from a field in the shapefile; ...
1
vote
2answers
110 views

Errors using arcpy.CalculateField_management

EDIT: What I forgot to mention when I first had this question is that I was trying to do these calculations on a layer which had joins, BUT where the join was on data that was added from an Excel ...
0
votes
0answers
50 views

How to test for overlap between raster and polygon in arcpy?

I have a shapefile with many polygons and many raster datasets (tif). Now, for each polygon I want to extract its area from the each raster datasets overlapping the polygon and save it to a new file ...
1
vote
1answer
44 views

Are Database Connections the best way to access Feature Classes?

I wrote some code on my machine, debugged, tested... it works great. Now, a coworker wants to use my scripts. The problem, I used database connections to reference the database and feature classes and ...
1
vote
2answers
147 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
30 views

Script to batch export pdf causing incorrect inset map

I have written a python script to batch export several pdfs from a single mxd, switching layers on/off and naming the output pdf based on values supplied by the user in a csv file. We import the ...
0
votes
0answers
73 views

Apart from “in-memory” space and physical geodatabase, is there any other method to process raster data?

Using the centroid of the building footprints (tagged residential), I want a count of hydrants within 135m, and a count of hydrants within 270m of every residential footprint. This would be based on a ...
0
votes
1answer
39 views

How to get layers created in a custom toolbox python script to add to the mxd

I'm trying to create a simple search tool so that my colleagues can easily query a database. My first version is like this. mxd = arcpy.mapping.MapDocument("CURRENT") df = ...
0
votes
3answers
66 views

Using arcpy, update value in one field based on value in another

I am creating a level of service tool and I need to update the number of lanes field based on the operation type of the road. What I need it to do is: if the operation type equals 2W, then the number ...
2
votes
1answer
43 views

Arcpy if statement to act on layers at the top level of hierarchy

I am about to save copies of all of the layers in my mxd. I only want to save the top level group layers though. I have some group layers within group layers - I dont want to save them individually. ...
1
vote
0answers
41 views

How to to get time slice in raster dataset using ArcGIS?

I have a couple of rasters made in different time. Some of the rasters are overlapping and some of them - not. I need fast and efficient way to get time sliced values for each pixel. For example: ...
1
vote
2answers
54 views

Automation of changing symbology for a given layer

I have a shape file that is a 10-by-10 grid of squares. The shape file has 50 attribute columns (named p_1 through p_50) where each column has 100 entries (corresponding to the 100 grid squares) and ...
0
votes
2answers
46 views

batch save as layer to relative path in ArcPy

I would like to use a similar code as below, but one that uses relative paths. Since my input is a batch of tif files (not layers), I do not know if I need to use other functions like ...
5
votes
2answers
357 views

How to run a python script on the server, returning the results to the client

Here's the end result I'm trying for: the user clicks on a feature on an ArcGIS Server JS map a Python script is triggered on the server the Python script uses an attribute from the feature (eg its ...
3
votes
1answer
89 views

More efficient way to get the start and the end points of a line (arcpy)?

I am collecting start and end points for a large polyline feature class in a file geodatabase. I am using arcpy, ArcGIS 10.3, Python 2.7.3 64-bit and a 10.3 compressed file geodatabase with just one ...
1
vote
1answer
64 views

Using Python Script to change Pie Chart Symbology

I am trying to change the symbology for Pie chart in ArcGIS. I have a feature class which is joined to a table and I will like to symbolized as a pie chart. I will be symbolizing it a lot thus I am ...
1
vote
2answers
172 views

How to set NULL value by arcpy.da.InsertCursor on date column?

How to set NULL value by arcpy.da.InsertCursor on date column? I try insert "NULL", None, '', 0 dictIN= [{'field1':"test1",'date1':'01-02-2015','date2':''},\ ...
0
votes
1answer
114 views

Pythonic way to recalculate feature extent in ArcGIS 10.2

I am creating a tool that will automate a tedious process of data standardization. One of the steps is to recalculate the feature extent of a SDE file. Surprisingly I cannot find anything useful in ...