Questions tagged [arcpy]

A site-package created by Esri to expose ArcGIS Desktop (ArcMap and ArcGIS Pro) geoprocessing, mapping, etc, to Python.

Filter by
Sorted by
Tagged with
0 votes
1 answer
12 views

Fixing AttributeError: 'module' object has no attribute 'MakeRasterLayer_management'

I'm trying to change my slope map's labels and colors to the specific ones I want which are shown in the code, but when I run this script it produces an AttributeError that doesn't make sense to me ...
user avatar
  • 21
0 votes
0 answers
9 views

Arcpy Map addTable() - ValueError - SystemError: when trying add a table to map

I have a proproject and am trying to add a table created through several processes to my map at the end of the script. I've checked under options to add output from geoprocesses to open map but ...
user avatar
  • 1,425
0 votes
0 answers
6 views

Changing labels and colors of slope map values in ArcPy with ArcMap

I have this code in ArcMap which produces a slope map with the correct values (the slope map is reclass.tif), but I want its labels that appear in the Table of Contents underneath it to show ...
user avatar
  • 21
0 votes
0 answers
18 views

arcpy.overwriteOutput = True not working; output not being added to open map

I need to make a bare bones profile for ArcGIS Pro as the end users are not proficient with it and don't have the ability to navigate and add data. I have a script that grabs records from a large ...
user avatar
  • 1,425
0 votes
0 answers
7 views

Creating window box for user input of attributes from layer and zoom to that layer based on attributes using ArcPy with ArcMap [closed]

I am new to intermediate in GIS but newish to Python. I received a task from work: Create a window box (which in the end to be used as a toolbar button) which receives user input for selecting ...
user avatar
  • 1
0 votes
1 answer
26 views

Processing large number of rasters using ArcPy but it only saves last file

I am using a Python script for running an iteration of raster calculator. The operation is a conditional clause for changing no-data values to "0". The script is the following import arcpy ...
user avatar
  • 1
0 votes
0 answers
9 views

Symbology and Dynamic values in Layout disappear after running python code

I wrote a script to automate the production of layout. All the elements in the layout are already added, the code is essentially turning on and off some of the elements based on a few conditions. I ...
user avatar
1 vote
0 answers
23 views

Ensuring that polyline feature class and LRS Network have same XY Resolution using ArcPy, ArcGIS Pro and Location Referencing

As someone experienced in Dynamic Segmentation and Linear Referencing but new to Location Referencing within ArcGIS Roads and Highways I am struggling to use Create an LRS Network and its surrounding ...
user avatar
  • 63.7k
0 votes
1 answer
21 views

Creating Geodatabase Script Creator using ArcPy [closed]

I have been working on and compiling different code snippets to create a GDB Generator. Most of the code logic I understand, but there is some that I can't grasp. Below is the code. Code: #import ...
user avatar
0 votes
0 answers
18 views

ArcPy code producing slope map with wrong values

When I run my Python script in ArcMap it produces a slope map just how I want it, but it's producing it with the wrong values. The slope map produced by the script is the one named "reclass.tif&...
user avatar
  • 21
1 vote
0 answers
20 views

Publish Reconcile branch version using ArcPy as web tool return editing error result

The return message is shown below: Starting reconcile. Reconciling version USER.MyVersion with SDE.DEFAULT. Warning: Error starting editing on version USER.MyVersion. 1 of 1 versions finished. ...
user avatar
  • 11
0 votes
1 answer
46 views

How to create custom tool via Python that selects by attribute, then outputs new feature classes

I am trying to create a custom tool via python script that selects features in multiple fc's within a feature dataset that are missing values, then from the selected features, creates two outputs: one ...
user avatar
-1 votes
0 answers
26 views

Using Image Analysis raster functions in ArcPy with ArcMap [closed]

I'm trying to script some repetitive processes for some raster operations in ArcMap 10.8 . I'm doing stuff like elevation void fill and shaded relief. I think there is a way to apply these functions ...
user avatar
  • 1
2 votes
0 answers
23 views

ArcPy producing wrong slope map using Spatial Analyst with ArcMap

I wrote a Python script which is supposed to produce a slope map with 6 classes each one being from 0-3.99, 4-9.99, 10-15.99, 16-30.99, 31-60.99, 61+ (Although for testing purposes the max is 789.54). ...
user avatar
  • 21
1 vote
0 answers
16 views

Check if connected to geodatabase as database owner (DBO) with ArcPy

