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
-1 votes
0 answers
18 views

Comparing two DSMs from different years [closed]

How to to compare two DSMs with each other and find their difference in elevation? I have two Digital Surface Models (DSM) in raster format, one for the year 2017 and one for 2021. Both my rasters ...
0 votes
0 answers
6 views

Using CIM Maplex to include feature weights and never remove unplaced labels

I'm using ArcGIS Pro 2.9. I've been trying to add feature weights and to include unplaced labels to a feature class, yet my understanding of the CIM engine seems to be lacking. My code below doesn't ...
  • 39
0 votes
0 answers
18 views

ESRI - ERROR 000358: Invalid expression. Connect Public Transit Data Model To Streets

Having some issues running the Connect Public Transit Data Model To Streets (Public Transit) tool with arcpy. Getting an error code when completing a script provided by Esri - located here. I modeled ...
  • 21
-1 votes
0 answers
16 views

Exporting unique output names with Clip in ArcPy [duplicate]

I am trying to complete this simple Clip analysis loop, but I am having trouble getting my output features to export with unique names My goal is to have my have my output features save into my test ...
  • 1
0 votes
0 answers
14 views

I am trying to complete this simple Clip analysis loop. I am having trouble getting my output features export with unique names [closed]

My goal is to have my have my clip_feat save into my test files folder as the feature that is being clipped + todays date. For example, FEMA_09222022. Everything seems to work well, but after getting ...
  • 1
0 votes
0 answers
9 views

Is there a way to redirect ArcGIS log server errors to a URL/webhook?

I want to be able to log ArcGIS Errors when they arise to an external platform. For example, I have been using Sentry for other kinds of errors. So I want to be able to send the errors from ArcGIS to ...
0 votes
0 answers
17 views

Extracting data shown in Version Changes on Branch-Versioned feature service before reconcile/post process using ArcGIS Pro

Currently there is no way to export version changes on feature service in ArcGIS Pro as a change report. Preferably a Python script to extract the details about version changes on a branch-versioned ...
  • 1
-1 votes
0 answers
28 views

Autofit columns of an Excel doc with Python

I'm trying to autofit columns of an Excel doc I create with ArcGIS Pro 2.9. It seems totally possible with ExcelWriter, which doesn't seem to exist in ArcGIS Pro 2.9. I don't have any code about ...
  • 39
0 votes
1 answer
14 views

RuntimeError: [blank] when trying to add a standalone table to a map with python

I am trying to add a standalone table to a map, but when I attempt to create the table object I get a blank runtime error ('RuntimeError: '). This error occurs when running the arcpy.mp.Table() line. ...
0 votes
1 answer
25 views

Deleting geometries in feature layer based on unique field values

I have a building feature layer for a county. Some parcels have more than one building, so the buildings in these parcels all have the same TMS number in the "TMS" field. I only want my ...
  • 121
0 votes
1 answer
56 views

Automate exporting species distribution maps with ArcPy by iterating through species fields in graduated symbology layer

I've got a map I've made which uses an attribute table denoting 1 (present) or 0 (absent) for the distributions of hundreds of species of insects in all Florida counties, and I'm displaying them with ...
1 vote
0 answers
41 views

Cursor script runs but not updating value

I have a script I wrote to use an update cursor to change any records in a feature class that has a field set to 'N' to 'Y'(coded domain values). I have ensured that the database connection file is in ...
  • 11
1 vote
0 answers
35 views

Using ArcPy to iterate through multiple LAZ files and convert them to LAS files with lastools

I'm using Jupyter Notebooks in ArcGIS Pro and I would like to convert multiple .laz files into .las files by using the opensource toolbox 'lastools' and its function 'laszip'. For this I would like to ...
0 votes
1 answer
41 views

Summarize Within 100014 error no luck with Esri help article

Currently using arcpy to run a script to include the Summarize Within tool. Unfortunately, I am receiving a 10014 error. I have already shortened the file path per the help article to the shortest ...
  • 21
0 votes
0 answers
15 views

Correcting 'ImportError: No module named arcpy' without admin rights using Wing IDE 101 8 [duplicate]

Error: 'ImportError: No module named arcpy' I am new to Python programming (or any programming) and basically teaching myself. I'm using Wing IDE 101 8 (recommendation from a previous coworker who ...
0 votes
0 answers
13 views

Adding a layer to a map service without overwriting or republishing?

We host a map service with near-real-time satellite imagery. When we receive new image throughout the day, we currently use a script to add the .tif as a new layer and republish the service as quickly ...
0 votes
0 answers
17 views

Import ArcPy Error using Wing 101 IDE

