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

learn more… | top users | synonyms (7)

1
vote
1answer
31 views

Change anchor point using ArcPy

Is it possible to changed the legend element anchor point using arcpy? This is the default anchor point: and i want this anchor point loaction: I know how to changed the legend element position ...
2
votes
1answer
38 views

How to get specific version (renedered with) of a feature layer in arcpy

Is there any way to get version of a layer loaded using arcpy.MakeFeatureLayer_management in arcpy with mssql server connection. There are tools that be used for several types of version related tasks ...
1
vote
1answer
58 views

What would cause a geoprocessing service to say “Cannot Open 'FeatureClass' Failed to Execute”?

I have a really basic geoprocessing script that's published to ArcGIS Server 10.2.2. It basically just reads in a json object that's passed in as a parameter. The json just has attribute names and ...
3
votes
1answer
53 views

How to slice a list based on row values? [closed]

I'm working with python 2.7 (quite a beginner). I have a list, and I have a feature class with : A = a field that contains values that I would like to use as the start of the slicing B= a field that ...
0
votes
0answers
23 views

Geodesic replacement of coordinates [duplicate]

With a updatecursor I can move vertex to a new location and modify polygons. For a simpele example I tried to move the world, see image. The black lines are the 'edges' of world (180,90 -180,-90 ...
3
votes
3answers
142 views

ArcPy.da.UpdateCursor error The requested operation is invalid on a closed state

Hello I am getting an error when trying to use the arcpy.da.UpdateCursor(). The error I am receiving is as followed The requested operation is invalid on a closed state I am in the python ...
4
votes
1answer
44 views

Access to graph properties in arcpy

I am using data driven pages and arcpy.Graph() object to automate production of synchronised map/long-section series similar to this: I'd like to keep vertical scale for long-section part. In order ...
3
votes
1answer
41 views

Can a Relate within an MXD be detected programmatically using ArcPy?

I would like to know if it is possible detect relates in an MXD using arcpy. Similar problem as the question below, but for relates instead of joins. Can Join be detected programmatically by ArcPy? ...
3
votes
1answer
46 views

Managing Leaders for Extent Indicators of Insets using ArcPy with Data Driven Pages?

I am working in data driven pages that need insets on some maps (not all). I found and have successfully managed to use this code below. However, I need to have leaders. Any ideas on how to manage ...
1
vote
4answers
171 views

How to modify a cell value in a raster under certain conditions (ArcGIS)?

I have a DEM raster with some negative values. After overlying other shapefiles, I realize that the negative values are for bodies of water (mainly lakes and bays). I want to replace the negative ...
5
votes
1answer
53 views

Using findAndReplaceWorkspacePaths in one directory (divide into sub folders) using Python?

I try to use 'findAndReplaceWorkspacePaths' function on MXD files using ArcView 10.3.1. The MXD files located in one directory (which is divided into folders and sub folders). Also in the sub folders ...
1
vote
1answer
63 views

Shapefile buffer assigning to each buffer a different length

I am new to ArcGIS and Python. I have drawn a set of lines (corresponding to a network) in a shapefile. I would like to buffer them, but each line has a different buffer length, so I thought to do it ...
0
votes
1answer
31 views

Outside ArcMap session, script fails to add/save layer to mxd file

The following code generates an layer output, but fails to add and save it to the specified mxd. There are no other layers in the mxd, and is just a 'ghost' / placeholder for running the script ...
0
votes
1answer
34 views

Run standalone python script against mxd, not outputting layer file/package

The bulk of the code used in my script for reading this is from @RHB located here. His block of code runs fine with a current map open. Need it to open without an ArcMap session open. I tried as ...
1
vote
1answer
51 views

ArcGIS Focal Statistics Returns Out-of-Bounds Result

I am trying to compute a moving window maximum on a raster, such that the output is the max within a 5 mile radius. This should result in an output grid where the maximum is equal to the maximum of ...
2
votes
1answer
49 views

Field Calculator is not calculating selection from Make Feature Layer in arcpy

I am trying to use field calculator to calculate 3 different fields in python from a Make Feature Layer variable. It calculates the first field (MATERIAL_T) but then it doesn't calculate the second ...
1
vote
1answer
37 views

Export footprints of an unmanaged raster catalog with arcpy

Is there a way to access the "export footprints" function for an unmanaged raster catalog with arcpy? It can be done through ArcMap when a raster catalog is added to the map as seen below. The ...
0
votes
1answer
42 views

Converting geodatabase public lands to a shapefile

Can a whole geodatabase be converted to a single shapefile? This is my code, not sure what I am doing wrong... # Import system modules import arcpy # Set environment settings arcpy.env.workspace = ...
0
votes
0answers
65 views

Understanding behavior of ToolValidator class and checkboxes in ArcPy?

In trying to simulate a pair of radio buttons in a ToolValidator class using checkbox parameters (yes, this subject has been discussed before), I find that I do not understand what exactly is the ...
1
vote
1answer
53 views

How to find the sum of many raster files in arcmap?

I have a list of 576 raster files for which I need to find the SUM. Obviously using raster calculator one by one would be tedious. Any easy script in Arcpy to do this?
0
votes
1answer
18 views

ArcGIS Calculate Near by looping through and matching .shp names from two different directories

I have several thousand shapefiles in one directory (direct1) and several thousand other shapefiles in another directory (direct2). The files in direct2 will have a match in direct1 and will have the ...
2
votes
0answers
67 views

Select by location not selecting all features in ArcPy [duplicate]

I am having an issue with the "select layer by location" tool in my ArcPy script, that may be due to a hidden memory error. Using one feature class with 281 polygons, I would like to select all of the ...
1
vote
1answer
47 views

Graph preview in Python toolbox

I need to create a toolbox in python, which will be used for making graphs. I need the parallel preview window during the graph creation. Half of the screen will be used for settings the parameters ...
1
vote
1answer
54 views

Calculating centroids without adding field to table using ArcPy?

I haven't been able to find any bit of code that does this successfully. I need to delete some fields in a table that I'm modifying using a script I'm writing. I don't want the fields to be left on ...
3
votes
1answer
58 views

ArcPy SearchCursor row format

I set up a script to print some statistics about line segments. The "logfile" is basically the same as "print", but to a textfile instead of on screen only. LogFile("Feature {0} has a length of ...
3
votes
0answers
30 views

Mask out values in a raster based on standard deviation

Does anyone know (in Modelbuilder or python) how I can remove any values of a raster that outside of the range of three standard deviations? I have a lot of rasters so it would be quicker than ...
2
votes
1answer
96 views

arcpy.UpdateCursor updates every row

I would like to update a field with new values. With the code below it assigns the value '2' to all the rows and not just if the field == 2. But by 'print i' and 'print "it is 2"' everything looks ...
3
votes
0answers
20 views

How to get rid of layer created by Make Feature Layer (Data Management) [duplicate]

I like to run some scripts from mxd. Very often I am using Make Feature Layer tool to facilitate queries. Tool help says: “Creates a feature layer from an input feature class or layer file. The layer ...
3
votes
3answers
224 views

Can a feature class be stored as a shapefile?

This is a general question about how a feature class is stored or can be stored using python/arcpy. Can a list of created points (a feature class) be saved as a shapefile or in a shapefile, or to ...
1
vote
0answers
68 views

Replicate elevation profile extraction (from 3D Analyst toolbar) with Python [closed]

I'm looking to take Python (v2.6.0) control of some ArcGIS (v10.3) toolbar functions in 3D analyst, so I can modify and automate these operations. If the answer is that I need to do this from scratch, ...
5
votes
1answer
137 views

UpdateCursor gives Too few parameters Expected 1?

Can anyone tell me why my script isnt working? I cant figure out where I went wrong. I am working with an access personal geodatabase. Adding a field, then updating that field with yes if the field ...
1
vote
2answers
88 views

Updating firstPoint and lastPoint using ArcPy cursor?

I want to update a Line feature's start and end. I got Point of first and last. BUt, I can't update them. What is wrong ? (I'm using ArcGIS 10.2) rows = arcpy.UpdateCursor(srcFile) feat = ...
1
vote
0answers
59 views

Looping spatial join in arcpy - order problems

I developed a python script where the user inputs a polygon shapefile multiple point shapefiles and within the script the polygon shapefile is divided into 1000mx1000m grid cells and the point ...
1
vote
1answer
57 views

ArcPy: Geoprocessing for the data with specific variable [closed]

Imagine if we have dataset like this: +------+------------+ | City | DistrictID | +------+------------+ | A | 001 | +------+------------+ | B | 001 | +------+------------+ | C ...
1
vote
1answer
30 views

Value Table in Python Script not displayed correctly?

I am trying to implement a Python Script tool where I need a table to input shapefiles and corresponding names for new created fields. I found out that there is the Value Table provided by ArcGIS, ...
4
votes
2answers
112 views

Python script that creates polygon feature class with given coordinates

Write a script that creates a new polygon feature class containing a single ( square ) polygon with the following coordinates: ( 0, 0 ), ( 0, 1,000 ), ( 1,000, 0 ), and ( 1,000, 1,000 ). ...
2
votes
1answer
77 views

arcpy.Clip_management throws 999999 error. Running from toolbox works fine

I want to clip multiple rasters to my study area, so I'm writing a script that's using the arcpy.Clip_management tool. However, the tool throws an 999999 error with no explanation when executing. I ...
4
votes
1answer
41 views

Using findAndReplaceWorkspacePaths to change picture path element- ArcPy

Picture element, in 60 MXD files, disappear and there only blanked rectangle instead. I know one way to solved it, by go to the picture properties-->picture tab. But i try to find a way do it with ...
3
votes
1answer
38 views

Using findAndReplaceWorkspacePaths to change datasource for CAD files- ArcPy

I try to use "findAndReplaceWorkspacePaths" in order to change datasource for CAD files. This code works fine but when there no cad layers to work with, despite this the code will print ...
1
vote
0answers
29 views

Can't display raster in mxd as RGB

I have a script that iterates through a folder of jpgs, clips them to a grid, inserts them to an mxd, and exports them. My original problem was when I added the clipped raster from a standalone script ...
1
vote
1answer
152 views

How to iterate through layers of an MXD?

I know model builder will not iterate through the layers in an MXD, which is kind of fundamentally stupid if you ask me, but I still need to do exactly that. I am not a strong coder but i understand ...
0
votes
1answer
68 views

Measure Point Along a Line

Looking to find Distance along a line(road) by a user input(Mouse Click). Here is my python code TESTED and works def onMouseDownMap(self, x, y, button, shift): mxd = ...
0
votes
1answer
103 views

Route Layer with ArcPy and OSM Data - very slow

This is my first attempt at using arcpy: I have two CSVs which have columns: CSV1: join|id_a|lat_a|lon_a CSV2: join|id_b|lat_b|lon_b Each has got 100 rows of data. I would like to write a script ...
3
votes
0answers
57 views

Iteration from a text file [closed]

Trying to determine logic to create a line from the points for each Line_X number Example: Create array of points, then a polyline for all points of Line_1, then Line_2, etc. pointList = ...
1
vote
2answers
161 views

Determine rasters particular area's within ranges using python

My directions: Create a script that determines what areas meet the following conditions: Moderate slope — between 5 and 20 degrees Southerly aspect — between 150 and 270 degrees Forested — land ...
3
votes
1answer
19 views

MakeXYEvent setting values in CSV with numbers as text in result?

I thought I had a working ETL script going that was writing a CSV from a non-spatial Oracle DB to ArcGIS gdb when one day it broke. I whittled it down to the MakeXYEventLayer process. Basically I ...
1
vote
1answer
47 views

Batch Clipping Shapefiles using Argparse

Is there a way to batch clip shapefiles in ArcPy using an argument-Argparse (which calls a shapfile or group of shapefiles) specified by an outside user in command line?
0
votes
0answers
45 views

Execute Built-In Command in ArcMap using Python Add-Ins Extension Event?

Is it possible to execute an ArcMap built-in command programmatically, using the Python Add-ins framework? Can ArcMap built-in commands be exposed to and executed using the event methods found in ...
2
votes
1answer
75 views

Repoint feature layers from one SDE to another

I am trying to repoint layer (.lyr) files to a new SDE connection. In a test project folder I have two test layer files. When using lyr.findAndReplaceWorkspacePath() the script runs with no errors, ...
0
votes
0answers
63 views

Spatial Join - Field mapping to delete and rename fields

I have a python script where the user can enter a study area (Polygon shapefile) and multiple point Features of interest (Point shapefiles). The point shapefiles are looped through and joined with ...