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
-3
votes
0answers
19 views

Batch clipping in ArcGIS Pro [closed]

Does anybody know how to create a script that would batch clipping all existing feature class’s layers (except a clip layer) from the Contents pane and add the output clipped feature classes into the ...
2
votes
1answer
22 views

How to access a “geoprocessing value object” when a row in ValueTable is empty (Python Toolbox)

I have a tool with a ValueTable consisting of two columns - text (GPString) and layer (GPFeatureLayer). When I fill the parameter with desired values (field names in the first column, some feature ...
2
votes
1answer
43 views

Making file path part variable using Python [closed]

I am creating a python script to help automate updates. I am just wondering does anyone know how to make part of my file path a variable, as each month the python script will run via a different file ...
0
votes
1answer
13 views

Adding column to attribute table indicating polygon each data point is in using ArcGIS Pro

I am working on a project linking ideas in Geology and Ecology. I currently have a map showing the geology of an area (polygon layer), with a points layer on top indicating the locations of data ...
2
votes
1answer
40 views

When calculating a field in an attribute table, how can I find one value out of many fields when every other field has a null value?

I have 4,018 rows of data with about 50 fields. About 45 of those fields are the same variable, but the data came from different layers, so out of those 45 fields, only one has a value for the row, ...
0
votes
1answer
29 views

Checking value of field based on conditional if statement using ArcPy cursors

I'm using ArcGIS desktop 10.6 and executing an arcpy script. I'm creating a script that checks an input shapefiles field values against a set of rules. To do so I've created 2 lists with unique values ...
1
vote
1answer
14 views

Exporting all pictures in Feature class as Raster Field in ArcPy?

I have received file geodatabase (FGDB) and it has images added in raster field type (in attribute table). I wanted to extract these images using ArcPy into the folder. Does someone have a solution? I ...
1
vote
2answers
33 views

ArcPy Spatial Join, use join geometry not target

My goal is to create a layer of lines representing the closest street segment to a set of points. The code: arcpy.SpatialJoin_analysis( target_features=point_req, join_features=...
0
votes
0answers
11 views

Exception has occurred: Execute Error ERROR 000622: Parameters are not valid ERROR 000628: Cannot set input into parameter Coordinate_System

Not sure what I am doing wrong. Keep getting this error: Exception has occurred: Execute Error ERROR 000622: Parameters are not valid ERROR 000628: Cannot set input into parameter Coordinate_System ...
0
votes
0answers
20 views

Reorder Layers In ArcGIS Pro using the moveLayer in Python Toolbox - strange results

ArcGIS Pro version 2.4.0 I am attempting to reorder a large number of layers within the current map using moveLayer (https://pro.arcgis.com/en/pro-app/arcpy/mapping/map-class.htm) and getting ...
2
votes
1answer
34 views

Use multiprocessing to speed up rebuild index in ArcPy

We are in ArcGIS 10.6.1 (on Windows Server 2012) and Enterprise GeoDatabase Oracle 19c (on Linux). I was wondering if it is feasible to use the Python's ProcessPoolExecutor to open two separate Oracle ...
-1
votes
1answer
19 views

Shortest path between two points via another point in ArcGIS Pro ArcPy [closed]

I am required to find shortest path between two points via another point in ArcGIS Pro using ArcPy.
1
vote
1answer
17 views

ArcGIS Enterprise weblayer sharing automation with WMS/WFS capabilities enabled using Python

I have to create web services on ArcGIS Enterprise (via ArcGIS Pro) that offer WMS/WFS capabilities from several hundred datasets coming from Enterprise geodatabases. While this is not a problem when ...
0
votes
0answers
29 views

Export to CAD error

I want to export to CAD the layers I select from the map screen using Python code. If there is no feature of the features I have defined in the code in the area I selected on the screen (I have ...
2
votes
0answers
42 views

Using ArcPy to fit polygons inside another one

I have been trying to solve a bin packing problem using a Python script I found, but when I try to use it I get an error that I don't know how to solve. The code that I'm trying to use is taken from ...
1
vote
1answer
21 views

ArcPy: Selecting feature class by attribute then copy selection to new feature class [duplicate]

Using ArcPy I want to make to do a selection on a feature class by field to select everything 0.1 or greater, then copy the selection to a new feature class. However, the output of my following code ...
0
votes
0answers
18 views

Display selected feature table in layout [duplicate]

l have table and want to display selected feature in layout (print version). When select other country (look image) show me these country data in print version. Mostly do this by copy and paste in ...
1
vote
1answer
23 views

Making vertical spacing between parameters smaller on ArcGIS Script tool dialog

I would like to make space between parameters smaller in ArcGis Script tool. For example, in the image attached I would like to make the distance between two parameter Standard terrain and User ...
1
vote
0answers
29 views

Creating parallel lines in Geographic Coordinate System using ArcPy?

I have a polyline feature class that is using GCS_WGS_1984 (code 4326). I am trying to create lines that are parallel to a polyline from this feature class at distance d. From some searching, I've ...
0
votes
0answers
14 views

How to get parameter popup in Python Add-in ArcGIS?

I would like to generate a tool in Python Add-in ArcGIS with the popup interface as image attached. I use the Add-in Button but when I click the Button, the parameter popup does not appear. This my ...
0
votes
0answers
21 views

How to add a save and load button in a Python-addin ArcGIS?

I would like to generate a tool in Python-Addin ArcGIS as the image attached. I also like to generate the save and load button in the tool. My purpose is that when the user chooses the range ...
0
votes
0answers
20 views

Memory issue loading raster into numpy array

I am trying to open a historical imagery tiff dataset into a numpy array so I can do some image processing on it afterwards. However, it gives me 'unspecified error' when trying to run the (very) ...
0
votes
0answers
13 views

Mapping and creating specific symbology in ArcPy

I am new to ArcPy mapping, I am trying to use it for plotting a raster map with only a legend that consists of 5 legend elements. My raster image ranges from 0 to 2000 but I don't want to use the ...
0
votes
1answer
30 views

Why does arcpy.Delete_management not work when published in web tool or Geoprocessing Service

I have a tool that I am publishing to ArcGIS Server and the tool runs fine except for one line result = arcpy.Delete_management(newfolder) if result.getOutput(0)=="true": message = "...
0
votes
0answers
15 views

Transforming raster in range of values from 3 to 8 into linear scale from 0 to 1

I am trying to convert a raster file with values ranging from 3.2 to 8.8 into a linear scale from 0 to 1. The conditions that i want to apply in the transformation are as follows: 3 to 5 gets 0, 5 to ...
1
vote
1answer
21 views

Saving band math output as TIFF using ArcPy

I'm trying to do some band math using ArcPy for ArcGIS Pro. I want the output to be a TIFF file. However, my following code is outputting in GRID format even though the input is TIFF. band1 = "C:\...
0
votes
1answer
56 views

Converting our Unicode to Persian in ArcGIS scripting by ArcPy

import arcpy import os from arcpy import env env.workspace=r'I:\amozesh\samplegdb.gdb' infeature=r'I:\amozesh\samplegdb.gdb\blocksclip' cursor=arcpy.da.SearchCursor(infeature,['layer']) cursor.next() ...
0
votes
1answer
23 views

Automate making imagery index layer

I am wanting to come up with a way to speed up my Imagery Index layer. To give you an overview I have about 500 imagery files. They cover extents all over Australia. I am wanting to create a shapefile ...
1
vote
1answer
28 views

Defining two workspaces in ArcPy

I need to first define the workspace where I can call my inputs from. I then need to define a geodatabase so all the outputs run from the tools are stored in that geodatabase. Any ideas? import arcpy ...
1
vote
0answers
17 views

for loop did not generate a 'BASIN' for each 'CROSSING'

My code is intended to delineate watersheds from a specified "CROSSING". The purpose is to obtain the total drainage area for a point on a stream/river labeled "CROSSING". My issue ...
0
votes
1answer
26 views

I want to Split by Attribute to run a function multiple times, but 'Id' is all 0?

I want to run my function over each feature in a point shapefile layer, but splitting by attribute returns the same number of points, because the Id field is all 0. Is there a way, using ArcPy syntax, ...
1
vote
1answer
31 views

Selecting features by year in datetime field

I have a shapefile with a datetime field. I want to split the features by year and save into a geodatabase. My approach has been to create a list of years, and from there iterate over the list and ...
1
vote
1answer
40 views

Updating Z values on points using UpdateCursor

I have created the following script, which moves the points from my_input_points_fc to my_output_points_fc by user input Furthermore, the z-values in my_output_points_fc should also be updated. ...
-2
votes
0answers
25 views

Add a dot in Latitude field

I am cleaning a dataset, in which i found many latitude values without dot. I know that all of them are missing the dot after the first number, and i would like to add it through python. Example: lat ...
0
votes
1answer
34 views

ArcSDESQLExecute is not able to DELETE rows in one database but works in other

I have two ESRI enterprise geodatabases on SQLServer: A and B. They are almost the same database (structure) I have this code snippet in python to deleted several rows from versions: def ...
0
votes
1answer
42 views

Converting ArcMap to ArcGlobe code using ArcPy

I have a code that should read the mouse coordinates, but it only works in ArcMap, can I somehow translate it into code for ArcGlobe, otherwise it gives an error: CreateObject cannot open map document....
0
votes
0answers
35 views

How to solve Error 000840 from arcpy.JoinField_management?

As part of a larger Python script, I am attempting for my last step to join an Excel file to a spatial layer. I was able to perform this step just fine in ArcGIS Pro Model Builder, but when I attempt ...
0
votes
0answers
21 views

Symbology Not Updating via Arcpy

I'm trying to update or change the symbology for two files that were created in a different part of a script. My understanding is that I can't change the symbology directly, but that I can update it ...
0
votes
0answers
26 views

Updating layer style with ArcPy for ArcMap

I have written a small script. I want to add a layer to the existing .mxd, change the style and export as pdf My code import arcpy mxd = arcpy.mapping.MapDocument(r"C:\Untitled.mxd") df = ...
2
votes
1answer
41 views

Using 2 different for loops in Python, skips second process

I am trying to do the following in Python 2.7: Clip all files in a geodatabase with a single layer (so a batch clip) Export the resulting clip layers (identified with _clip on the end of their names) ...
1
vote
1answer
33 views

Calculating dates and using arcpy.CalculateField_management(

I am in the process of converting my scripts from python 2.7 to 3.x I am trying to calculate a date field with a datetime object exactScriptTime = datetime.datetime.now() exactScriptTime = ...
0
votes
1answer
39 views

Is ArcGIS API for Python or ArcREST faster than arcpy.da for editing hosted features?

I have a large hosted feature layer on ArcGIS Online of 52,000 points. I have been building the feature layer over time by simply using the Append tool in ArcGIS Pro. Now I need to update some text ...
0
votes
1answer
22 views

Runtime error while adding a new field to the existing feature layer using Python

I have been trying to add a new field to one of my feature layers. And I keep getting an error and I can't figure out what is going wrong. I am attaching my code below for reference: When I changed ...
0
votes
0answers
54 views

Obtaining XY coordinate when clicking on the map

Work in ArcGlobe and I want to calculate the coordinates of the globe latitude and longitude, but the coordinates from the mouse click is read from the screen, not the globe, because when I clicked on ...
0
votes
1answer
71 views

Measuring distance in ArcGlobe using Python AddIn

I want to make a Python script that will calculate the distance of the line I drew and output it in a special form, but I can't figure out what I'm doing wrong. import arcpy import pythonaddins class ...
1
vote
0answers
32 views

Add Undo/Redo functionality in ArcMap to ArcPy script with manually started edit session

I've written a set of simple ArcPy scripts for use with ArcMap 10.5.1 in versioned PostgreSQL Enterprise geodatabases. They're loaded into an add-in toolbar and intended to be used like a speed dial ...
5
votes
1answer
91 views

Defining a Python function to calculate a value using multiple fields

I am using the Calculate Field tool in ArcGIS Pro to get it to calculate fire hydrant flow data. I need data from the table fields PitotPressure, COE, and HydrantOrificeFlowed in an attribute table to ...
0
votes
1answer
19 views

Convert Symbology to Representation in arcpy

I know in ArcMap 10.6, there is feature called : "Convert Symbology to Representation" which one can execute by right clicking on a feature class in Table Of Contents. I like to know how to ...
1
vote
3answers
55 views

Writing MakeFeatureLayer_management Where Clause With Multiple Mixed Values using ArcPy

I am trying to select certain points in a shape file using three different fields. Two fields don't need to vary, but the third one (the analog_years variable below) does. I want to be able to select ...
1
vote
0answers
19 views

Reloading aprx that has been modified using ArcPy with ArcGIS Pro

I'm writing a python script tool for ArcGIS Pro that uses a custom GUI created with pyqt. I would like the tool to be able to add and remove layers from the main map in the ArcGIS Pro project it is ...

1
2 3 4 5
187