How can I correct this error? I've read this: Debugging ImportError: No module named arcpy But honestly, no clue how to fix it from this description. I'm using Wing 101 IDE, obviously brand new to ...
0 votes
1 answer
17 views

Save CIMTableFrameField to JSON with Arcpy

I am trying to automatically update a layout table frame with a layer previously created from a model. I am using CIM toolset. I am able to look for the table frame element and choose the layer to use ...
0 votes
1 answer
24 views

While trying to insert a layer to an existing .mxd, I get an AssertionError, and can't figure out why

I am trying to add new raster layers to an existing .mxd (and then eventually remove the old ones, once I've updated the new raster layer's symbology to match the old ones). I'm running into an issue ...
0 votes
2 answers
43 views

A Python Script that runs without issue in ArcGIS Pro fails in PyCharm

I have created a script in ArcGIS Pro to delete and copy some datasets from one location to another. It works flawlessly when run through ArcGIS Pro. When I attempt to run the script in PyCharm, ...
0 votes
1 answer
23 views

Calling table frame layout element from Python Toolbox using ArcPy

I created a Python Toolbox which calculates statisitics about some layers and print a pdf layout. The layout and table frame elements already exist. I try to access the table frame elements from my ...
0 votes
1 answer
37 views

Table to Excel For loop keeps producing lock file in directory using ArcPy

I have the following code that I developed to convert my .dbf zonal statistics outputs into .xls using arcpy. I am trying to run the loop using three files as a test; ppt_07223000_190001.dbf, ...
0 votes
1 answer
23 views

"NameError: name 'SetNull' is not defined" error in ArcPy script? [closed]

I am trying to set a flood raster to a null value whenever it is less than 0.1 feet, but I am getting a NameError. I think I am following the SetNull documentation correctly, but can't figure out why ...
  • 121
0 votes
0 answers
28 views

How can I script 'Overwrite Table'

Here is documentation on it, but it doesn't have Python code associated. I want to script this so I can make it run automatically after another model runs as a precondition. My current workflow is: in ...
  • 1
0 votes
0 answers
42 views

Loop through headers in CSV file and make shapefiles from each header

I am unable to figure a way out how to create a shapefile after looping through the csv files and matching the headers (dates in format Oct11/2018). Each shapefile should have all the fields with the ...
1 vote
1 answer
41 views

Using Notepad++ to write Python scripts for ArcGIS Pro

I am using Notepad++ and I have set the "RUN" command to use the ArcGIS Pro Python executable located at "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe" Once ...
0 votes
0 answers
16 views

ArcMap graphic memory messed up after using zoom to location ArcPy script tool

I am using ArcMap 10.8.2. I have a script that selects a certain area based on user input. Section, Township, Meridian. It works great but sometimes when exporting JPEG or PDF and trying to resize the ...
  • 9
1 vote
1 answer
25 views

Using ArcPy to overwrite one SDE feature class with another SDE feature class (from different SDE)

I am a beginner with Python and ArcPy. I am trying to write a Python script that will overwrite the viewer copy of our data with the most recent editor copy. Here is the code I am running through the ...
0 votes
0 answers
11 views

Setting Composite Callout property of label using ArcPy and CIM

I'd like to set label symbol to composite callout using CIM and arcpy in ArcGIS Pro. Can you advise me how to achieve it using ArcPy? aprx = arcpy.mp.ArcGISProject("current") maps = aprx....
  • 1
0 votes
3 answers
35 views

Loop through raster names in two folders, perform Con (Spatial Analyst tool) if the dates match

I cannot perform the Con tool over all the raster images with same date in two folders. This is the script I have worked upon so far. import arcpy, os from arcpy.sa import * # Set the current ...
1 vote
1 answer
32 views

Making perpendicular lines to existing line features in ArcPy with ArcGIS Pro

I have reviewed and tried multiple different answers to similar questions but have not got the results expected. I have a layer with 4425 polyline features and want to make a perpendicular line ...
  • 11
0 votes
1 answer
24 views

Open a geoprocessing tool / custom script tool window as a result of python code compilation

I am trying to create a custom system for converting general geodata to S-57 standard. This will require more than one custom tool/script, but I'd like to make the experience as user-friendly as ...
1 vote
2 answers
30 views

Extract field details for all layers in a geodatabase

I have inherited a file geodatabase containing a number of feature classes (points, lines and polygons), where many fields are common. For example all feature classes contain the following fields, and ...
  • 1,299
0 votes
0 answers
21 views

ArcPy custom tool script forgetting user entered parameters and uses its own

