A site-package created by Esri to expose GeoProcessing from ArcGIS to Python.

learn more… | top users | synonyms (7)

0
votes
2answers
53 views

Can I change the pimary key for feature class comparisons with ArcPy

I'm using ArcPy to compare two feature classes from Esri file geodatabases using the Feature Compare (Data Management) tool. The script itself works very well. However it always uses the OBJECTID to ...
1
vote
1answer
67 views

Type error in arcpy SearchCursor

I'm trying to use arcpy SearchCursor to iterate through an attribute table, and the only fields that I'm interested are line_code, w_min and ang_ataque. This is not running properly because I got the ...
1
vote
1answer
62 views

Replicate 'Clip Output to Graphics Extent' when exporting with arcpy

Sometimes I use the check box 'Clip Output to Graphics Extent' when exporting using the UI. I currently have a largish batch of mxd's that I want to export with this button checked. I am using the ...
2
votes
1answer
40 views

Find and replace text in metadata of feature classes

I have 36 feature classes in individual feature datasets. I need to update a portion of the metadata for all the feature classes. I want to find a string of text in the distribution portion of the ...
2
votes
1answer
106 views

ArcPy Get Value of Field for Selected Record

I am building a script to populate a field in one feature class based on a field in another feature class. First I have a leases layer which is all small polygons. Then I have an index grid layer ...
2
votes
1answer
74 views

Create Fishnet with row iterator (in python) - Number of rows and columns not sufficient?

I have a shapefile that contains over 100 squares of different sizes and I want to divide each of the squares into quarter sections. I've written a short python script to do a row iteration and for ...
8
votes
9answers
3k views

Maximizing the use of CPU

My script is intersecting lines with polygons. It's a long process since there are more than 3000 lines and more than 500000 polygons. I executed from PyScripter: # Import import arcpy import time # ...
0
votes
2answers
116 views

Find minimum in a column of attribute table using python on Field Calculator

I have a column X in attribute table where the values are repeated in some lines. What I need is to make a condition that says: when the values in column X are the same, find the minimum of column Y ...
5
votes
2answers
183 views

How to Convert Map Coordinates to Layout Coordinates in a rotated Dataframe?

I am trying to convert Map X and Y coordinates to corresponding Layout coordinates in a rotated dataframe. The code found in this post works fine, but only for unrotated dataframes. I've also found ...
3
votes
1answer
23 views

mass update connetion properties in msd

I would like to update the connection property in all .msd in a folder, that already have a certain connection property. The manual process is to right click on the .msd, select "select all", ...
0
votes
2answers
47 views

How to reference shapefile in folder for input to ArcGIS Copy Features python function?

I am trying to write a python script that would allow me to download data and copy it to a file geodatabase. The script currently downloads and extracts a zip folder from a FTP site. Ideally I would ...
1
vote
1answer
89 views

Openning HDF5 satellite images

I want to read and open HDF5 satellite images by python for batch processing.How read and open both image bands and meta data? For batch processing I need to geo-reference and read IR bands. Then ...
0
votes
2answers
99 views

Can I use my SearchCursor in Select by Location

