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
votes
2answers
29 views

ArcGIS Pro and how to use Python to calculate an output from multiple table columns [closed]

I'm not sure how to work with tables in ArcGIS Pro using Python. I've done some coding in other areas but whenever I see the code snippets related to table operations my mind just goes cross-eyed. I'd ...
0
votes
2answers
23 views

Changing a no value data from 0 to another value with python

I am using satellite data and by default it has a nodata value of 0 for each band. This is fine except for when I'm making NDVIs where 0 is a real value we need to include and I don't want it to be ...
-1
votes
0answers
22 views

Accessing layer symbology “valueField” with Arcpy?

So I ask this question,i don't care it's duplicate.(or tell me, how can i ask at a question...) Referring to this question: Accessing "valueField" property of layer's symbology using ...
-1
votes
0answers
19 views

“Data is not numeric” error after converting an array into float [closed]

I have converted an array into float but it still is giving me the error that data is not numeric. d = n.loadtxt(r"D:\KhadeejaData\Semester5\Python\Points.txt", delimiter = "," , dtype = float) Ahmm =...
0
votes
0answers
18 views

How to use 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 ...
1
vote
1answer
19 views

Listlayers, but exclude group names/feature dataset names with Arcpy

I am looking for a way to loop through all the feature classes (feature layers) within a mxd, to then use some geoprocessing tools on them. Before I run these geoproccesses, the script needs to change ...
1
vote
1answer
27 views

arcpy Extract raster value to point: only extract values if point overlap the raster?

I have a set of 100 points and 100 rasters. Points are stored in one shapefile over large spatial extent and small, not-overlapping rasters are stored in gdb. Rasters are something like tiles. ...
0
votes
0answers
11 views

ArcGIS Pro 2.5 - Python - MapView exportToPNG exports blank images

I'm trying to export PNG's at a set scale based on the center point of a points file I have. When I run my code I can see the map co-ordinates being panned around to each one along with the ...
0
votes
0answers
22 views

Calculate frequency based on a filtered field, and put the value in another field

I'm a python beginner. I'm working on one feature class, i would like to group this feature based on group_ID field, and then for each one of this group i would like to calculate the number of rows ...
-2
votes
0answers
14 views

Batch converting NetCDF to till and clip them using a mask layer [closed]

I'm new to working in GIS and I was told ArcGIS is a suitable software for batch clipping and batch converting. Can anyone guide me through the steps cause I don't seem to get a clear idea about it. ...
1
vote
1answer
29 views

Getting elevation of surface in a specific point from DEM?

In my python code, I have to get elevation of surface in given coordinates. I know about Extract values to points tool in ArcMap, but I can't use that since it is very time consuming for me because I ...
0
votes
0answers
32 views

Can't figure out why I keep getting this error in regards to opening the gbd path while using the InsertCursor

listOfPoints = [(6002672.58675, 2092447.04362), (6003672.58675, 2093447.04362), (6004672.58675, 2093447.04362), (6004672.58675, 2091447.04362)] polyName = 'New Polygon' polyID = 54321 ...
3
votes
3answers
46 views

Cannot set input into parameter Coordinate_System using arcpy.AddGeometryAttributes

I have a feature class of points: AL_CB_Parcel_Intersect. This feature class is already in GCS_WGS_1984. I am trying to use arcpy.AddGeometryAttributes to create X, Y attributes, but I keep getting ...
2
votes
2answers
39 views

Getting top 1 record from shapefile by descending order using ArcPy SearchCursor

I have a shapefile from the date field in it. I'm looking to get top 1 record date value by descending order. readRows = arcpy.SearchCursor(shapefile, "", "", "Last_Updated" ,"Descending") Is ...
1
vote
0answers
23 views

Feature Class to Feature Class error: 999999 (ArcGIS Pro 2.5)

I've tried this with the new ArcGIS Pro 2.5 Python Notebook and the Python compiler from within Pro. I have about 15 layers that I'm reading in from a couple different external servers. I can read in ...
0
votes
0answers
30 views

Can one use ArcPy with Python 3.7 instead of default Python 2.7 that comes with ArcMap 10.6.1?

I want to use arcpy with Python 3.7. I tried setting the paths to arcpy but Python 3.7 doesn't import arcpy properly. Is it possible to use a Python version outside of default version that ships with ...
0
votes
1answer
22 views