I was wondering if anyone knows of a reasonable workflow with ArcPy, for ArcGIS Pro/Python3 (or ArcMap 10.8.1/Python2.7, but I'd prefer a solution for Pro), to check if a given *.SDE connection file ...
user avatar
  • 3,788
4 votes
2 answers
164 views

Comparing two sequential values in order to do an operation within sequence in another field

I have a shapefile representing points along a line. I have the downstream distance of each point on their respective line. What I would like to do is sequence the two fields in the attribute table ...
user avatar
  • 51
1 vote
1 answer
20 views

Iterating through Calculate Field using ArcPy

I have three shapefiles as points that I am trying to create new fields for and fill in the fields with a string descriptor. I am then trying to merge all three point files deleting every field but ...
user avatar
  • 51
0 votes
0 answers
33 views

Cannot Edit ArcPy Script That is Within a Toolbox Using PyScriptor

There is a script within an ArcGIS toolbox (.tbx). The script must be within this toolbox due to company practices. I wish to edit a python (arcpy) script therein, Script1.py. I must use PyScripter ...
user avatar
  • 698
-1 votes
0 answers
26 views

Using module within ArcGIS tool [closed]

I can't really comprehend whether or not this link: https://desktop.arcgis.com/en/arcmap/latest/analyze/python/extending-geoprocessing-through-python-modules.htm answers my question but I am curious ...
user avatar
  • 51
1 vote
0 answers
33 views

Creating random points along polylines using ArcPy

I'm trying to draw random points along the polylines. The polyline layer and the number of points to create are given as input. My problem is that the points are being created for every single line ...
user avatar
  • 11
0 votes
1 answer
32 views

Can't update row in Microsoft Access

I am trying to fill an empty column with unique number for every data, I use the following code: import arcpy my_input = [] column = "REGION_ID" column1 = "MUNICIPAL_ID" column2 = &...
user avatar
0 votes
0 answers
10 views

Tool or Code to change field value in multiple attributes [closed]

I have ArcMap 10.5 and I'm working with an large attribute table and want to delete all the "tbd" and "To Be Determined" within the entire table without having to go attribute by ...
user avatar
-2 votes
0 answers
25 views

Making Python script tool print into .txt file [closed]

Below is a script that totals the amount of each object so that we can generate a bill of materials. I'm wanting to write a script tool so that this doesn't have to be pasted into the Python console. ...
user avatar
0 votes
0 answers
12 views

Using reclassify method from ArcPy to set range of slope map

I'm having a bit of trouble with the syntax and some of the parameters for some functions in ArcPy (I'm completely new to it and struggle with the documentation quite a bit). Specifically, I'm trying ...
user avatar
  • 21
0 votes
0 answers
11 views

Methods for edge matching polygons to be used in ArcPy [closed]

I am looking into methods for harmonizing polygon boundaries for a set of subregion data with the end goal of writing a script to handle the processes automatically. So far, I have gone down the route ...
user avatar
2 votes
1 answer
13 views

Looping through multiple folders to calculate mean(s) of multiple rasters using cell statistcs ArcPy

I am a novice in Python programing. I have multiple MODIS rasters in different folders for which I want to calculate the mean of corresponding rasters in each folder. I have tried the following code: ...
user avatar
1 vote
1 answer
43 views

Automatically calculating value over several tables with Python

I need to write a Python script to automatically calculate costs into a given column by combining several tables (if possible using ArcPy for ArcMap 10.7) but I’m struggling to do that since I’ve ...
user avatar
0 votes
1 answer
20 views

Extract values from pop-ups in Esri MapServer

