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
0answers
32 views

Using ArcPy to find duplicate values in feature class

I am trying to create a toolkit to find duplicate cable values in a Feature class. I have an shp layer named Fiber_Cable stored in an sde database and I want to iterate over it to find duplicate ...
1
vote
0answers
17 views

Grabbing SHAPE@ token with index for clipping raster using ArcPy with ArcGIS Pro

I have written code that selects rows of a buffer shapefile based on that file's intersection with a polygon that represents the extent of a raster. In the photo below, the code selects all of the red ...
1
vote
1answer
21 views

Using ListFields in ArcPy with ArcMap

I am having trouble getting the List Fields function to work. I need to search through a number of shapefiles located in different folders to list the fieldnames so I can see what are common naming ...
3
votes
1answer
28 views

Replace multi line Text_Element code runs without error but does not replace the text

I am trying to replace a single, 3 line text elements in ArcGIS Pro 2.8.3, with a new, single 3 line text elements. The existing text looks like this in the layout: NATIONWIDE PERMIT 3 COD ART RANK ...
-1
votes
0answers
5 views

I want to access data from sqldatabase and run program independently/outside arcpro environment. Script is running fine within pro python window [closed]

Pyodbc installed but still showing database connection error outside python environment.
0
votes
1answer
22 views

Upload shapefiles to ArcGIS Online using Python script on computer without ArcGIS Pro installation [closed]

We are trying to automate the upload of shapefiles to ArcGIS Online using a Python script. This script will need to run on a (virtual) computer that does not have an ArcGIS Pro installation. We have a ...
0
votes
1answer
17 views

Automatically draw/place labels with photos in ArcGIS Pro [closed]

A question in two (related) parts: Part one: is there a way to automate the drawing and placing of 'labels' for points, consisting of a caption and an image? The caption would be taken from an ...
0
votes
0answers
17 views

Looping through all layers in Esri feature server

Because multiple layers aren't handled by the ESRIJSON driver. I have to query layer per layer. source I need to loop through all my feature layers, To generate a GeoPackage file containing all ...
0
votes
1answer
26 views

Displaying geometries in ArcPy with ArcGIS Pro [closed]

I'm having an issue displaying a geometry in ArcPy. I'm not sure if it's my code or if it's a setting in ArcGIS Pro. The code runs successfully yet does not display the geometry. Thoughts? I was in ...
2
votes
1answer
50 views

How do you compare all fields in multiple feature classes?

I have two features classes that should have the exact same fields. There are over 500 fields, I am looking for a code that will compare the fields and identify if there are fields in either feature ...
0
votes
0answers
18 views

ArcGIS Pro Append Issue (field contains both text and numeric values) [duplicate]

I've got a workflow that appends values from a CSV file into a geodatabase table. Using field mapping, I've got the CSV column mapped to a text field. The issue I have is that the CSV column ...
2
votes
3answers
47 views

Changing a layer's label font size using ArcPy

I'd like to increase the font size of my layer "Grid". The field is "MAPSHEET" on Grid's attribute table. I've tried all sorts of ways to write it out in code to no avail. I'm ...
2
votes
1answer
52 views

ArcGIS Python Toolbox - Reordering parameters and reference by name instead of index

Is there a way to reference parameters in an ArcGIS Pro Python Toolbox by name, instead of by numeric index / positional argument? I built a data entry tool in a Python Toolbox that has over 100 ...
0
votes
0answers
16 views

RasterCalculator Not defined even thought imported arcpy library

I get an error message saying that "RasterCalculator is not defined" even though I have imported everything from arcpy.sa. Why is this happening? Code: import arcpy from arcpy import env ...
0
votes
1answer
47 views

Why does list.remove() not remove all items that meet the condition?

I have a bunch of feature classes in a geodatabase, and some of them are empty. I want to generate a list of all feature class names, and then remove the names of any feature classes that are empty. ...
0
votes
0answers
16 views

Using ArcPy to adjust graduated color symbology

I need to create a number of maps showing graudated colors based on different fields from layers across a few data frames. I have all layers symbology set to graduated colors but have encountered an ...
1
vote
0answers
18 views

Creating a Multi-Step Spatial Join Tool Script (One point file to many polygons) with one point output

I am wanting to create a ArcPy Tool Script that will join a point file to multiple polygons. Ideally, the point file (input_fc) would be a parameter so it can be interchangeable. Then the polygons ...
1
vote
1answer
23 views

