All Questions
10,635 questions
0
votes
0
answers
12
views
Arcpy is throwing error when changing output name for XYTabletoPoint [duplicate]
I have a basic task of lat/lon to xy and I'm trying to name the output shape file in the out_feature_class, when I do it in the gdb file it's fine, but anything else to identify it blows up.
arcpy....
1
vote
0
answers
29
views
Import arcpy in Python IDLE not working
I've installed ArcGIS Pro 3.4 (annual license for personal use) and Python IDLE 3.11.9. When I try to import arcpy in the IDLE I get the following error message:
import arcpy
Traceback (most recent ...
0
votes
0
answers
16
views
Trying to rename feature classes with loop
I keep getting a ERROR 000670: Output Output Data cannot be the same as input Input Data Element when trying to rename feature classes. I need to remove the 'Clip' suffix from all of them. Why exactly ...
0
votes
1
answer
27
views
Intersect operation giving Error 00840 (Value is not a Feature Layer) but only on certain inputs [closed]
I have a script tool in ArcGIS Pro v3.3 to loop through a geodatabase of polygon feature classes and intersect each of them with another polygon dataset and then do some additional processing. Of the ...
-1
votes
1
answer
23
views
Syntax Error when creating a loop for feature class conversion [closed]
I am creating a loop to convert shapefiles in a folder to a geodatabase. For some reason I get a syntax error near the not statement. When I remove the if clause the script works no problem. I want to ...
3
votes
1
answer
72
views
Preventing resulting shapefile being added to ArcGIS Pro map by ArcPy
I'm using ArcGIS Pro 3.0 and I'm running an arcpy script. My script runs on the current map as I have a call referencing it. It gets a list of the layers currently in the map and runs select by ...
2
votes
2
answers
54
views
Calculating M-values in specific coordinate system ArcGIS Pro
I have an issue with calculating M-values in ArcGIS Pro: I need to calculate them in a specific coordinate system.
For example, the M-coordinate of a first vertex is set to 0; next should be 0 + the ...
1
vote
1
answer
55
views
How to create new fields in one feature named after the values in another feature's field (based on a spatial join)
I am working in ArcGIS Pro.
I have created a fishnet layer over an area of interest. I have another layer that has text a field called 'main_rock' that records different types of geological units in ...
0
votes
1
answer
42
views
Unable to add a row field by field in ArcGIS Pro table using Python script [closed]
I have written a Python script that creates a table with at most one row. The user is prompted to input values for each field, and the table should be updated accordingly. However, while the code is ...
0
votes
1
answer
33
views
KeyError in Resample when using ArcPy [closed]
I have a folder of annual land cover .tif rasters that are 30m x 30m. I'm trying to resample them to 90m x 90m using a for loop that goes through the folder. I'm not sure if I'm missing anything. My ...
0
votes
1
answer
31
views
Parallelizing raster file generation in ArcGIS Pro [closed]
I am currently working on an a Python version of ArcGIS-Based Nitrogen Load Estimation Toolbox Developed for ArcGIS Pro called ArcNLET. I have a question regarding the Parallel Processing Factor (...
0
votes
1
answer
50
views
FeatureClassToFeatureClass Error 010273
I am trying to run the code below to import a feature service and then convert it to a feature class that is stored on my local database. The code is failing at the DelParcels section, but when I run ...
1
vote
2
answers
39
views
Calling second custom tool w/in main tool ArcGIS Pro
I have two tools in an .tbx in ArcGIS Pro, ToolA and ToolB. I want to be able to call ToolB within ToolA. I need to keep them separate because I need to use ToolB independently in some cases but as ...
0
votes
0
answers
19
views
Sharing information from one Experience Builder web app to another upon action
I have a master experience builder web app with a list of information like TYPE, ID#, link_to_child_web_app, etc.
The current workflow we use is, the user finds the entry in the list that they want ...
0
votes
1
answer
31
views
Using ArcPy to insert polygons
I am trying to insert three polygon into a shapefile. The goal is to use a function that will create the polygon. That way, I can pass the coordinates of the polygon into the function. I have read ...
0
votes
1
answer
55
views
Python Toolbox Parameter Validation Not running
I have a long and complex python tool. In brief, I can't seem to get the default values for my tool, or any parameter updates for that matter, to work through my UpdateParameters definition. ...
0
votes
1
answer
40
views
Convert attribute table to CSV using arcpy [closed]
How do I convert the attribute table of a layer in an ArcGIS Pro project to a CSV using ArcPy?
I need it as a CSV so I can work on the data in the layer in pandas. I'm working in ArcGIS Pro.
I know I ...
2
votes
1
answer
67
views
Unable to rename copied geodatabase [closed]
I have an existing script that copies a geodatabase to another location and renames it. It uses arcpy and os libraries to do it.
copy_from = r"C:\test.gdb"
copy_to = r"D:\test.gdb"
...
3
votes
1
answer
108
views
ArcPy - copy all elements (group layers and nested layers) from the TOC to another map
Aim:
I would like to iterate all group layers and layers in a given map within an ArcGIS Pro project and copy them to another map. Basically this can be done easily, but it gets tricky when copying ...
0
votes
1
answer
42
views
Adding multiple fields to feature class
I have created a simple arcpy script to add four fields (name, shapeArea, shapeLen, quantile, in that order) to a layer and to compute the values of shapeArea and shapeLen. Because I need to do this ...
0
votes
1
answer
42
views
for loops with listLayers
I have the following code to ouput all of my layers to pdfs. I'm trying to update the code from ArcMap to work in ArcGIS Pro. I'm not understanding the correct syntax to use for the curLayer line ...
1
vote
1
answer
35
views
ArcPy Update Cursor Output Order
I have a workflow that ingests a feature class, loops through with an update cursor, and then appends to an SDE table. The output feature order does not match the input order. I suspect parallel ...
1
vote
1
answer
66
views
Duplicating records by using column delimiter in ArcGIS Pro
In ArcGIS Pro 3.3, I have a shapefile where I need to create duplicate records (while preserving geometry per duplicated record) based on the values in a column. The table is structured similar to ...
0
votes
0
answers
37
views
arcpy.conversion.RasterToOtherFormat creates a black TIFF
I'm using ArcGIS Pro 3.3.0 on Windows 11
In below code, when I enable the arcpy.env.cellSize and arcpy.env.extent variables I get a black raster as output and it is the correct size and the correct (...
2
votes
1
answer
26
views
arcpy.ListRaster() returns all layer names in uppercase
This is an issue a coworker has encountered and i've diagnosed. We were trying to programmatically rename layers in an Enterprise GDB by replacing two different substrings, but it wasn't working, and ...
0
votes
0
answers
67
views
Using shapely from Python script tool in ArcPy with ArcMap
I have received a geoprocessing tool which references a python script. The script uses some methods from the shapely library.
I have tried putting the shapely library (version 1.6.0) directory and ...
0
votes
1
answer
23
views
Apply symbology to ArcGIS raster chart using stand-alone python code
I am trying to apply symbology to a feature class in ArcGIS Pro using python. When I use the following code in arcgis pro python window, it works fine and create a new symbology layer in the content ...
1
vote
0
answers
33
views
Python Add-in Shows up as Missing then Works after Logging in Again Through Citrix
I have created a Python Add-in that works well when installing it through the add-in installer or when adding the add-in directory folder to the registry string (Computer\HKEY_LOCAL_MACHINE\SOFTWARE\...
1
vote
0
answers
21
views
Determine whether "all records" were selected or "no records" using ArcPy [duplicate]
I'm developing a tool where a SelectLayerByAttribute is performed, and the selected rows are deleted.
arcpy.SelectLayerByAttribute_management(my_layer, "NEW_SELECTION", my_sql)
print(arcpy....
0
votes
0
answers
58
views
Using arcpy CreateDatabaseConnectionString to access feature class in Oracle database - why doesn't this work consistently?
I'm trying to find a way to access a feature class in an Oracle database through arcpy scripting, without having to be prompted to enter a user name and password after the script has started running. ...
0
votes
0
answers
32
views
Export the results of arcpy.ArcSDESQLExecute(egdb) to a DBF or CSV file
I was able to meet with one of my coworkers and he walked me through the steps successfully of arcpy.ArcSDESQLExecute(egdb). Now I am trying to export the SQL query results to a DBF or CSV file, any ...
0
votes
0
answers
22
views
Turn-off chart title with Python in ArcGIS Pro 3.2
I would like to maximize the size of the box-plot graphs by turning off the automatic Chart titles, which I don't need at all, so that I can print the 5 graph images pasted into the layout on 1 pdf ...
0
votes
2
answers
88
views
"AttributeError: ArcSDESQLExecute: StreamExecute ArcSDE Extended error 900 ORA-00900: invalid SQL statement" error when running SQL query via ArcPy
I am trying to run a SQL query in ArcGIS Pro ArcPy and I am getting errors. I have looked into the ArcSDESQLExecute sample query.
https://pro.arcgis.com/en/pro-app/latest/arcpy/classes/...
2
votes
2
answers
98
views
AttributeError: DescribeData: Method spatialReference does not exist when iterating listLayers()
I'm trying to run the following code in the Python window of ArcGIS Pro 3.2, just to quickly see how all my layers are projected, and I ran into a strange error which I can't solve.
aprx = arcpy.mp....
1
vote
1
answer
78
views
Overwriting feature layer using lyrx file
I am trying to come up with a method that utilizes lyrx files to routinely overwrite a feature layer on ArcGIS Portal. I've tried a few methods that utilize Python scripts, ModelBuilder and Task ...
0
votes
1
answer
49
views
How to highlight/visualize polylines one by one in a layer in ArcGIS Pro
I have a set of polylines as a layer in ArcGIS Pro in a table layer. I can highlight/visualize each polyline by clicking on the side of each row in the table. It is a time consuming process. I tried ...
0
votes
1
answer
45
views
Using search cursor or select for related table data in ArcPy
I am very new to ArcPy and code.
I have about 600 zones that overlay ~8000 different census blocks, which have been divided so that census blocks that aren't fully inside a zone are split, meaning ...
0
votes
1
answer
43
views
arcpy.management.Append() Only errors in Portal Notebook?
I am using our Enterprise Portal Notebook server to create a notebook of a toolbox that already exists, one that appends from an AGOL layer that has attachments.
We use the code:
with arcpy.EnvManager(...
3
votes
2
answers
151
views
Setting output raster bit depth using more efficient method than copy raster
I am looking to see if anyone has a more efficient method of setting bit depth for my output rasters than what I am currently doing. I am using ArcPy in ArcGIS Pro's notebook to create rasters from ...
0
votes
0
answers
25
views
Unable to export only matched features after AddJoin Common - ArcPy
The exported featureclass called 'output_feature_class' contains all of the features from the input feature class even after joined based on COMMON, only want common/matched records as output.
For ...
0
votes
0
answers
27
views
ExtractValuestoPoints reorganizes the FID from each iteration
I have a shapefile that defines a line with 10,000 points.
I am iterating over a set of rasters and extracting the raster value on these same points for each raster. The output feature dataset it ...
0
votes
1
answer
53
views
Unable to remove "SHAPE" from field list
I'm trying to list the fields of a feature class and then remove certain fields from that list, using a for loop, so that it can be used in a delete field tool. I have a list of fields I want to keep, ...
0
votes
2
answers
46
views
Identifying feature without creating separate output
I am using ArcGIS Pro 3.2.
I hoping to use the Identity tool to cookie cutter a buffer(layer B) into a polygon (layer A) without creating a separate output feature class. Currently I am using the ...
0
votes
0
answers
44
views
How to add topology to an existing feature dataset?
I have a GDB with a lot of data sets and layers(feature classes), I wrote a code to add a topology and validate a layer with that.
my code:
class Validate_Topology(object):
"""...
1
vote
1
answer
47
views
Create point along a line from multiple records in PostgreSQL
I have a dataset of motor vehicle crashes in PostgreSQL, and some of them are missing latitude & longitude coordinates, but I have the location based on the milepost of the roadway the crash ...
1
vote
1
answer
45
views
Inverted NDVI output using ArcGIS Pro [closed]
I am trying to perform an NDVI on multiple rasters in a folder. As I understand it, an NDVI output has a range of values from -1 to 1. Values 0 and above should represent vegetation and values below ...
1
vote
1
answer
67
views
Calculating search cursor/percentage using ArcPy
I work with zoning info and have a series of census blocks that are overlapped by a larger zone. I used the identity tool to split the census blocks so that where they overlap they are separated, ...
0
votes
0
answers
44
views
Cannot open xls file using Python in ArcGIS Pro 3.1.2
I have the following code:
import arcpy
arcpy.env.overwriteOutput = True
coordinates = r"C:\Tiedostot\folder1\coordinates.xls\Sheet1$"
print(arcpy.Exists(coordinates))
cursor = arcpy.da....
0
votes
0
answers
32
views
No border connections in OSM data
I used OSMNX to download States in Germany as well as surrounding States from other countries to do mobility-analyses. These States get merged back together in my GDB. However at borders (no matter if ...
1
vote
1
answer
46
views
Exporting MXD file from ArcMap to PDF using ArcPy not retaining embedded Excel tables when converted to PDF
How can I alter my script so that the Excel tables embedded in my MXD are displayed when converting to PDF?
import arcpy
import os
mxd_path = r"D:\CROQUIS_PYTHON\MXD"
pdf_path = r"D:\...