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

learn more… | top users | synonyms (7)

3
votes
1answer
24 views

Generate new coordinates with distance + azimuth

I currently have the following Excel data for a list of animals: Lambert 93 coordinates of the observer Azimuth of the animal Distance between the observer and the animal I would like to get the ...
1
vote
1answer
36 views

Interact with Selection and Entire Dataset using arcpy

ArcToolbox geoprocessing tools (and therefore arcpy) tend to run either on an entire dataset (if there is no selection) or on a selection set (if it exists). How can I set up an arcpy script that ...
1
vote
1answer
49 views

Finding layer file used to add layers to MXD in ArcPy?

I work with layer that located in G:\PROJECTS\bneyAyish\gis\lyr\New File Geodatabase.gdb\polygon, and I created a layer file and located it in G:\PROJECTS\bneyAyish\gis\lyr under the name ...
1
vote
1answer
70 views

Iterating over Twitter data using TwitterSearch creating array in Arcpy for shapefile

Below is the section of code I'm having trouble with. How do I designate the x and y coordinates from the (lat, lng) variable in the twittersearch for loop in the top part? These coordinates will be ...
1
vote
0answers
71 views

How to automatically run python code at the time when a mxd is saved?

I am trying to find a way to execute a few lines of (preferably python-)code whenever I save a specific mxd (my template.mxd) I'm working with arcgis desktop 10.3.1 (advanced, all extentions) What I ...
0
votes
0answers
93 views

Python Script to open Hyperlinks

Background: Currently we manually update the file path for a polygon field to hyperlink to tiffs of registered plans for our fabric records (we use Parcel Editor currently using ArcMap 10.2.2). The ...
2
votes
0answers
33 views

extracting raster using values

I have an original .tif file which has values ranging from 2 to 28. From that original .tif file, I am extracting cells having a value of >=10 using the following code: import arcpy, os from arcpy ...
1
vote
2answers
45 views

Creating MapDocs from mxd file

New to Python. I have an mxd file file with three layers and one is a layer of elementary school boundaries. Goal: Make a pdf doc with a page for each elementary boundary. ...
2
votes
1answer
41 views

Zoom to the whole page using ArcPy

I work with several MXD files. When opening those MXD files, i want to see the whole layout view, as this button function: . Is there a way, using arcpy, zooming to the whole page in the layout view, ...
3
votes
2answers
29 views

Raster conditional tool unexpected results. What's wrong?

I have a DEM raster (High: 53441, Low: -3444, unit: cms) with negative values, and I want to make all values 100 or less to be 100. I've tried Raster Calculator, and also python. I've got the same ...
1
vote
0answers
42 views

Arcpy - Why does multi_user_mode have to be False in an edit session on non-versioned dataset?

I'm in the process of implementing Mintx's answer to my question What would cause a geoprocessing service to say "Cannot Open 'FeatureClass' Failed to Execute"? However, I had ...
1
vote
1answer
19 views

Highlight roads that are within a buffer or overlapping buffer

So I have points with a mile buffer. Is there a way to "highlight" the roads that fall under the mile buffer? My original plan is to clip the roads with the buffer, but this will take some time ...
0
votes
1answer
33 views

Python arcpy select by location to copy attribute values from one shape file to another [closed]

I have 2 shapefiles, lines and points. I want to copy over the lines number to the points that are near each line. I can use select by location in ArcMap and label manually for a small scale, but ...
4
votes
1answer
67 views

Get raster value at specific point (arcpy)

I have an arcpy script creating thousands of points in a feature layer, based on a river network. At creation time, I'd like to use the value from a (large) elevation raster corresponding to the new ...
1
vote
1answer
40 views

Simple python query: properly setting up arcpy.env.workspace and defining datasets

I'm creating a python script (for the first time in quite a long time). And the basics are confusing me a little. With the below code I keep getting the error: "ERROR 000732: Input Table: Dataset ...
0
votes
1answer
53 views

Manipulating Text elements in ArcPy?

Continually to Change part of text element using ArcPy ,when i use this code in order to delete text element (the words "Land Use"): import arcpy from arcpy import env env.workspace = ...
3
votes
2answers
57 views

Making a simple line- complex

I am trying to make my own version of code to generate elevation profile for a line drawn over a DEM and I got stuck very early on. As a simple use case: I have a line that consists of just two ...
0
votes
1answer
28 views

Arcpy - LayerList - Count/Length [closed]

I use arcpy to load all layers in the current map document, and I need all layers but not the last one (this is my layer for the symbology template). How can I access the length or count of the ...
4
votes
2answers
227 views