Testing if two different rasters have overlapping data (not extents) before using raster calculator tool in ArcMap

I am writing a toolbox script that will generate a difference surface using the raster calculator in ArcMap by subtracting a raster of interest from many other existing rasters, then outputting the ...
0
votes
0answers
29 views

Use Existing AGOL Hosted Feature Layer in Standalone Python Script

I have written a Python (Python 3 for ArcGIS Pro) script to update a layer using values from a CSV table. The script works fine and I have a workflow that will allow me to overwrite a hosted feature ...
0
votes
0answers
27 views

Iterating through shapefile and appending each row separately to existing shapefile

I am attempting to iterate through each row of a shapefile, run a process on it (finding the nearest point from each in_feature to the closest near_feature) and then appending each row to the ...
0
votes
1answer
24 views

Automate convert floating point raster files (Tif extension) to polygon

I'm trying to automate the conversion of raster to polygon and the raster files are in "TIF" format which is a "floating point". I copy the code below from raster to polygon ...
0
votes
0answers
20 views

Processing Extent in ArcPy with polygon to raster

I want to do a multicriteria analysis. To do that I have buffered layers that I want to convert to rasters, but I want to set a processing extent and make so where the buffer area is gets value 1 for ...
1
vote
1answer
32 views

Updated JSON not showing up in feature layer properties on ArcGIS Online

I wrote a script that will automate the overwrite feature layer process using a map object in ArcGIS Pro. When changes are made to the underlying data they show up on AGOL after running the script. ...
2
votes
1answer
32 views

Getting midpoint of rectangle polygon lines on shortest lines and saving as points using ArcPy with ArcMap

I'm trying to understand ArcPy. My first task is to put a point at each end of a trench. Each trench is a polygon, a rectangle, the points therefore should be located at the midpoint of the two ...
0
votes
1answer
18 views

Using ArcPy & UniqueValueRenderer to assign specific colors to points based on value