I have access to an ESRI MapServer that contains several layers; how can I get the values out of those layers and export it? Example: MapServer (https://sampleserver6.arcgisonline.com/arcgis/rest/...
user avatar
2 votes
1 answer
35 views

Using multiValue parameter with ArcPy and ArcGIS Pro

I am using ArcGIS Pro. I want to make a Python toolbox tool (*.pyt) where I put for input multiple layer's and to apply a buffer for every input. I want every buffer to put another distance. After I ...
user avatar
  • 29
0 votes
0 answers
16 views

Group By functionality after AddJoin using ArcPy with ArcGIS Pro

I'm making a Python script using ArcPy for ArcGIS Pro and I have joined a Feature Class and a Table View to create a new feature class. All of the fields and rows I need are present, however there are ...
user avatar
  • 1
0 votes
0 answers
25 views

Transferring Noticing Script from arcpy.mapping to arcpy.mp

I am trying to reconfigure a script I have been using in ArcMap into ArcGIS Pro and have discovered the whole arcpy.mapping vs arcpy.mp. I am stuck on a section that is trying to list layers. Here is ...
user avatar
0 votes
1 answer
29 views

How can I solve MemoryError if I have big list in my Arcpy code?

I have a script and I have a huge list. Because of this list, I got memory error in line 93 when the value of scale variable is 10000 in line 45. This list is empty_list in line 28. I tried to convert ...
user avatar
  • 1
1 vote
1 answer
35 views

Using arcpy AddField() does not add field or give error [closed]

I am adding multiple features to a geodatabase after I clip them to a polygon. I want to then add some fields to them, but it's not working. The script runs without an error, but the fields are not ...
user avatar
  • 61
0 votes
1 answer
23 views

How to use CalculateField_management if I add values from a list?

I have a list and I want to add the elements of this list to the field of attribute table. So that Row1 = 'apple' Row2 = 'banana' Row3 = 'peach' Row4 = 'melone I tried this: my_list = ['apple',...
user avatar
0 votes
1 answer
35 views

Looping through fishnet feature in ArcPy [closed]

I would like to loop through a fishnet feature and add the extent of the cells to the attribute table. Here is the relevant code part: cur = arcpy.UpdateCursor(fishnet_feature) for row in cur: ext ...
user avatar
0 votes
1 answer
22 views

Symbology Python Toolbox Default_Not_Custom

I created a Python toolbox with a script that groups shapes, merge shapes or groups my shapes according to certain rules. The problem is that I also modified the symbology in the ArcMap before and ...
user avatar
1 vote
1 answer
30 views

Python Toolbox updateMessages - Remember message from an earlier validation?

Is there a way to retain Warning or Error messages for parameters between tool validation calls? In my example below, I want to check the input feature class for something, and add a warning message. ...
user avatar
  • 140
2 votes
1 answer
27 views

Creating visibility surfaces through extracting and iterating with ArcPy

I am using ArcPy with ArcGIS Pro. I am trying to create a short script in order to create visibility surfaces from a set of points and a raster surface. I am new in ArcPy and probably this piece of ...
user avatar
  • 23
1 vote
0 answers
24 views

ArcGIS Pro Layers - Update Data Sources with Model Builder & ArcPy

So I'm attempting to write a script that updates the data source for the layers in my map. The script is incorporated into a model and gets some of the pathways from the model's outputs. When I run ...
user avatar
  • 151
0 votes
2 answers
54 views

Updating a field using if/elif

Edited Question: My question concerns using arcpy to add a field to an existing feature class attribute table. I am populating a Freq_Rating field using values from a Fire_Frequency field. The ...
user avatar
0 votes
1 answer
42 views

ArcPy with ArcMap cannot delete file

I have a Python tool to calculate some simple statistics on a lot of features. I use arcpy.Statistics_analysis to create a DBF file with stats for a feature class, register the results, then pass to ...
user avatar
0 votes
0 answers
12 views

Traceback error when generating coefficient raster for GWR in ArcGIS Pro

I'm getting the following error message when trying to produce a coefficient raster within ArcGIS Pro using the GWR tool: Traceback (most recent call last): File "", line 4555, in execute File "c:...
user avatar
  • 23
2 votes
1 answer
38 views

Checking for locked files in ArcMap

I am trying to understand how ArcGIS adds layers and the problems involved with repeated calls to an Arc Python tool to which a script is attached (ArcMap 10.5). I created a stripped down (no ...
user avatar
  • 139
-1 votes
1 answer
27 views

Transferring XY coordinates of point from one feature class to point in second feature class using ArcPy

I have a small list of points, testingPoints, that need their geometry (x and y points) transferred to points within a larger dataset, baseCentroids. The datasets share a common field POINTID to help ...
user avatar
0 votes
2 answers
33 views

Closing Table / Layer view but not removing from it from Map using ArcPy

Is there a way to close the table without removing it from the Map? It feels like a such a simple process but I could not find a way to do so.
user avatar
1 vote
1 answer
29 views

How to Mosaic to Raster multiple combinations in dataset

I am trying to Mosaic to Raster differing combinations of rasters based on portions of their names. I have only rasters in a GDB for with the following naming convention example: g203_DEP_0035Y_OW_LS, ...
user avatar
1 vote
1 answer
45 views

Selecting a value from the Python toolbox drop-down list of an ArcPy script in ArcGIS Pro

I created a script. I would like the user to be able to select a value from the drop-down list. Once the value is selected, I would like this value to be displayed on my cover page that I created. ...
user avatar
0 votes
0 answers
35 views

Check if field from .shp file exists in .csv file

I have an output folder with .shp files and I want to check if the fields in the .shp files exist in a CSV document (one common CSV file for all shapefiles). I go through the fields in the .shp files ...
user avatar
0 votes
0 answers
38 views

Speeding up ArcPy code when trying to process huge number of files

I'm trying to extract a specific area from a huge numbe of nc files (240000) therefore at first I need to convert each nc file in to raster and then use resample with defined cell size and finally ...
user avatar
0 votes
0 answers
33 views

Create a new feature layer from an existing feature class selection with python/arcpy

I am attempting to create a new layer from the selection of streams and rivers in an NHD feature class. I have tried every iteration that I can think of without success. I am very new to Python, so ...
user avatar
  • 1

1
2 3 4 5
202