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
44 views

Conditional Reclassification using Raster Calculator

There are several questions about conditional reclassification on the Stack Exchange, but I haven't been able to find exactly what I need... In my workspace, I have a list of raster layers (8 bit ...
0
votes
1answer
37 views

Python 'print' isn't working in Catalog

What I typed and what I got: >>> print 'hello world' Runtime error Traceback (most recent call last): File "<string>", line 1, in <module> AttributeError: 'geoprocessing sys....
1
vote
1answer
18 views

Saving outputs from arcpy.da.Walk to the same folder

I have a number of sub-directories within my "BP Tiles" directory. Each of these sub-directories represents a different year (2016, 2017, 2018, etc.) and within each of these sub-directories is a list ...
1
vote
1answer
35 views

Multiprocessing ERROR 000210 Cannot create output 'name' Failed to execute Intersect

I am trying to use multiprocessing to process intersects between polygons and points for a list of states and territories (the data sets for the points are large, so my hope was that the ...
2
votes
1answer
70 views

Checking Points within polygon and assigning value using ArcPy

How can I write arcpy code to determine if the points of a point feature class are inside polygons of a polygon feature class and write the result (true/false) to the point FC's attribute field? I ...
1
vote
0answers
23 views

arcpy FeatureClassToFeatureClass fails with “Could not write value to output field”

I have a Python script using arcpy for ArcGIS 10.7.1 that is failing on the FeatureClassToFeatureClass line, below. These three lines are quite straightforward: Add a TEXT field, give the literal ...
0
votes
1answer
46 views

Arcpy Export Raster Data

Question: Is it possible to automate the functionality of right-click layer in TOC > data > export raster using arcpy in ArcGIS Pro? Specifically including the clipping extent options? I have reviewed ...
0
votes
1answer
24 views

Splicing a string and adding a charcter with update cursors issue

I am new to python, so I am trying to figure these things out on the fly so please bare with me if this is an easy task. I am using the name of my Feature Classes to populate an attribute field with ...
1
vote
0answers
14 views

Moving points in ArcPy given complex requirements (Looping through polygons and extracting data) [closed]

How do I loop through a set of polygons in arcpy, using those polygons to extract other data such as points and other polygons? (which I can then run analysis on)
0
votes
1answer
34 views

arcpy.importDocument of ArcGIS Pro not working on specific MXD and not throwing error

I have a script that imports every MXD in a folder to an empty ArcGIS Pro project, then use saveACopy to save to a new project file. The problem is: The script just stops working every several MXD. ...
2
votes
0answers
16 views

My AddLayer script doesn't work within a model but works well on its own

I'm trying to write a script in order to add a output to display (For some reasons I want add the data using a script) This is my script: import arcpy.mapping as mapping mxd = mapping.MapDocument("...
1
vote
1answer
163 views

How to resolve AttributeError: 'list' object has no attribute 'listLayers' in Python 3 for ArcGIS Pro?

I have written several scripts for ArcGIS Pro and this error shows up occasionally and stumps me: Traceback (most recent call last): File "<string>", line 10, in <module> ...
1
vote
2answers
42 views

Using arcpy search cursor to relate a .csv and a .shp?

I'm trying to write a script that relates data from a .csv file to a utility pole shape file. Basically, we want the script to iterate through the pole # fields in each table and determine which pole ...
0
votes
0answers
47 views

ArcGIS pro Runtime Error: Cannot open shape file through Python Add-In

I am facing runtime error while running this Python script as an extension to ArcGIS Pro version 2.522081 I also checked for minor errors and typos in the script, have gone through the documentation ...
0
votes
0answers
22 views

Flip Road-Lines based on the direction of apparently parallel DrainageLines derived using DEM

I have 2 FeatureClasses one is road lines (Red coloured as shown in the attached image) with random digitized direction and another is drainage lines (Blue Lines) derived using Raster DEM with correct ...
1
vote
1answer
43 views

How to add geometry to current section in arcpy?

I looping through feature class. I want select the features that are 3 meters distance but not intersected features. I know we can do by select layer by location or attribute. with arcpy.da....
0
votes
0answers
23 views

Error handling for comboboxes in a Python Addin using ArcGIS for Desktop 10.5

I'm creating an addin that contains two comboboxes and a button, the latter of which adds data to the current map based on user selections in both comboboxes. Both comboboxes have pre-defined lists ...
0
votes
0answers
24 views

Impossible to access to select-layer-by-location result in an ArcGIS Pro script

I'm using ArcGIS Pro 2.5 with basic licence. I'm trying to select some polylines with another set of polylines recursively, if they're close enough. For this purpose, I use Select_layer_by_location ...
1
vote
0answers
27 views

how to run batch process for vector shapefiles

I am kind of new at this. I ran a gis operation using python, where by I performed euclidean distance for specific state road, river and towns data and reclassified them showing good and bad areas ...
4
votes
1answer
48 views

SQLite create view syntax error in ArcPy Python script tool only

I'm working with a SQLite database in a python script tool in ArcGIS Desktop 10.4. When I try to create a view on the database in SQLite Studio (using the sql_file pasted below) or from the command ...
1
vote
1answer
31 views

Delete all files in a directory, except files with a specific string

At the end of my script I want to delete all my temporarily created files in a directory. For this purpose I write all files into a list and look in the elements to see if it has the string "final.shp"...
0
votes
0answers
16 views

Using laszip64 with arcpy, urllib, and subprocess modules

I'm trying to use laszip64 in a python script to convert .laz lidar files to .las as part of a larger automation project. I have no problem using the utility in cmd but I can't seem to get it running ...
0
votes
0answers
55 views

Iterating through an Index Layer using arcpy ArcGIS Pro

I have one layout and 2 map frames with an index layer. I want to create a map series where frame 1 iterates the odd numbered pages and frame 2 iterates the even numbered pages so it will look like ...
0
votes
0answers
33 views

Determine if a raster layer exists in a file geodatabase

I'm trying to determine if a layer file already exists in a given file geodatabase using arcpy.Exists. I wrote a code that works without problems for Feature layers, however it doesn't work for ...
0
votes
1answer
29 views

Expression for “SelectLayerByAttribute_management” with value of a cursor in the field name?

Within a script I create a new file, which has a dynamic value in the attribute name. This also changes the name of the attribute [FID] in each file. During a query in a file I have to use this ...
0
votes
0answers
8 views

Detecting how far a river runs along a boundary between two administrative regions when digitisation errors mean they do not coincide

I am trying to find the lengths of rivers within and on the boundaries of administrative areas ("districts"); I need to distinguish between the length within districts and the length along boundaries (...
1
vote
1answer
54 views

Using two map frames on one layout in ArcGIS Pro with ArcPy

I want to create a map series that exports two different sheets on one page. For example Page 1 would have sheet 1 & 2 and Page 2 would have sheet 3 & 4. I used to do this with python in ...
0
votes
0answers
27 views

Runtime for Qt QML Module Not Found

I have installed Qt and the ArcGIS Runtime for Qt on my windows machine. I ran the post install tool to specify the Creator and cmake locations. This seemed to be successful as when I create a new ...
0
votes
0answers
12 views

ARCGIS-Slope map with different X and Y cell resolution

I have a tif DEM with different resolution in X and Y : cell size x =0.000222222222222222 cell size y=0.000111111111111111 with col=4501 and row =9001. The resulting slope map that I have is a tif ...
1
vote
1answer
27 views

Add a field value to a polyline that's generated from an cursor.insertRow in Arcpy

I have a feature class that is built using the calculated values along two lines. I am trying to add a new column with a value from each line but am not able to. I have a list that looks like ['...
0
votes
1answer
124 views

ArcGIS Pro Python Interpreter Setup with Visual Studio Code

I'm fairly new to Stack Exchange and not very well-versed in IDE's. I'm struggling to set up the ArcGIS Pro Python interpreter with Visual Studio Code. I have ArcGIS Pro 2.4.3 and VSC 1.44.2. I'm ...
0
votes
0answers
27 views

Creating Rasyer object from .adf file using ArcPy gives ERROR 000732

I am trying to use Raster class in Arcpy, to create a raster object from a .adf file My folder contains all the related .adf files but I am unsure how can I "point" the correct one to create the ...
1
vote
1answer
23 views

Publishing multiple CSVS as uniquely names feature services

I'm supposed to publish each file as a uniquely names feature service, but despite my approach I keep having issues where my csv files aren't found... a friend advised me to add my initials to each ...
0
votes
1answer
40 views

RuntimeError when adding shapefiles using addDataFromPath in Python

I am attempting to take a SHAPEFILE, create separate shapefiles based on specific attributes via split by attributes, adding the separate shapefiles to the map and exporting them to PDF. I am stuck on ...
0
votes
0answers
21 views

I'm having errors in arcpy with Project. It works with some inputs but not others

I'm writing a function that takes a DEM, Line Shapefile, and a CSV with point data and creates a gdb. It then checks projections to see if they are identical and re-projects to a common projection and ...
0
votes
0answers
30 views

How can I join values of Point features to raster dataset in ArcGIS?

I have to join point values to rasters. Every points are located at the geometrical centre of the raster cells. Every single cells have to include the point values that are in their centre. ...
1
vote
0answers
16 views

Add Join Management and UpdateCursor in Arcpy

How to join multiple table with shapefile, update cursor specific field of the table in shapefile table and remove the join table? I write some script but it not work, please correct my script. ...
1
vote
1answer
29 views

arcpy SelectByAttribute_management

I try to add a point xy to feature class and I want to select the latest record in table (recently added). The script runs and I don't have any error message but the tool doesn't select any thing. How ...
-1
votes
1answer
42 views

ReAsked - Why is manipulating field map schemas inconsistent (ArcGIS)? [duplicate]

I've got a knotty problem which I am trying to solve in a very methodical and deliberate step by step process, to ensure that non-technical colleagues are able to verify the content every step of the ...
2
votes
2answers
33 views

Python in ArcGISPro: Backing Up All Layers in a Map

I am having a bit of trouble with Python. I am trying to create a script (hard-coded for now, but eventually soft-coded to make a script tool) that allows the user to back up layers of a given map in ...
0
votes
0answers
31 views

Create a line on a midpoint of another polyline at a certain angle

I have a polyline layer, for each feature I want to create a mid point of the polyline (which is easy enough to do) and then generate a polyline of a certain distance at a right angle of the feature. ...
0
votes
1answer
16 views

How to set an extent of Geostatistical Layer for further Export to Grid?

I am writing a script to create a bunch of JPEG interpolational maps using Geostatistical layer (calculated on RadialBasisFunctions). I have a point-feature file which I use to create this GA Layer. ...
0
votes
0answers
8 views

Exporting map series

aprx = arcpy.mp.ArcGISProject("CURRENT") lyt = aprx.listLayouts("LYTNAME")[0] if not lyt.mapSeries is None: ms = lyt.mapSeries if ms.enabled: pageName = lyt.mapSeries....
0
votes
1answer
57 views

Making ArcPy code run faster

I have an ArcPy code that I am using to find various characteristics about certain watersheds in Indiana. I start with a shapefile of all 800 watersheds and go through it row by row and perform a ...
0
votes
0answers
22 views

expression for “SelectLayerByAttribute_management” with value of a cursor

I am currently struggling with the correct syntax for a SelectLayerByAttribute_management query, which is created iteratively by a cursor. I want to intersect each municipality from a polygon file ...
0
votes
0answers
18 views

create a 3D line from 3D points in Arcgis

I have a large amount of 3D points that represent several (separate) linear elements. This means that these points partly have the similar/(same) x,y - coordinates and differ only in the height (z) (...
0
votes
0answers
34 views

ArcPy parameters not being accepted by class constructor

This may sound like a general coding question, but the error seems particular to ArcPy and not core python, so I'm cautiously asking it here. I've got a class called WFSQuery that I'm using to do ...
0
votes
0answers
14 views

Generate list of edges from ArcMap Python Network Analyst shortest path route

We are able to use ArcPy code to generate the shortest path route between two points in ArcMap using Network Analyst functions. Right now this just exports the shapefile of the route. What we'd like ...
2
votes
1answer
39 views

ArcPy: Error 000732 feature layer / table view does not exist or is not supported

I am trying to update a feature class by joining it to a table after deleting columns in the target layer with the same names as columns in the join table. I thought the only way to do this in arcpy ...
0
votes
0answers
23 views

Not Inputting values for certain parameters and working for certain parameters in Arcgis 10.2

I am running Python code in ArcGIS Toolbox, inputting 13 parameters. I have used GetParameterAsText(index) function to do it. However it takes values up to 8 parameters properly and the 13th parameter....