I am trying to select the largest polygon that contains each feature in a feature class but none of the features in another feature class. I have written the code that seems logical to me but (of ...
0
votes
0answers
30 views

Name file based on column information, data driven pages

I am using data driven pages to export 300 maps into PNG-files. I would like to name every exported PNG-file based on information from a column in the attribute table. What is the code for that? The ...
3
votes
1answer
89 views

Labeling each polygon based on the number of points inside it using Python

I have a parcel layer and a trees layer, I want to label each parcel with the number of trees it contains and the sum of DBH. I wrote a script that calculates this and it works stand-alone, but I ...
2
votes
1answer
212 views

How to test for 'if arcpy.exists' with RemoveFeatureClassFromTopology stand-alone script?

I have some datset topologies that i want to loop through, but I need to test for the assignment of feature classes so the scripts dont fail. (Using Win 7, ArcGIS 10.2, Python 2.7.5 and a file GDB) ...
2
votes
0answers
112 views

How to add a separator to an ArcGIS python add-in menu?

In several places (e.g. Making separator and button menu in customized Toolbar using ArcObjects?) I have seen it mentioned that the way to add a separator for add-in menus and toolbars is adding the ...
0
votes
1answer
36 views

Debugging ERROR 000967 from standalone script?

The following script is working in the Python window of ArcMap but not standalone in the PythonWin IDE: import arcpy from arcpy import env env.workspace = r"J:\Non_RS_MXDs\LongHaul.gdb" ...
0
votes
1answer
29 views

Update multi fields in multi shape files with arcpy

I have 3 shapefiles belongs to one state "District", "Mandal", "Village". These three shapefiles have the same fields like DName, MName, VName. I want to update all field in all shapefiles at a ...
4
votes
1answer
524 views

Objects in this class cannot be updated outside an edit session inside ArcFM?

I'm trying to add a feature class in ArcMap 10.2.1 that is an ArcFM Feature Class by using a python script. I am working inside an ArcFM session which is required to edit the layer I am working with, ...
0
votes
4answers
73 views

arcpy.Exists and else statement

This code will go to WATERLINES.gdb, go through the gdb to see if the fc exist (based on a wildcard query), then add the fc to the mxd as desired. My questions is if the fc doesn't exist, the "else" ...
0
votes
1answer
63 views

Adding feature class to TOC using ArcPy? [duplicate]

This question has been asked multiple times with proper answers: How to add feature class to MXD with ArcPy (Python)? Adding shapefile or feature class as layer in ArcGIS Desktop using Python/ArcPy? ...
2
votes
1answer
75 views

Using Search Cursor to calculate fields with records having a specific value

I'm a total beginner at programming and Python. I'm trying to select features by attributes and then field calculate in another field. In VBA it might look like this: If [Z1COMM] = "R" then ...
1
vote
1answer
104 views

Group attribute tables values for use with conditionals - Python

I would like to group values in a field in an attribute table. The field contains duplicate values. These duplicate values should be grouped based on duplicate values, the field would look something ...
2
votes
0answers
26 views

Programmatically change the template of the layout [duplicate]

Is there a way to change the layout with arcpy? Here are images of the steps I want to do programmatically. The file I want to choose already exists and I want to hardcode its path in the ...
1
vote
2answers
77 views

Changing units of buffer

Desktop 10.3.1 GCS: WGS 1984 Created a Buffer of points based on a pre-specified radius from the points attribute table. It appears all of the buffers were created with a decimal degree unit of ...
0
votes
0answers
41 views

dwg to esri geodatabase conversion

I have a lot of .dwg files stashed in various directories. When I look at them in ArcCatalog, they all have point, polygon, polyline, annotation and multipatch layers. Now I convert all of these dwg ...
3
votes
1answer
168 views

Extracting border between contiguous polygons using ArcGIS for Desktop?

I have a shapefile with polygons representing unique populations. I want to determine contiguous polygons in my shapefile, and then extract the border separating contiguous polygons as a separate ...
0
votes
0answers
37 views

Setting units for arcpy fishnet tool, given unprojected input

I'm trying to use arcpy to create a grid over each of a large number of metropolitan areas across the US. I'm iterating over each metro and trying to create a grid over each one using the "fishnet" ...
0
votes
1answer
96 views

NumPy is missing, but fixing the environment variable removed my printer settings?

I recently installed regular Python on my workstation in addition to ArcGIS 10.2. Based on various things I found online, it seemed like the consensus was to install the full Python, because there are ...
0
votes
0answers
42 views

How can same script work in ArcMap python window and fail when executed in different computer?

I have a simple python window script: mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd)[0] sr = df.spatialReference ...
1
vote
1answer
70 views

Struggling with in_memory to erase faster

I want to delete all points inside a polygon layer: import arcpy import time arcpy.env.workspace = r"E:\DensityMaps\DensityMapsTest1.gdb" arcpy.env.overwriteOutput = True start_time = time.time() ...
1
vote
2answers
77 views

Selecting MultiPart Polygons if there are buildings in at least two of the parts

my data situation: shape of polygons (some are MultiPart Poylgons) shape of building locations (Points) What I need: Select all polygons that have two ore more parts and contain one building or more ...
0
votes
1answer
125 views

Listing Feature Classes, Geometry Types server and user names from a parent directory in Python in ArcGIS