Creating polyline feature layer for min. dist. between two point feature classes ArcGIS Pro

I have been struggling to figure out how to build a Python script with the following utility using ArcPy for ArcGIS Pro: Taking two user-supplied point feature classes (A and B) and creating a third, ...
2
votes
1answer
78 views

RunTimeError w/ for row in cursor

Every time I execute this, I get a runtime error pointing to my "for row in cursor," stating that A column was specified that does not exist. Any ideas how to fix this? import arcpy import os gdb = ...
-3
votes
0answers
21 views

arcpy.MakeXYEventLayer in Python is not working [closed]

I am trying to get some tables with X and Y from SQL using these steps in ArcGIS Pro, I had a model there which is working fine but when I tried same logic in Python I am getting errors. My steps for ...
3
votes
1answer
20 views

Python Error: “Data driven pages is not enabled”, when they are enabled

I am exporting Data Driven Pages using arcpy (ArcMap 10.5, Python 2.7.13). I have used this script many times on this exact same MXD to export DDP to TIFF: import arcpy mxd = arcpy.mapping....
-2
votes
1answer
30 views

Spatial reference in Arcpy [closed]

So, I have the following code to write onto a report the spatial reference of a feature class. My workspace (geodatabase) contains, 3 feature classes; studyarea, destination, and source. For some ...
1
vote
0answers
21 views

Does projection matter for Zonal Statistics as Table on world raster

My goal is to take a world population grid (2.5 arcmin) and perform zonal statistics as table inside country borders (and also inside the cells of a 1-degree fishnet intersected with country borders). ...
2
votes
1answer
32 views

Arcpy/Python how to change an attribute field based on another attribute variable

New to python here. I have looked through the 'similar questions' section to try and answer this myself and have found many attribute table python queries which are related to statistical operations. ...
1
vote
1answer
26 views

Is there a way to create a new, pre-populated field within a view (Feature Layer), in Arcpy?

In SQL, users can write a SELECT statement that 'invents' a new field with a default value already populated in it, for all records returned. In the example below, the field Type doesn't actually ...
0
votes
0answers
42 views

Orientation of segments of a polygon in ArcGIS

Using the longest side of a polygon, I would like to get the orientation of each side of the polygon with the longest side orientation as the reference. I have attempted to get the general ...
-1
votes
2answers
46 views

Getting key error

I am now trying to display the information I got using Describe. For some reason, I keep getting error message saying Key error: 'pixelType.'. I have no idea why this gives me the error because this ...
0
votes
2answers
54 views

Change nameString using arcpy?

Is it possible to change the describe nameString of a .lyr file using arcpy? The name of the .lyr file is correct, but when the .lyr is brought into an .mxd the display name (nameString) is different, ...
1
vote
1answer
42 views

Calculate distance between consecutive GPS points for each id

I'm working with ArcMap 10.6. I have a big dataset of GPS points (so my coordinates are in latitude and longitude) with around 800 user ids. I want to calculate the distance between each GPS point, ...
-3
votes
0answers
39 views

A complex process needs to automated ArcGIS Pro [closed]

I want to create a model or ArcPy scripts that allows me to input 2 values Project Name and Year from drop down list is created from an Excel file added in the project. Once these two values are ...
0
votes
1answer
45 views

Arcpy: Describing spatial reference system

I am writing the following code to make a report describing a feature class. SO far, I got their names and shape type, but now I need to get SRS/coordinate system for each of the feature class. I ...
-1
votes
0answers
20 views

Calculate angle at each vertex using the longest side of polygon as reference [closed]

My goal is to find by how much or less than a right angle (90 degrees) is the angle at each vertex and output those values (error) -- preferably as a field. I am trying to get the longest side of ...
-1
votes
1answer
46 views

ArcPy - How to Save to a txt file to reference and itterate

What I would like to do with the following code snippet: Check to see if a text file contains feature class names If it does not contain feature class names, then write the feature class names to it ...
-1
votes
0answers
39 views

ArcPy - Creating and showing Dimension Feature for a selected polgyon to shown the length of each side

I am new to development in ArcPy. I need to display the length of each side of a polygon using Dimension Feature, for doing this exercise I was planned to take the XY co-ordinate of each polygon ...
1
vote
1answer
30 views

