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

Protecting ArcPy Files (.py)

I'm writing a program in ArcGIS with Python language (ArcPy). I would like to publish it as a commercial program, but ArcPy or ToolBox script is not secure, because ToolBox can be converted to .py ...
0
votes
0answers
16 views

Reading in SQL view as parameter for Python script tool [closed]

I have a toolbox that I've created with a python script that reads in a CSV, does some stuff, and then outputs a new file. I was wondering if it's possible to pass in a SQL view instead of a CSV. I ...
1
vote
0answers
28 views

Update features based on multiple GetParameterAsText

I am trying to figure out how to update feature attributes by user input parameters (GetParameterAsText). Current script the user inputs a arcpy.GetParameterAsText(can be multiple) then there is a ...
0
votes
0answers
21 views

Making group of layers in ArcMap using ArcPy [closed]

I created a script to check if the shapefiles loaded to TOC exist on my local drive, I've created empty group_layers and after the check, if they exist (I've created the script to search over 350 ...
0
votes
0answers
18 views

Error in updating SQL table by joining with ArcGIS table [closed]

I have created one table in SQL and another table in ArcGIS using python code. Now I am trying to update/fill a column in SQL table by joining it with ArcGIS table using common ID in the same code. A ...
0
votes
1answer
23 views

Reading values from file Geodatabase table and assigning those values to variable [closed]

I created a table using the zonal statistics as a table tool which contains some percentile values of a raster (90%, 75%, etc). The table is 1 row and contains the percentile values. I want to take ...
1
vote
1answer
22 views

arcpy.AddField_management does not work in tool, only in Python Interpreter

I am creating a tool in ArcGIS Pro where a part of the code creates a feature class (low_fuel_warning) and adds fields to it. When running the code in the Jupyter Notebook in ArcGIS, it works as it ...
3
votes
2answers
95 views

Calling specific row using ArcPy search/update cursors

When working with search and update cursors, how do I call upon a specific row? In this example: import arcpy, os # I want to find a row where the FID is 10 # print value field in the row where FID ...
1
vote
1answer
37 views

Changing upper break value to decimal using ArcPy with ArcGIS Pro

My ArcGIS Pro custom script tool is based off of a script that changes break values from a user's input. I believe I've done all I can troubleshooting the existing script. I'm suspicious of the tool ...
-1
votes
0answers
15 views

Debugging Error 000714: Error in script [closed]

I'm sharing an ArcMap toolbox which uses a script and reads parameters as text. While it works fine on my version of ArcMap , when I've shared the tool/script with someone else, they get the ...
0
votes
0answers
35 views

Using ArcPy SearchCursor and InsertCursor to Search, Copy and Insert Rows in Same Table

I'm new to ArcPy and really coding in general. I have three fields titled "Subcat_1", "Subcat_2", and "Subcat_3" all being used to categorize different themes of survey ...
1
vote
0answers
14 views

Remove or hide layers in geoPDF for PDF to TIFF conversion

I'm using arcpy to convert a collection of maps in geoPDFs to geotiffs using the PDFtoTIFF conversion. There are several layers in the geopdf that I do not want included in the output geotiff for ...
0
votes
1answer
30 views

Sharing Python Script Tool gives Error 000576

I'm distributing a Python script tool with folks outside of my organization. I had always assumed the .tbx file and the script were self contained. But when someone else tried to run the tool, they ...
0
votes
0answers
21 views

InsertCursor throwing "error return without exception set"

I'm trying write data to an Enterprise geodatabase but it still throws error return without exception set (for clarification - error throws row cursor.insertRow(data). I have method: def ...
1
vote
0answers
25 views

Using ModelBuilder of ArcGIS Pro to export Python to build REST service without using ArcGIS Server

I made a model using ModelBuilder in ArcGIS Pro and I exported it as a Python file. My model use a Digital Elevation Model and some layers like Forests, Rivers, Lakes. In the end, I get some areas ...
0
votes
0answers
17 views

Adding multiple records to related table using ArcPy [closed]

I have a feature class for paved roads and a related table for all the construction/treatments that have happened for each section of pavement. I need to add new records to the related table each ...
1
vote
1answer
19 views

ArcPy - Export to PDF - Script tool - What kind of parameter is a PDF output?

I am making a script to output an export to PDF. However, when parameterizing this function as GetParameterAsText () in the script in ArcCatalog, I don't know what type it is in "Data type".
0
votes
0answers
32 views