Correct SQL expression when looping different fields

I'm having trouble with the follow lines of code. Practically what I am doing is a 10 shapefile loop in which field represents the name of the field that I want to be calculated( the name differs by ...
2
votes
1answer
35 views

How can I access information about ArcSDE historical markers via arcpy or SQL

I would like to be able to access the list of historical markers that is presented by in the "Change Version" dialog in ArcMap - ...
3
votes
1answer
62 views

Arcpy geoprocessing script running with default inputs

I have a pretty simple geoprocessing script. My javascript is supposed to be passing it a list of layers to query. Something like this for the Javascript: var params = { "Layers": ...
4
votes
4answers
171 views

Get a coordinate system from raster file

I am writing a code to loop through all the files in a folder and reproject them, using a raster as the spatial reference. I have a suspicion that there is a different way to get the coordinate system ...
1
vote
1answer
51 views

Extract Polygons out of a raster

I want to extract every row from a .shp from a raster (Extract by Mask). With the following code i get 4 output raster, wich concludes every row. import arcpy arcpy.CheckOutExtension('spatial') ...
3
votes
0answers
39 views

Recovering toolbar from disconnected window?

I've faced this problem many times. I created a python addin toolbar and installed it in ArcGIS 10.2 . I work on dual monitors in the office. If accidentally this toolbox is left on the secondary ...
0
votes
1answer
90 views

How to use Python and ArcGIS? [closed]

Is it possible to open a Python file on ArcGIS and use ArcGIS information (from attribute tables) in routines of this Python file? If it´s possible, how can I do?
3
votes
2answers
167 views

ArcGIS python “add field” and “calculate field” workflow

I am new in Python and I am creating a Script. I've crafted a functional code, but I'd like to know if there is an easier way to do it, just for curiosity (And learning new ways!). The purpose of ...
2
votes
0answers
55 views

Determining EPSG code for coordinate transformation using ArcPy? [closed]

I am trying to write a Python script which will identify the EPSG code for the coordinate transformation. I am familiar with the dataFrame.geographicTransformations function, however this returns a ...
1
vote
0answers
29 views

A mesh points for each polygon: how to create function?

I want to use function for creating a mesh point for each polygon, but I am new in python. what is wrong with the function: def creatingPoints(minX, minY,maxX,maxY,number): while minY < maxY: ...
1
vote
1answer
30 views

Something Wrong with The size of the Converted Shape File (arcpy.PolygonToRaster_conversion)

I currently have a python script to process some vegetation data, while using some specific shape files. The first step is to build a geo lookup table which needs to convert the shape file from ...
6
votes
1answer
52 views

How to recursively get all lyr file properties from a group layer on disk

I'm writing a python script tool that will recursively search through a folder and all subfolders and find all .lyr files. Ultimately, I'm writing a CSV file which contains the path of the .lyr file, ...
2
votes
2answers
71 views

Check-out XTools Pro with arcpy

I have an arcpy script that uses a XTools Pro geoprocessing tool, which works if I run it from ArcMap (with the XTools Pro extension enabled), but if I run it outside of ArcMap I get an error. Tool ...
3
votes
3answers
75 views

How to generate a list of unique years from date field?

I have data that was collected over many years and I'd like to be able to run a python script tool in ArcToolbox (ArcGIS 10.1) to get a list of unique years from the date field. I found an example of ...
1
vote
2answers
52 views

Printing MXD files name using ArcPy gives AssertionError: Invalid MXD filename?

I try to print all the MXD files name. The MXD files located in one directory (which is divided into folders and sub folders). Also in the sub folders there are MXD files. I work with this code: ...
1
vote
1answer
91 views

Reclassify variable in ModelBuilder?

I want to reclassify a raster (variable) in model builder in two classes. First class ist 0-treshold = NoData and second is treshold-max value = 1. It works fine if i use an existing raster file as ...
0
votes
1answer
128 views

RuntimeError: cannot open <shapefile> from ArcPy search cursor? [closed]

import arcpy from arcpy import env env.workspace= "C:/Esripress/Python/Data/Excercise08" fc = "rivers.shp" cursor = arcpy.da.SearchCursor(fc, ["SHAPE@LENGTH"]) length =0 for row in cursor: length ...
0
votes
0answers
69 views

Error 000628: Cannot set input into parameter out_layer when executing MakeFeatureLayer

I have a script that runs fine in ArcMap and when published to ArcGIS Server: it runs fine when using folder workspace i.e GDB database. fails when using ArcSDE workspace to connect to a RDBMS. ...
1
vote
1answer
30 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
57 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
141 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
44 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
169 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
30 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 ...