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
2
votes
1answer
66 views

Delete layer created during Buffer_analysis

I am trying to figure out how to delete the layer that is created during the Buffer_analysis line. I have searched all over the internet and have honestly tried about 100 different methods and cannot ...
1
vote
1answer
204 views

Conversion of Landsat ToA reflectance to BoA reflectance with an equation

I am using temporal datasets from Landsat 5, 7 and 8. Since I have many datasets I would like to include the conversion from ToA(top of atmosphere) to BoA(bottom of atmosphere) reflectance into a ...
1
vote
1answer
34 views

Framing argument for insert cursor when writing geometries using ArcPy?

I am writing polygon geometries and I have points holding the geometries that represent vertices of the polygon. When I run the code below I get: TypeError: sequence size must match size of the ...
1
vote
1answer
53 views

Setting up Anaconda 2 with ArcPy

I want to run Jupyter Lab (Notebook) with ArcPy. I have ArcMap 10.7 with Python Version 2.7.15, Numpy=1.9.3, matplotlib=1.5.2. I followed the instructions from the following link: https://gisday....
0
votes
0answers
11 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 ...
1
vote
1answer
58 views

Calculate field with a value in a list based on field [closed]

I don't want to write an if statement for every field. I want to know if there is another way to field calculate each field with the values related to it in this example table: Fields (X,Y,...
1
vote
1answer
43 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 ...
-1
votes
1answer
238 views

Selecting just the first row from a search cursor

Currently I am trying to select the top row of a feature class which is sorted using a Count field. I then would like to run the script a second time but the result will then be the second row of the ...
0
votes
1answer
109 views

ImportMapServerCache_server not executed

I have this script based on an export from Model Builder (ArcMap 10.4) that is supposed to take .tif files from a directory and import them to an existing service. The problem is that ...
0
votes
0answers
30 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
83 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
68 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
156 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
votes
0answers
30 views

What constitutes an intersection when looking at polygons?

Amongst my layers, I have two two polygon featureclasses. One is a simple dataset of large regions (less than 10 regions for the whole map), and the other is a very detailed dataset of "issues". I ...
1
vote
1answer
49 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
12 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 ...
3
votes
1answer
66 views

Sampling list of rasters in ArcPy?

I've been trying several times to sample (Sample tool from Spatial Analysis ArcGis 10.5.1) a list of rasters to a location sample (also in raster format .tif). Here's the code I've been using, and ...
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
75 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
56 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
22 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
20 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. ...
-1
votes
0answers
30 views

I keep getting RuntimeError: ERROR 999999 when trying to project files [duplicate]

# Identify Projection and Re-Project if neccessary srDEM = arcpy.Describe(DEM).SpatialReference srLine = arcpy.Describe(Line_Shapefile).SpatialReference if srDEM.type == "Projected" and ...
2
votes
1answer
223 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, ...
-1
votes
0answers
27 views

How to plot different band combinations from satellite imagery

Is there a way to write a code using IDLE to plot different band combinations and create composite images from satellite imagery such as WorldView 2or Landsat imagery? # #Description: ###############...
0
votes
1answer
234 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
27 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
140 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
27 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
28 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
35 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
480 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
30 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
5 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
22 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
18 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 ...