Realizing arcpy.mapping.MapDocument("CURRENT")

I am curious as to how arcpy.mapping.MapDocument("CURRENT") works. I used to execute highlight in the sub thread, but didn't work. Does it only work in the main thread (including arcpy....
0
votes
1answer
35 views

SearchCursor RuntimeError: Underlying DBMS error [ORA-00923: FROM keyword not found where expected]

I need load OBJECTID from remote DB but I'm still getting error: RuntimeError: Underlying DBMS error [ORA-00923: FROM keyword not found where expected] [SDEDO.E_EL_TU][STATE_ID = 22362] I don't know ...
0
votes
1answer
22 views

UpdateCursor gives RuntimeError that column does not exist

I have managed to get my previous update cursor to work without any hiccups. All I have done is change the fields the script needs to look for. The error I am getting is: RuntimeError: A column was ...
0
votes
1answer
34 views

Returning existing field words using ArcGIS field calculator

I need to write a script. The image below shows the data that I am working with. I would like to add the data from the field Frost_Corr for the remaining fields in SubTrp_Cor. For example where it ...
1
vote
0answers
24 views

Calculate field on the fly with field values from another overlapping layer [closed]

I am really new to ArcGIS Online and the first steps in coding. I created a webmapp app: users can create clinics (as points) and each time they create a new point they have to choose in a list the ...
0
votes
0answers
27 views

Setting field type when outputting CSV from table to table using ArcPy

I'm using arcpy.TableToTable_conversion() to convert a shapefile to CSV. In the shapefile, there is a field representing block group FIPS code as a string: 550791007004003 But it's getting output to ...
0
votes
2answers
34 views

Adding new value in attribute field based on existing value using ArcPy

I am looking to automate the filling of a new column in an attribute field depending on the data that already exists within a column. The issue is that we obtain the data from the local council and ...
0
votes
1answer
27 views

Why geoprocessing changes output spatial reference, when input is geometry object?

I am trying to write an ArcMap 10.6 Python add-in, which cuts narrow places of polygons. In the script I work with geometry objects. Testing my add-in I noticed, when I use geoprocessing tools with ...
0
votes
0answers
26 views

arcgisscripting.ExecuteError: ERROR 160213: A networking error occurred

I'm trying to create a script to update a service on my ArcGIS Online account weekly but I've hit a road block when uploading. I thought at first it was that the service was too big, but I have now ...
0
votes
2answers
35 views

Turning off Labels using ArcPy

I am outputting a set of maps with various layers and baselayers. On some of these I need to turn off the labels to reduce the noise and to see the baselayer with no obstructions. I cant seem to ...
0
votes
1answer
24 views

Sharing toolbox with Python script tool for ArcMap

I have a toolbox (several different parameters) that I created using a python script. The tool is meant to be run in ArcMap. In short, how do I share this tool with other people? I tried to read ...
0
votes
2answers
24 views

Set classificationField property to read a list of fields

I'm working in an ArcGIS Pro 2.8 Notebook. GOAL: How would I set the classificationField property to read a list of fields? I believe this is a python matter more so than arcpy. My whole script is ...
0
votes
0answers
22 views

Setting a .sde connection file as a default value in an ArcPy toolbox

I am building a tool to run some routine data maintenance on an Enterprise geodatabase with Python. I would like to set the default value for one of the parameters to database connection file on disk. ...
0
votes
0answers
17 views

Error 010240 - Could not save raster dataset

I'm working on some code to automate a Monte Carlo Simulation on my raster sets. It runs through my for loop once but on the second attempt I get the ERROR 010240: Could not save raster dataset to ...
0
votes
2answers
27 views

Customizing DateTime field in ArcPy data management feature

I have a table in SQL with one column TIMESTAMP which shows the date/time in the following format. 2019-05-31 08:09:20.000 In order to process the data in ArcGIS, I created a new table in ArcGIS. To ...
1
vote
1answer
26 views

ExportToPDF hangs in ArcGIS Pro

Several tools used throughout my organization use ArcPy's ExportToPDF method. A couple of weeks ago, when we upgraded from 2.7.x to 2.8.0, these tools stopped working (for myself and other users). ...
4
votes
2answers
139 views

Detecting ArcGIS Pro version using ArcPy

