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
vote
1answer
9 views

Viewing entire Python script of process ( input settings and environment settings) in ArcMap

When you "copy as python snippet" from the results of a process, the script contains all of the input settings but does not contain the environment settings. Why is this? Is it possible to ...
1
vote
1answer
33 views

What's wrong with my SQL? Invalid Expression

I'm just trying to make it where the user types what county they want and the script selects those features. import arcpy County = arcpy.GetParameterAsText(0) arcpy.env.workspace = (GDB path) ...
0
votes
0answers
29 views

Running ArcGIS Pro ArcPy on latest PyScripter

Having PyScripter 4.0.0.6 x64 installed with ArcGIS Pro 2.5 I have set the I have add/set the arcgispro-py3-clone to Python Path like below but I am still getting this error message Traceback (most ...
0
votes
1answer
26 views

ArcPy scripts input/output [closed]

I have an ArcPy script, which I use with ArcGIS Pro. I use one feature class as input_feature, do some calculations and write results in another feature class (output_feature). Is it possible to use ...
0
votes
0answers
22 views

Viewing ArcPy code from results of process run [duplicate]

How do I copy the ArcPy code from a process I have run in ArcMap where I have run a process with specific environment settings etc (density of, distance to etc) so that I can run the same code ...
2
votes
0answers
28 views

Disconnect users who are creating locks on specific feature classes

I have a nightly Python script which updates some domains in a geodatabase. The domain owner is "AMIS". In addition to the AMIS schema in the geodatabase, there are other schemas. In order ...
1
vote
0answers
12 views

PackageMap script failed to execute in IDLE but runs in ArcMap Python window?

This runs in the ArcGIS Python window but not from the command prompt. This is probably a novice script kitty issue: import arcpy import os from arcpy import env env.overwriteOutput = True arcpy.env....
1
vote
2answers
37 views

Error: 'list' object has no attribute 'segmentAlongLine'

I am trying to trim each polyline in a shapefile down to the first 15 feet of each line. The segmentAlongLine method was suggested to me, but this code is getting the AttributeError: 'list' object has ...
0
votes
2answers
24 views

ArcPy exporting maps to PNG problem - raster DEM does not show up in exported map file

I sm using ArcGIS Desktop (ArcMap) 10.8.1 and PyCharm 2020.3.3. I'm trying to use a simple script to loop through a folder and export a PNG file for each MXD in the folder. The script works fine, and ...
0
votes
0answers
32 views

Does ArcGIS Desktop 10.7.1 work with Python 3.9?

I wish to install ArcGIS 10.7.1 on my laptop running Windows 10. It appears to install Python 2.7 as part of the process. However, I have Python 3.9 installed for prior course work. If 10.7.1 ...
1
vote
1answer
21 views

ArcMap 10.6; ERROR 000539: Error running expression: rcexec()

While running a tool box (connectivity index) I am receiving an error at the end; ERROR 000539: Error running expression: rcexec()!. Can anyone help me with it?
1
vote
1answer
38 views

Moving points 5 feet “downstream” along polyline using ArcPy

I've got a bunch of points that currently sit at the origins of a bunch of different lines. I need to move every single point 5 feet "downstream". I'm using ArcMap without an advanced ...
0
votes
0answers
13 views

Adding data from file path to ArcMap [duplicate]

I have the following problem: I have a list of file paths. The files in these paths need to be added to ArcMap. I would like to add these via Python. I know that ArcGIS Pro has a command ...
2
votes
1answer
46 views

Remove a Row in an attribute table using UpdateCursor?

I'm trying to create a piece of code to remove rows where the field "State_Name" equals Hawaii or Alaska from my shapefile's attribute table. I've tried two different codes and they both ...
0
votes
0answers
16 views

Remap 'NoData' values 1 using arcpy.sa.RemapRange

I'm trying to remap values of NoData to '1' using the arcpy.sa.RemapRange object. I understand there needs to be a range of values using [[startValue, endValue, newValue],...], however I'm struggling ...
1
vote
1answer
28 views

Moving Python script 10.3 to Pro. How do I know the script ran in Pro and not 10.3?

I have inherited a Python script that mosaics many files in 10.3. I normally run using IDLE outside 10.3. I don't code at all but am trying to learn so I can move the code to ArcGIS Pro to ensure we ...
0
votes
0answers
25 views

Slicing and indexing Numpy array [closed]

I created a numpy array from a shapefile using arcpy.FeatureClasstoNumpy array. It shows the following output: [(37.52978411, -109.5118741, 7.27) (37.52907474, -109.5073934, 7.36) (37.53024421, -109....
1
vote
1answer
57 views

Using Python or ArcPy to extract usable shapefile data from several hundred MXD files

I have several hundred (potentially more) old MXD files which were made to show grass areas to be cut along city roads. The employee before me opted to do these one by one and rather than create ...
0
votes
0answers
14 views

How to add exponential trend line to a semi logarithmic scatter plot in ArcPy? [closed]

I want to create a semi-logarithmic scatter plot and add an exponential trend line to the graph. I would also like to limit the x and y (log y) axes extent with their highest value. Also want to ...
0
votes
1answer
34 views

Clipping multiple shapefiles using ArcPy

I am fairly new to Python. I created a folder with 4999 bufferfiles. Specifically, there 5km radius buffer circles, and I am trying to use the clip function with the already made bufferfiles to clip ...
1
vote
2answers
34 views

ArcPy.da.SearchCursor not cursor-ing

I am using ArcMap 10.8.1. I have shapefiles that are a series of overlapping polygons of drone imagery footprints. I want to loop through each shapefile, and for every shapefile loop through and ...
0
votes
0answers
17 views

Converting mosaic to new raster of over 900 Esri grid files, located in separate subfolders, in Python [closed]

I have a folder containing 945 subfolders all starting as dtm_utm and ending with different random codes, as follows: dtm_utm01101, dtm_utm00731, dtm_utm012211, etc. Each of these subfolders contains ...
-1
votes
0answers
19 views

Getting overlapping polygon outside of the mxd template by using python code [closed]

I have this: Selected Area(red) + polygons as background: I wanted to create this layer by using python outside of the MXD tempate: And NOT this: How can I do this?
1
vote
0answers
34 views

Loop through folder and join pairs of files with the same prefix

I have two sets of shapefiles that I would like to join based on a similar field. They are all stored in a path folder which is stored as the variable "steps". One group of shapefiles are ...
0
votes
0answers
13 views

What is the field_map_name in findFieldMapIndex ()?

I am using ArcPy with ArcGIS Pro and FieldMappings. FieldMappings are fiddly and I'm struggling to understand a specific function. I need to replace an 'old' fieldMap with a 'new' fieldMap. FieldMaps ...
0
votes
0answers
16 views

Set a workspace inside a multiprocessing function inside a toolbox in ArcGIS Pro

I am trying to set a workspace inside a multiprocessing function of an ArcGIS Pro toolbox. It works perfectly in standalone script, but when I use it in a toolbox I get this error message: ...
1
vote
2answers
43 views

Outputting bookmarks in TXT file from ArcMap using ArcPy

The only output format permitted by the ArcMap bookmark manager (v10.7) is an "ArcGIS place file (*.dat)" which is not entirely human-readable when opened in a text editor. What is the file ...
0
votes
0answers
22 views

Dynamically update index layer for Data Driven Pages using ArcPy/Python

Is there a way to dynamically pull in a new index layer for a data driven page in ArcMap? Scenario: I have an MXD which will be my template. I am trying to update the index layer dynamically in Python....
0
votes
1answer
18 views

Exporting 3 layers together as JPEG using Data Driven Pages

I'm trying to use data driven pages to export JPEGs of features that share a common attribute. E.g. I have two point layers, "beach" and "light". And a polyline that connects them, ...
0
votes
1answer
45 views

Python script to import CSV data to a geodatabase

I am trying to import CSV data into an existing geodatabase in ArcMap. I want to import to the existing geodatabase fields to ensure my CSV data satisfies whatever rules are set up in the geodatabase. ...
0
votes
1answer
18 views

Select layer by location in ArcPy ERROR 000368 [duplicate]

I am trying to create a scrip that create a list of all features in my GDB, then select objects that intersect with a user given shapefile, and finally copy selected features to a new location. After ...
0
votes
0answers
17 views

Decimal disappears after calculation with CalculateField_management

I try to change the field name with the following steps: Add new fields Calculate new fields by making them equals to old ones Delete old ones As the new fields are not fixed, for example, some ...
1
vote
2answers
34 views

Split contents of dbase text field into words at “ ”, “-” or “_”, capitalise first letters, and replace “ ” with “_”

A shape file field has text with words separated by blanks " ", dashes "-" and underscores "_". I want to standardise the words to capitalise each word, and then replace ...
0
votes
1answer
15 views

Adding representation rule by object's attribute value in ArcPy

I want to add a representation rule for each object in a FeatureClass with ArcPy. I have 3 rules (B, F, T) as seen in the picture below: I know there is a command for it representation = "...
2
votes
1answer
33 views

Using ArcPy to get point from a cursor for input in arcpy.PolyLine()

I am using ArcGIS Desktop 10.8 Basic. I do not have access to a Standard or Advanced license for this. I want to use a point from a search cursor as an input for the arcpy.PolyLine() method. A second ...
0
votes
0answers
32 views

Exporting pandas dataframe as shapefile using ArcPy gives ERROR 000732

I'm trying to export my dataframe as a CSV file and as a shapefile. I'm able to export it as a CSV but get the following error on the last line: ERROR 000732: Input Features: Dataset in_memory\...
2
votes
2answers
39 views

Getting CSV export to have different delimiter using ArcGIS Pro

ArcGIS Pro, using Table to Table tool, I want to export to CSV. But one of my fields is a description field that often has commas in the content. When that is exported to CSV that uses commas as ...
0
votes
0answers
16 views

Modifying string in python snippet with an object

I am using arcpy to reproject a multidimensional raster, and I extracted the following snippet by running the tool in ArcGIS pro. This is the snippet: arcpy.management.ProjectRaster(input_file_path, ...
0
votes
1answer
30 views

Drawing complete graph in ArcMap

I want to draw a complete graph for these points with coordinates. In an ArcMap environment, can a complete graph be drawn with points?
0
votes
0answers
26 views

Cannot find cloned python arcgispro-py3 environment with conda env list

I am trying to clone my python environment that comes with ArcGIS Pro (arcgispro-py3 located in C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3) to a location I can access (I do not have ...
0
votes
0answers
21 views

TableToTable (CSV to GDB) with WKT column

I have a CSV file with a WKT column with LINESTRINGS as geometry. How do I setup the call to TableToTable() in order to directly "transform" that WKT column to a shape/geometry column (while ...
0
votes
1answer
19 views

arcpy.FieldMappings renames input fields internally

I'm trying to make use of Field mappings to merge many datasets into a new one... as per the manual. ... print (type(idealFieldList)) # class 'list' # let's prune the fluff ...
1
vote
2answers
39 views

Using ArcPy UpdateCursor to Update a field

In my data I have one field (L1_SOILTYP) and a new field I created (SoilClass). I am trying to use update cursor to assign classification values (1-17) based on the values found in the L1_SOILTYP ...
0
votes
0answers
22 views

Converting ArcPy fieldmap to pandas dataframe

I want to get a "snapshot" of a fieldMapping / FieldMap. How do I convert it to a pandas dataframe? My current approach is to fieldList = arcpy.ListFields(theFeatureClass) extracted = [] ...
0
votes
1answer
30 views

Resampling multiple images in ArcPy

I'm to resampling about 30 raster images to different resolution (2, 3, 4, 5 meters) using the ArcPy. I wrote the code but its giving result for one image. Here is the code: import arcpy, os arcpy....
1
vote
0answers
18 views

Arcpy SpatialJoin performed in_memory not returning any rows

Background: I am writing a tool to automatically project a layer (vector or raster) in ArcGIS Pro to its appropriate UTM zone. Approach: The entire UTM zone grid is stored in a geojson string inside ...
0
votes
0answers
17 views

Modify blob representation field data with ArcPy

I want to modify the data stored in the "Override" blob type field in ArcGIS 10.7 with ArcPy. When I use the search cursor, it finds nothing: data = row.getValue("Override") if ...
4
votes
1answer
61 views

Unable to process batch buffer using ArcPy

I'm trying to buffer multiples files at once using ArcGIS. My code looks correct until the last line where it returns error related to buffer tool. I've used this code. import arcpy import os from ...
1
vote
0answers
25 views

Process 100 of feature classes through script and fc name to end of each output

I have about 100 tiled 'area of interest' polygons in a geodatabase that need to be processed through my script. My script has been tested on individual tiles & works great. I need advice how to ...
1
vote
2answers
29 views

Adding variable number of layers with associated buffer distances with ArcPy for ArcGIS Pro

I am using ArcGIS Pro 2.7.2 I am not an experienced python programmer. My goal is that the user can select a various number of layers in the python tool and specify different buffer distances for each....

1
2 3 4 5
191