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

Debugging network analyst solve error 030024

I'm trying to build service areas for a low-voltage utility network, but am having trouble solving the network analysis. Here is the code to build the service area: Treatment_SA = arcpy.na....
2
votes
1answer
73 views

ArcPy While loop not ending

I've created a script that creates a buffer inside of a polygon. I want it to be an ArcPy script that can run in ArcCatalog. However, it contains a while loop that won't close when run through ...
0
votes
2answers
27 views

Difficulty with select by attributes using list fields in for loop

I am trying to add fields to a table and then populate the fields with text values (Yes/No). The text values are based on whether or not a species was found in a specific block. If the species was ...
0
votes
0answers
12 views

Set access permissions of ArcGIS Server Map Service with ArcPy

I have a number of Map Services I create with an ArcPy script. After publishing, I have to go to ArcGIS Server Manager to set the access permissions to "Everyone" by clicking on the heads symbol for ...
1
vote
1answer
32 views

arcgisscripting.ExecuteError: ERROR 000223: Cannot extract event table properties Failed to execute (MakeXYEventLayer)

import arcpy import sys import os #arcpy.env.workspace = "C:\\Test\\addresspoint" #arcpy.env.overwriteOutput = True input_database = "C:\\Test\\addresspoint\\connection\\Test.sde" out_layer_name = "...
0
votes
2answers
36 views

How to move polygons to points

I have a large number of polygons with matching points. I wish to move each respective polygon to its corresponding point (see attached image). I can't use the 'Move To' tool in the 'Editor', as I ...
1
vote
0answers
17 views

Create line feature from aspect value in ArcGIS

I'm investigating the danger of rockfalls into lakes in mountainous areas by using the hydrological tools of ArcGIS 10.7. My problem is that rockfalls don't exactly behave as surface runoff would. ...
-1
votes
2answers
35 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
3answers
44 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
24 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
22 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
30 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
30 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
12 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
27 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
15 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
34 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
49 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
40 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
24 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
23 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
33 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
31 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
22 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
33 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
43 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
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
20 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 2 3 4 5 178