I have code that amends the symbology of a layer in ArcGIS Pro 2.9 via an IDE. Everything works apart from the color of the points, which appear to be being picked at random (different every time I ...
0
votes
0answers
31 views

ListFields in Feature Classes in Multiple Feature Datasets in Oracle SDE

I need to create individual reports for feature classes that contain the field "FACILITY_STATE" AND "FACILITY_STATE = 'PPC'". These feature classes span multiple feature datasets ...
1
vote
0answers
13 views

Converting labels in line shapefile to annotation using ArcPy with ArcMap

I need to convert labels on multiple shapefiles containing streets, to annotations. I browsed for some time and almost every post refers to Tiled Labels To Annotation (Cartography) function (...
-1
votes
0answers
26 views

Using Map Series to save each layer as aprx project using ArcPy

I am trying to save the map series as an individual project but I am not 100% sure if that is possible I have tried a bit of code in order to loop and save the map series but im exporting everything ...
0
votes
0answers
32 views

Create geoprocessing tool using ArcPy that buffers multiple inputs and then merges and dissolves them into one final output

I am trying to create a geoprocessing tool in ArcMap by way of Python that will accept multiple inputs (points, lines, and polygons) buffer them based on user input, and then take the results and ...
0
votes
0answers
15 views

Jupyter notebook magic commands fail in ArcGIS Pro

When I run a Jupyter Notebook in ArcGIS Pro 2.8.3, magic commands do not work. For example using: %magic Produces: --------------------------------------------------------------------------- ...
0
votes
0answers
22 views

GP Service does not update next dropdown list based on previous entry [duplicate]

I have created a tool that takes a numeric value as an input and it creates that many lists according to the first value. It works in ArcGIS Pro desktop however it does not work in WebAPP GP service. ...
1
vote
0answers
23 views

Generating complex legend with specific layout using Python script in ArcMap or ArcGIS Pro [closed]

Aim I need to generate complex legend with specific layout using Python script. Either using built-in legend / graphic elements or generating features in new geodatabase and data frame. It is possible ...
1
vote
0answers
13 views

ArcPy select by attribute fails with invalid syntax error message [duplicate]

I am trying to use ArcPy with ArcGIS Pro v 2.8 to select by attribute from two different attributes in a shapefile. My code fails with a ERROR 000358: Invalid expression. I have used ModelBuilder to ...
1
vote
2answers
45 views

Updating first occurence of duplicate with lowest value in given field using ArcPy cursor

I have a few hundred GPS data points (saved in an ArcGIS Pro 2.9 file geodatabase) that logged simultaneously with different speeds. I am looking to write a Python script that will compare each row's ...
0
votes
0answers
44 views

Setting ArcPy environment param takes long time

I am facing some performance issue with this code running on ArcPy from ArcMap (so Python 2.7): import arcpy import time start = time.time() arcpy.env.scratchWorkspace = 'c:/Temp/scratchoutput.gdb' ...
0
votes
1answer
38 views

Implementing FieldMapping parameter in ArcGIS Pro Python Toolbox tool to map fields in two tables

I am trying to create a tool within a python toolbox in ArcPro that will accept a table and a featureclass and allow a user to map the fields from the feature class to fields in the table. Ultimately, ...
0
votes
0answers
20 views

Dropping and reloading layer on Enterprise/SQL Server

I use ArcPy's MakeXYEventLayer_management and FeatureClassToFeatureClass_conversion tools to generate a feature class from a CSV file. I host this layer on a SQL Server Enterprise Geodatabase, and I ...
0
votes
1answer
38 views

Extracting name of layer in ArcGIS Pro project using ArcPy

I am trying to use ArcPy to create a data catalog of ArcGIS Pro projects. Does anyone know how to extract the actual name of a layer (the name in the GDB) not just the alias? This is my code so far ...
-1
votes
0answers
28 views

Creating dimension feature using ArcPy with ArcGIS Pro

I am new to developing in ArcGIS Pro. I am trying to create dimension feature using ArcPy but I don't know how, I already created polygons and polylines but when it comes to dimensions I couldn't find ...
1
vote
0answers
21 views

Layer and Buffer Creator - custom method

I am trying to make a script function that creates layers for further use to buffer the layer. My code doesn't give me any error but neither any buffered layer. My code is below: import arcpy from ...
1
vote
0answers
37 views

Taking min and max values out of certain polygons

I have taken out DEM data over a specific area and converted the raster to polygons. Now I want to code so I get the max value and the min value of "gridcode" of every set of polygons that ...
-1
votes
0answers
31 views

Using Anaconda3 Environments and the ArcGIS & ArcPy Modules

I am having trouble understanding where I am going wrong here. What I am attempting to achieve is as follows: I have developed a stand-alone python2 script that allows me to export a layer as a ...
0
votes
1answer
41 views

ArcPy method for amending layer symbology heading

Is there an ArcPy method for amending the heading of a layer's symbology without having to amend the field name (which would be problematic)? I know how to change the layer's name & the ...
2
votes
2answers
75 views

ERROR 000732 - Dataset * does not exist or is not supported Failed to execute (CopyFeatures)

My main goal is to export a layer from ArcMap as a shapefile and upload it to AGOL. However, I am stuck at this intersection. All my scripts work in the python console within ArcMap. However, I cannot ...
5
votes
1answer
205 views

VS Code Intellisense with modern arcpy syntax

Does anyone know to get VS Code's intellisense to work with modern arcpy syntax? This post addresses VS Code not recognizing the correct interpreter at all: VS Code autocomplete for ArcPy But that isn'...
0
votes
0answers
23 views

How to loop through multiple gdb's and shapefiles in ArcGIS arcpy

I am trying to get my script to loop through a folder of shapefiles and a folder of gdbs. I need it to compare the name of the shapefiles and gdb's and if they match to continue on to loop through the ...
0
votes
1answer
37 views

Adding name of FeatureClasses to names of joined fields using ArcPy

Using ArcPy, how do I add the name of FeatureClasses to the names of the joined fields? This is my code which I think helps explain what I am looking for. ----------------------------------------------...
0
votes
1answer
33 views

How to summarize fields of multiple feature classes using ModelBuilder or Arcpy?

I'm new to ModelBuilder. I have created a script in python that gives results for each month, using ModelBuilder how can I make a sum between each field of each month of the year to have a single ...
3
votes
2answers
115 views
+100

arcpy.da.InsertCursor - Objects cannot be updated outside edit session in ArcMap10.8

I am trying to copy features from a Feature Class in a GDB to a Feature Class within a Feature Dataset (Turn_Restrictions that is created by the Network Analyst process [i.e. arcpy....
1
vote
1answer
47 views

Automating input variable of ArcGIS Pro ModelBuilder

Every day I get a new geodatabase that I have to manually input in the shown ModelBuilder to produce a report. I would like to automate the input process, so the ModelBuilder would locate the new ...

1
2 3 4 5
198