Error calculating field with script exported from ModelBuilder

I am attempting to add a new field called "TimeYrCode" to a list of shape files, and then add values to this field based on the value of the "gridcode" attribute, which represents different days of ...
0
votes
0answers
23 views

Applying ring buffer using ArcPy [closed]

I need to apply a ring buffer to a polygon in a polygon shapefile using python in ArcGIS. I have already tried the commands myPoint=arcpy.Point(X,Y) myPGeometry=arcpy.PointGeometry(myPoint) arcpy....
0
votes
1answer
21 views

Using Select Layer By Attribute in Python Script Tool

I just want to try to use a Python script to select specific roads in my Layer called "Route_01_Shatin" and so I coded as below: arcpy.management.SelectLayerByAttribute('Route_01_Shatin', '...
0
votes
0answers
20 views

Getting “Workspace Already in Transaction Mode” Error when trying to use updateCursor on versioned sde

There are are numerous post on this error, but I can't seem to find a solution for myself. We have a versioned sde and need to add new fields to some of our feature classes and populate them with an ...
1
vote
1answer
24 views

Update field based on values in other fields using search and update cursors

I'm a Python beginner, I'm doing a risk analysis with a point feature, and I'm trying to write a script that allow me to update a field (proximity) based on different numeric values within different ...
-2
votes
1answer
36 views

Describing element using ArcPy

The attached picture shows my result on ArcGIS Pro. It shows all the elements in a geodatabase that a user chooses. It only displays catalogpath to the elements, but now I need to describe, for each ...
1
vote
1answer
19 views

Python Toolbox Value Table Parameter - getting separate outputs for different column inputs

I'm using a Value Table as a parameter for a Python toolbox so the user can input two related attributes. I'm struggling with how to use the values the user inputs as separate values/parameters. The ...
2
votes
1answer
44 views

Using Accented character in ArcPy

I am trying to export a map using Python/ArcPy script. The problem that the title of the exported map containts somthing like "A(c)" instead of the accent "é" I wrote. The date (dt) is printed (in ...
1
vote
1answer
16 views

Run SelectLayerByAttribute for multiple where clauses

I have around 20 different where clauses that I will need to run it at different times when my dataset is updated. Is there a way to iterate through a list of where clauses and get the results, so I ...
4
votes
1answer
86 views

arcpy.SelectByAttribute 'Parameters are not valid' error

I am trying to run a python script to select 5 random points in an attribute table and to loop through every 100 points to do this. When I run the function SelectRandomByCOunt within a python shell, ...
-1
votes
3answers
79 views

ArcPy iterative workflow

I may just not know the terminology needed to find the proper google results but I am trying to count the number of feature classes and store that for reference later in the script so that if the ...
1
vote
0answers
21 views

Create .lyr file from open .mxd layer without removing layer

I have a tool that is meant to clip and reproject every layer in an open .mxd, and then create a new feature class and .lyr file with original symbology from the result, not adding either to the .mxd. ...
0
votes
1answer
30 views

Arcpy Delete Multiple Layers

I'm writing an add-in for Arcmap and at the end of it I am left with multiple layers from buffers, joins, and selections. I am trying to delete these layers before the add-in finishes so to keep the ...
0
votes
1answer
28 views

ArcPy Raster to Polyline outputting empty shapefiles and a 999999 error?

I am running a lengthy script to post-process raster channel paths into polylines so I can measure their length using Add Geometry. Script runs well until I go to convert the rasters to lines using ...
1
vote
0answers
27 views

Exporting groups of PDF based on Orientation

I am trying to create a map book with two different orientations. The part I am currently stuck on is for the loop to go through the table and export groups of the same orientation. an example of the ...
3
votes
1answer
55 views

Describing element in geodatabase using ArcPy

With help from people on this site, I have the following code to look for all of the element types in the geodatabase and put them into a report. walk = arcpy.da.Walk(workspace, topdown=True) for ...
0
votes
1answer
42 views

Passing field variable as distance with Drive Time Trade Areas using ArcPy with ArcGIS Pro

I have a dataset of 600,000 records where I need to calculate a drive time that is different for each based on model that estimates the actual/variable drive time needed at that location. Within ...

1 2 3 4 5 178