Is there a Pythonic way (e.g. arcpy, os) to detect which version of ArcGIS Pro is installed on a machine (e.g. 2.8.1 vs 2.8.2)? I found a similar question for ArcPy in ArcMap (Detecting format/version ...
0
votes
1answer
20 views

Errors with MakeXYEventLayer_management

Here is the code: import arcpy arcpy.env.overwriteOutput = True # ----- # arcpy.CreateFileGDB_management( r"C:\Users\Gdozier\Documents\Folder4", "Lab4GDB" ) # ...
0
votes
0answers
22 views

Spatial Join in ArcPy - one point shapefile to multiple polygon files

I want to join a point file to many polygon files (i.e. different shapefiles) using a spatial join. Trying to do this in ArcPy via this script. My thought was that the script would do a spatial join ...
0
votes
1answer
39 views

Randomly subsetting x% of polygons where attribute value=x for a large feature class using ArcPy

Referring to this topic: Randomly subsetting % of polygons by class/attributes using ArcPy...I am trying to randomly subset a % of polygons based on an attribute that they all share. For example, I ...
0
votes
1answer
45 views

DLL error listing domains in Python script

There is a Python script intended to create a UPDM geodatabase, it receives several parameters, among them, database admin user, database dataowner user, and their passwords. The script runs using the ...
0
votes
1answer
29 views

PythonWin not running

Can anyone help? Since moving from Arcmap 10.7 to 10.8 (running Python2.7.18 (v2 ) Window Pop Up message reads:
1
vote
1answer
41 views

Creating password for a Python file without encryption

I am attempting to create a password to lock a python file for a script tool I am building out in ArcGIS Pro. I am not worried about the password being visible in the script itself, since I am able to ...
0
votes
0answers
24 views

Using arcpy.mp to export layout to PDF seems to get stuck

I am preparing for upcoming redistricting and need to make about 200ish maps, one for each new district. Obviously, this is something I would like to automate. I have a working script that achieves ...
1
vote
0answers
39 views

Updating a big table using UpdateRow cursor and grouping by values from a cell

I'm working with a big table in ArcGIS Pro, with data based on cells and date, to estimate population values at the end of different days. For that, I use official population data on the first day, ...
0
votes
0answers
45 views

arcpy.mapping.MapDocument("CURRENT") not working in sub thread

I want to create a customize tool in ArcMap by Python Add-in wizards.I found that arcpy.mapping.MapDocument("CURRENT") does not work in the sub thread. How can I call main thread to execute ...
-1
votes
1answer
27 views

Python script tool gives IndentationError in ArcMap

I am trying to use my Python script for Merge in ArcGIS as a tool. (to use this script in model) But it occurs an error (below figure). I don't know what problem is... Python script : work in ArcGIS ...
4
votes
2answers
102 views

Using Python Toolbox Parameters

I want to specify an input for each column of the 'field compare' parameter, so it would be 'baseFeatures' would link just to the 'Base Fields' column and 'updatedFeatures' would just link to the '...
1
vote
1answer
23 views

Is it possible to control which record is deleted by arcpy's Delete Identical tool?

I am revising a script that feeds earthquake data from the USGS's API into a geodatabase. Until recently, I had used arcpy.DeleteIdentical_management with a single field as the argument (the quake ID):...
0
votes
1answer
20 views

Getting Domain Usage using ArcPy

Using this code I am able to list all domains inside my GDB import arcpy ws = "C:\\data\\water.gdb" domains = arcpy.da.ListDomains(ws) for domain in domains: print('Domain name: {0}'....
0
votes
0answers
33 views

Gaps appearing in results when converting CSV to points shapefile

I'm trying to process a bunch of CSVs into point featureclass shapefiles in arcpy. The following is my code: myCSVs = arcpy.ListFiles("*.csv") # Get all relevant CSV files for i in myCSVs: ...
2
votes
1answer
29 views

ParseError in Script for GPX to Features in ArcMap

I am trying to run the "GPX to Features" tool in ArcMap 10.8 to convert tracks from a handheld Garmin device. Here is how I ran the tool: inGPX = "C:/Users/Admin/Desktop/EMR/...
0
votes
1answer
36 views

Modifying text box in layout view through ArcPy with ArcMap

I have the following textbox in a layout view: Is it possible to modify the text through ArcPy? I made that box as text, and it has no function added to it: I just want to change the date so that ...

1
2 3 4 5
195