I have parent directory containing subfolders with layer files (.lyr) and I want to list Feature Classes, Geometry Types, server and user names for these files. Also I need Python to scan these files ...
0
votes
0answers
20 views

Arcpy connect to folder [duplicate]

Would anyone know if there is a way to automate (in arcpy) Arcgis's Connect to Folder function from a list of directories? What I am after is an automated process to take a list of directory file ...
0
votes
1answer
40 views

ArcGIS: How to create polyline features from the southern delineations of a polygon?

This can be considered a follow-up question to what I've asked a few weeks ago in this thread: How to set a buffer only in a specific direction? Back then I was trying to set a buffer to several ...
1
vote
2answers
190 views

How to pass only selected features in python toolbox

I have a feature class in a file geodatabase. I want to select features from the feature class and export their attribute to an excel sheet. I need a python tool in ArcGIS which does this. My problem ...
1
vote
1answer
86 views

How to add separator in ArcGIS python add-in tool bar?

I am trying to separate two sets of button tools in a python add-in toolbar. I am trying to make a toolbar like existing arcmap toolbar where different classes of tools separated by "|". Can this be ...
1
vote
1answer
46 views

Updating a feature class based on evaluating different fields with arcpy.da.UpdateCursor

I have a feature class with a number of fields, two of wich are key fields, named key and front, and secondary fields named key_n and front_n. The thing is I need to search in the whole table for any ...
1
vote
1answer
72 views

Adding drop down option for layers in Python script tool?

I've code that will add fields to feature classes. I've parameterized the script so the user can navigate to the location of the feature classes to be edited. If the feature class is already open ...
0
votes
0answers
39 views

Batch processing Surface volume calculation in ArcMap?

I'm trying to collect the 2D area, 3D area and volume of a given basin at 0.5 meter increment in plane height, but since I want to graph the relationship between plane height and the areas and volume, ...
1
vote
1answer
80 views

Set NoData values to -999 in ArcGIS 10.3

I know how to set a value to NoData using SetNull, but how about the opposite? If I had cloud pixels in a Landsat scene that are currently set to NoData and I want to set them to -999 (an extreme ...
1
vote
1answer
92 views

How to create an ArcGIS toolbox programmatically?

Is it possible to programmatically create an ArcGIS toolbox? The aim is to write a plugin that works in ArcGIS and have a single source for the tool parameters which is then compiled to an Arc ...
1
vote
2answers
88 views

Search and Select in Arcpy with Cursors

I'm working on a tool that identifies features and repairs them using an existing tool. At the moment I am struggling to put my idea into code however. The purpose is to use a search cursor from a ...
0
votes
1answer
65 views

Update record based on series of conditionals using Python

I have a feature class which I've been using a relate to compare duplicate field values and was thinking of a way to eliminate the manual process of checking these duplicate values and making a ...
3
votes
1answer
147 views

What is the difference between data access's “SHAPE@XY” and “SHAPE@TRUECENTROID” tokens?

Data Access Search Cursor. What, if anything, is the difference between the tokens "SHAPE@XY" and "SHAPE@TRUECENTROID"? They returned the same coordnates on a test polygon: >>> cursor = ...
1
vote
3answers
199 views

Loop a Select by Attribute on all features (ArcPy)

I have a really basic script that selects an input Polygon by an Attribute and then does a series of Buffers on that, a select by location and then appends the result into a final output. I need to ...
1
vote
1answer
71 views

Add date field to imported csv file

I am using a script written by John to import a csv file and make a point feature class. My table looks like this: "timestamp_pretty","mmsi","imo","shipType","lat","long","month","week" "31/12/1969 ...
0
votes
0answers
41 views

How to use Mosaic Dataset Configuration Script (MDCS) and arcpy to add a spatial index

For a mosaic dataset ("demo1") created via Mosaic Dataset Configuration Script (MDCS) I also calculate the Boundary envelope (BB command). I would like to also calculate a spatial index for the ...
2
votes
1answer
75 views

UpdateCursor Not Working

I'm writing a short script that iterates over a list of feature classes and sets values for a specific field ("Contour_Type"), based on the values in two other fields ("Type" and "Depression"). It ...