I work in a field where finding the volume-elevation relationship between a certain elevation and a DEM is a common need. To that end, I was very happy to find Esri's supplemental spatial analyst ...
0 votes
1 answer
16 views

Getting Focal Stastics to ignore NoData using ArcPy with Multiband Raster

In ArcPy, I am running the Focal Statistics tool to calculate the mean value of a raster within a 20 pixel buffer. I would like to ignore no data so that a value can be calculated even in locations ...
  • 33
0 votes
1 answer
16 views

Add multiple fields to multiple feature classes using ArcPy

I'm trying to add multiple fields to multiple feature classes using a list in ArcGIS Pro. This is my code import arcpy arcpy.env.workspace = "Tatjana\MasterGeodatabase\MasterGeodatabase.gdb&...
1 vote
0 answers
16 views

Update mosaic datasets with ArcPy

I try to update a mosaic dataset with arcpy and then populate two fields (AcquisitionDate and Sensor) based on the name of each raster. What I see is the following: When I first add the rasters to ...
0 votes
0 answers
12 views

Get derived output of grouping analysis in ArcPy using ArcMap

I try write a Python script to run Grouping Analysis a large number of times on different input files. After the first run (apply evaluate the best group between 2-15) I would like to get the derived ...
  • 79
0 votes
0 answers
11 views

Merging outputs gives error [duplicate]

I'm having some trouble with the python code where i'm recieving this error as output line 382, in merge vt.addrow(input) RuntimeError: ERROR 999999: Error executing function. meanwhile the python ...
  • 1
2 votes
1 answer
37 views

Properly closing GeoPackage after opening by OGR so as to delete it later

I am creating a program that downloads a GeoPackage from online, opens it, makes a copy of the first layer as a shapefile, and then (hopefully) deletes the GeoPackage. However, I'm not able to delete ...
  • 688
0 votes
0 answers
14 views

Scheduled Python script arcpy.SpatialJoin_analysis line of code resumes only when I log into the machine

I have a python script (scheduled by windows scheduler) on a desktop I remote into. all lines of code execute without me being remoted into the machine except when it gets to this line of code below ...
0 votes
1 answer
36 views

ArcGIS Pro SetProduct not working

I have a standalone Python script that during initialization verifies if the ArcInfo license is being used, and if it isn't attempts to set the license to ArcInfo. It works fine with arcpy/python 2.7/...
-1 votes
1 answer
26 views

In ArcPy, update rows if the column exists, loop through all layers [closed]

Using ArcPy within ArcMap I want to loop through all layers in a geodatabase, if a column exists then I want to change the value in that column. For instance, I have 3 feature classes layer1, layer2, ...
0 votes
0 answers
10 views

Public Routing Service URL for `arcpy.na.MakeVehicleRoutingProblemAnalysisLayer()`

I had a script to solve routing problems using arcpy.na.MakeVehicleRoutingProblemAnalysisLayer(), but I no longer have access to the network_data_source. According to the documentation - this can be a ...
0 votes
1 answer
18 views

NoData values change after saving in ArcGIS Pro

I'm using ArcGIS Pro 3.0 to process a series of .tif files. I'm going to process these images in a program that requires NoData and nan values to be set to a numerical value, like -3. I have code to ...
  • 181
0 votes
0 answers
28 views

Drawing parallel lines inside polygons (ArcGIS Pro)

There was a question asked previously here link(Drawing parallel lines inside polygons (Well Paths) using ArcGIS Desktop?), I was wondering if anyone has tried this in a more up to date ArcGIS Pro, I'...
1 vote
2 answers
37 views

Looping ArcPy function through each point in shapefile

I have been trying to create a geoprocessing tool to delineate watershed basins for each point in a shapefile (parameter 1; CROSSING). The code below returns three 'basins', but they are all identical ...
  • 13
0 votes
1 answer
42 views

Select Layer By Attribute_management not taking variable

I am trying to make SelectLayerByAttribute_management to take a string (that is an input variable) as the "where_clause". The string would be inputted by the user. If I just put the text I ...
  • 9
0 votes
0 answers
48 views

Creating centroid from line while keeping attributes of line using ArcPy with ArcMap

I have created a centroid from a line I want the centroid to be created with attributes of the line. By executing the following code I get this result: import arcpy input_fc = 'Export_GC_a_integrer' ...
2 votes
1 answer
55 views

Using Select by Attributes for large list of values in ArcPy

I have a CSV of integers containing meter numbers varying from 9 digits to 11 digits. I've written a simple script to read CSV to a list. import pandas as pd path = "example_path.csv" df = ...
  • 23

1
2 3 4 5
204