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
1answer
84 views

Surface and Volume from TIN read through text file?

I am trying to create a script that will iterate through a list of elevations in a text file and calculate surface and volume using the 3D analyst surface volume tool. I have success for the first ...
0
votes
1answer
27 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
2answers
69 views

ExportToPNG produce empty image

I am using ExportToPNG (in ArcGIS 10.3.1) to produce images from a MXD with WMS data. If I use the interface command ExportMap with the option "1-BIT_MONOCHROME_THRESHOLD" and a threshold at 256, the ...
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 (...
0
votes
1answer
163 views

Using script to list .lyr files with broken links?

I would like to identify within a particular folder the .lyr files that have broken links. Some of these files are within multiple folders but all fall within one folder. My programming knowledge is ...
1
vote
1answer
50 views

Improving ArcPy script for ArcMap to only return rows of selected polygons instead of all polygons in layer

I am debugging a code provided to me that merges two polygons and alters the fields of "FID1' and "CALC_AREA." I have realized that the current code searches every layer in the map document for ...
0
votes
0answers
15 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 ...
1
vote
1answer
25 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
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
134 views

Updating Cursor to Include Newly Created Features?

I am using ArcMap 10.1 and python to create cursor that starts at the one and only row of a polyline shapefile, some code runs to create a new feature based on the position of the exisiting feature, ...
0
votes
1answer
78 views

Creating user defined input to simplify Reclassify tool and negate need for remap

I would like to build a script tool using Arcpy that reclassifies a raster layer based on a single user input parameter. For example, if the user inputs the number 7, then 0 - 7 would reclassify as 1, ...
1
vote
2answers
1k views

How to use 'remap' in reclassify tool code in ArcGIS Python Toolbox

I am making a reclassify tool in ArcGIS python toolbox (.pyt) ... I am able to use the remap datatype but am not able to parse the information present in Remap in the Reclassify function's third ...
1
vote
1answer
32 views

Arcpy Clip Raster not setting clipped out area to NoData

I have an 8 bit raster that I'm clipping using arcpy 10.7 arcpy.Clip_management("inrasPATH","","outrasPATH","PolygonPATH","256","ClippingGeometry","MAINTAIN_EXTENT") However whenever I clip 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 ...
4
votes
1answer
62 views

ArcPy TableToNumPyArray where_clause issue

I am trying to run this code in the Python terminal in ArcGIS, but everytime it throws an error and I can't figure it out. I think it probably has something do with how I construct the SQL where ...
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 ...
0
votes
1answer
24 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
1answer
15 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. ...
2
votes
1answer
226 views

Clip multiple rasters using polygons based on filename in arcpy

I have created several rasters using arcpy by subtracting several rasters using the arcpy.Minus_3d function. Now I want to clip these rasters using polygons. My rasters are called test01_out, ...
0
votes
1answer
262 views

Modelbuilder not recognizing table output and throws Error 000732

I am building a tool in ArcGIS Pro Modelbuilder (Pro version 2.2.1) that includes making a drop down list for user input based on the information contained in a domain of a feature class. The three ...
0
votes
0answers
29 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
1answer
50 views

Using more than a single layer as barriers in arcpy.TraceGeometricNetwork_management()

I am working on script that iterates through trace flags and traces upstream. For each trace flag, I have selected features from multiple layers in the geometric network that I want to act as ...
0
votes
1answer
147 views

ArcPy script causes Python crash when run outside of ArcGIS Python window

I have a Python script that will successfully complete when run from the Python window in ArcMap or ArcCatalog, however, when I run as a standalone it will cause python.exe stopped working crash once ...
0
votes
3answers
28 views

How to use range value in UpdateCursor in ArcMap

I am trying to add range value in attribute tables by using UpdateCursor module of data access (da). import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") lyr = arcpy.mapping.ListLayers(mxd)[0] sql ...
1
vote
0answers
14 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
36 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
30 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 ...
2
votes
1answer
489 views

arcpy.da.SearchCursor(fc,[“SHAPE@”]) has no firstPoint object

I am having trouble getting the start and end point of a line using the code below. import arcpy with arcpy.da.SearchCursor("Lines",["Material","SHAPE@"]) as curs: for row in curs: ...
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
0answers
6 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
2answers
29 views

Batch export to tiff in arcgis pro

I've been trying to code a script to export my map series to tiff. I was able to do this in Arcmap but am unable to figure it out by myself in Pro. Please help me with my basic code T_T ...it was ...
0
votes
0answers
20 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
15 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) (...
4
votes
1answer
1k views

Select and copy attributes features in ArcMap using Python add-in tool?

I'm trying to add a tool to an add-in toolbar to select features from an existing feature class and copy attributes to another feature class, from point to point. TopoHeight_Field_Name='Comment' def ...
0
votes
0answers
33 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 ...
5
votes
5answers
6k views

Exporting list of Feature Classes to CSV using ArcPy and Python?

I am successfully using the follow script import arcpy from arcpy import env import os env.workspace = ("WORKSPACE") fcList = arcpy.ListFeatureClasses() print fcList to export feature class names ...
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 ...
0
votes
1answer
73 views

ArcGIS - Run a toolbox model in a Python script for scheduling

So I feel like this should be really simple to do but I can't manage to get it working and reading around this forum and some Esri documentation, there seems to be different ways to do and I am ...
1
vote
3answers
89 views

Minimum Spanning Tree

I am looking to run MST on some vectors with geometries and cost. I have not been able to find a one stop python/arcpy method to do so. The closest I've gotten is by using the code in the comment by ...
2
votes
0answers
191 views

Arcpy Spatial Join - Not joining all records with 'JOIN_ONE_TO_MANY', 'KEEP_ALL' option

I am trying to perform a spatial join that will join all my join features (along with their attributes), within a specified distance, to my target features. Given the nature of the datasets, this ...
2
votes
1answer
33 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 ...
1
vote
1answer
29 views

Copying features from a shapefile into feature class using ArcPy with ArcMap gives ERROR 000725

I have a shapefile which contains some features and I need to copy these features and paste them into an EXISTING feature class using ArcPy. I have tried the (arcpy.CopyFeatures_management(..)) but it ...
2
votes
1answer
104 views

Creating and calling virtual environment to run ArcPy script?

I'm getting a new computer and am trying to set up my virtual environments the right way. In the past, I've just been using PyCharm and running everything through "C:\Python27\ArcGIS10.6" so it's a ...
1
vote
2answers
59 views

Using a Search Cursor to calculate a new field

I am new to ArcPy. What I am essentially trying to do is use ArcPy to look through a column in a table and if it is between a range to print a value in a new corresponding column. I assume I am going ...
1
vote
2answers
63 views

lyr replaceDataSource not reflecting

The changes I made to the MXD with ArcPy is not reflecting the changes in ArcMap. arcpy.env.workspace= "C:\Users\UserID\Desktop" mxdlocation=os.path.join(arcpy.env.workspace,mxdname) mxdloc = ...
2
votes
1answer
722 views

.replaceDataSource() results in ValueError: Layer: Unexpected error

I am replacing data sources for any of my layer files (.lyrs) that have a data source in L: . My code (in the Step 1 section) looks through each object in the ListLayers list first, determining which ...
8
votes
4answers
4k views

Arcpy's replaceDataSource Error

I've checked the other answers here and none of the answers worked for me... It's a "simple" matter of finding a layer by name in a map and changing it's datasource. Here's my script: #-- New ...
0
votes
0answers
22 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....

1
3 4
5
6 7
183