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
0answers
45 views

Slow Model!! Designed with ModelBuilder

I have designed a Model to assess flood vulnerability using ModelBuilder and some python scripts. The Model has overall 56 stages of process. My problem is that when a user clicks on the model from ...
0
votes
0answers
27 views

Join attributes of 2 points to 1 polyline [duplicate]

I have a set of lines(polyline) that were created as lines between point pairs. Now I need to know, which points the lines connect. Also I want specific column from points table to copy in line table ...
-1
votes
1answer
36 views

Calculating mean of a field using Python [closed]

I am very new to ArcGIS and Python. I want to do a basic calculation and find the mean of 1 field of a table. The table is called Top 10 Tracks and the field in it called Path Length (km) and there ...
0
votes
1answer
19 views

Only few values are considered in zonal statistics as table, ArcGIS

I have a raster file of runoff values at a spatial resolution of 30 minutes, and I am trying to find the runoff values at 5 min grids using a fishnet shapefile of 5 min resolution. I use the zonal ...
0
votes
0answers
37 views

Sequential number of polygon vertices by Y coordinate value

I have a shapefile of polygon parcels. Each parcel has a unique id called propertyno. I need to label the vertices of my polygons clockwise sequentially, starting at the most northern vertex in ...
0
votes
1answer
52 views

Python 2.7 stand alone script for compounded with statement. Errors 'column specified does not exist - but it does

I'm writing a standalone Python script to use for labeling ArcMap 10.7 data. (Want to avoid label expressions for portability, etc). I'm attempting to use ID attribute to label based on ADMIN_ORG ...
1
vote
0answers
17 views

Data driven pages with multiple data frames (MultipleElementLayoutManager_10.0_v1)

I've been trying to customize Esri's free code sample Multiple Element Layout Manager to fit my own mapping. It rearranges page layout elements such as inset maps, north arrows and text on different ...
1
vote
1answer
25 views

Shapefile type description showing attribute error

import arcpy esc = arcpy.Describe("C:\Users\Drona_Maps\Desktop\lecture16\shapefiles\world_continents.shp") print esc.ShapeType Shape file type description showing attribute error like this: ...
2
votes
1answer
57 views

Writing table to memory in ArcPy gives ERROR 000354

Currently I try to improve an ArcPy script which is run outside ArcGIS Pro 2.5 in Spyder. I want to write a table to memory using the Table to Table tool. This tool is placed inside a loop and writes ...
-1
votes
1answer
18 views

How to stop add Messages temporarily in ArcGIS Python? [closed]

I want to stop arcpy.AddMessages temporarily class A: def somefun(self): arcpy.AddMessage("Code Message") ***code**** class B: def execute (self): c=A() c....
0
votes
1answer
30 views

Calculate field: expression is not defined [duplicate]

I'm tyring to write a script the allow me to select a layer by location, then calculate a field of the selected feature. But I'm having issue with CalculateField_management. Here part of the script: ...
0
votes
0answers
37 views

Negotiating ArcPy schema locks in script

How do I avoid the 000464 (Cannot get exclusive schema lock) error in this code caused by the last line? import arcpy import os geodatabase = 'C:/Data/testgdb.gdb' fc_name = 'test_feature_class' ...
2
votes
2answers
55 views

Creating perpendicular lines along stream at points

Using ArcPy, I'm trying to figure out how to draw perpendicular lines along my Streams feature class. I have a set of points, that are snapped to my stream centerline. I've seen the "Generate ...
0
votes
0answers
22 views

I'm trying to create a layer output, iterated through folders contained in the file path however i am told these shapefiles do not exist

My script shows an iteration through folders and within those folders are shapefiles. I confirmed that they exist and are spelled the way i have it set up. for value in folders: output_path= env....
0
votes
0answers
13 views

How to clear cache in ArcPy so visual appearance updated after processing

I have written a script which updates lines and points, the script runs fine through ArcGIS PRO but the issue is after running the script the visual appearance of the updated lines and points are ...
0
votes
1answer
33 views

Why does “arcpy.SaveToLayerFile_management” function does not allows me to input a file path?

I want to create a layer file from a shapefile. When I do... arcpy.SaveToLayerFile_management('123.0_NYC_PARKS',value+"_"+"NYC_PARKS.lyr", "ABSOLUTE") it works because I have this file opened in ...
0
votes
0answers
27 views

Python Calculate Rank in Field Esri

Does anyone know how to calculate the "rank" of a field but within 1-100? For example i have a field called "ValSumBasin" with all these values. I am wanting to rank these values from 1-100. I can ...
0
votes
0answers
23 views

How to implement workaround for ESRI BUG-000119907, arcpy.ApplySymbologyFromLayer_management

I'm trying to write an ArcPy script, within an ArcPy toolbox and the arcpy.ApplySymbologyFromLayer_management command is failing. as per bug report: https://support.esri.com/en/bugs/nimbus/...
1
vote
1answer
22 views

Create and set scratch fGDB

I need set the new created fGDB as current for save all FC: import arcpy import os out_folder_path = arcpy.GetParameterAsText (0) out_name = arcpy.GetParameterAsText (1) arcpy....
0
votes
1answer
39 views

ArcPy “Cannot open table for Load” error

I have been using some slightly modified code based on socalgis.org to extra data from map services. I have had no problems until this week where I am now getting the error RuntimeError - Cannot ...
0
votes
0answers
18 views

UnsafeLoadingWarning when updating anaconda environment Arcgis Pro 2.5

I updated arcgisPro to 2.5.1 and it had a version mismatch with my arcpy environment, so I did the following to create a clone. To create a new environment that is up to date with arcgispro-py3: 1. ...
3
votes
1answer
34 views

Iterate through dates and through columns using Model Builder of ArcGIS 10.x

I have a point feature class in a geodatabase (approx 11000 features) with 366 columns. From these, one represents the targeted date and the other 365 represents the temperature of one day of the ...
0
votes
1answer
38 views

Calculating sum per id using UpdateCursor of ArcPy

I am trying to calculate the SUM value for (VD_SUM) Based on Basin ID and output in the field "VD_SUM_SUM". I am not sure how to write the SUM part at the end. This is what I have so far. import ...
0
votes
0answers
22 views

Good protocol for multiple conditional spatial and attribute based selections using ArcPy while avoiding saving to disc

I am running multiple conditional selections, both where clauses with attributes and location based selections. I want to build functions, possibly within classes that are reusable and can pipe to ...
0
votes
0answers
24 views

topology: points closer each others + report

I have a point feature class structured like this: CompanyID | PersonalID | Lat | Long | 1 | 1 | ... | ... | 1 | 2 | ... | ... | 1 | 3 | ... | .....
0
votes
0answers
42 views

How do I assign values of a field, to another empty field when a conditional statement pertaining to a third field is considered?

When I run the code below I don't get the output I'm seeking. The "max_proportion" field is assigned the text LEVELMEAN instead of the values for each row within the "LEVELMEAN" ...
2
votes
0answers
40 views

Extending line to the nearest polygon [closed]

I need to extend several lines to its intersection with another feature class (polygons). In order to know the distance from the road to the building facade (in several points of the road) I created ...
1
vote
0answers
30 views

How to delete MDB file after using UpdateCursor?

I am updating MDB file with update cursor after updating complete I want change the file extension MDB to other. It shows it's in use by another process. Find below code. arcpy.env.workspace=...
0
votes
1answer
25 views

Insert large list of fields and values into feature class

I want to create a toolbox I have a list of point coordinates, that define a polygon and a list of attributes, that each polygon has. points_list = [(323917.71, 479699.45), (323923.36, 479699.74), (...
1
vote
1answer
43 views

max value of a field as variable

With the following script I was able to determine the maximum values of a column [POINT_Z] for certain groups from [ID_1]. arcpy.MakeFeatureLayer_management(inLAS[:-4] + '_POLE_POINTS.SHP', "...
1
vote
2answers
59 views

What is proper way to get multiple fields from da.SearchCursor?

I just buried a couple of hours not realizing that I can't do this: with arcpy.da.SearchCursor(fp_in, ['OBJECTID', 'name']) as cursor: objectid = [row[0] for row in cursor] name = [row2[1] for ...
3
votes
0answers
102 views

.exe Packaging for Python files with ArcPy?

I've written a little program that's meant to function as a stand-alone, not as an add-in. I'd like to be able to pack it up as an .exe, rather than ask my users to run the script. It does import ...
1
vote
1answer
36 views

Automatic map creation problem [closed]

I have two layers, first one is the ROAD layer and second one is the PARCEL layer (both polygon layers) as shown in Figure 1. I can get the data both in DXF and shapefile formats. My task is to ...
0
votes
0answers
14 views

ArcGIS Online not saving data in a hosted feature layer

I am trying to upload and save data in a hosted feature layer but every time I exit and reopen the layer my data is gone. I've tried saving it as a webmap and the data shows up on the webmap, but I ...
0
votes
0answers
23 views

Correct syntax for search query restrictions in arcpy.CalculateLocations_na?

In ArcMap, I have created a tool using Model Builder that has a Calculate Locations (Network Analyst) step. This step includes a Search Query to restrict Routing_Streets to features that are not ...
0
votes
0answers
18 views

Edit the default 'Extract Values' ArcGIS script tool input parameter display name?

Is there a way to change the default display name of the 'Extract Values' ArcGIS script tool input parameter? I would like to change the 'Raster' display name and the 'Output field name' text to ...
0
votes
1answer
24 views

Trouble with syntax of preselection in a cursor

I am trying to determine the maximum values in a column [1] in relation to a column [2]. For this purpose I have written all occurring values of column [2] in a list and now I want to make a selection ...
0
votes
1answer
35 views

ArcPy script doesn't work for TRIM function

I have this code: import arcpy import os def massiveTrim (vrb): y=r"shape path" for i in y: campos = arcpy.ListFields(vrb, "", "String" ) for camp in campos: ...
2
votes
1answer
24 views

StopIteration: iteration not started

I'm trying to update a given field in this case the last one of the table by concatenating all values in the row excepting null values or '' values. So far when execute the code until line: print (...
0
votes
2answers
61 views

Create points along 3D stream where elevation changes by 1ft

Using ArcPy (Python 3), I am trying to create points along a line where the elevation changes by 1 ft between vertices. I can successfully convert my Stream Polyline feature class to 3D and create a ...
1
vote
1answer
37 views

Test Schema Lock does not catch open feature class from within ArcGIS Pro

I am working on a script tool to be run in ArcGIS Pro (version 2.4.0 with Python 3.6.8) and wish to give the user a warning message and also time to close a feature class so as to avoid the script ...
1
vote
1answer
17 views

TypeError: ufunc 'expi' not supported for input type, and input can't be safely coerced to supported type according to casting rule ''safe''

Here is my code for raster calculation in ArcGIS. However, I am getting raster file for "uw" only. The python is unable to calculate exponential integral of raster uw. Thus, I am not getting the ...
0
votes
0answers
44 views

ArcMap 10.6.1 crashes while using wxPython

I want to develop a custom UI that will be able to download several shapefiles from open-source places and import them in ArcMap 10.6.1 automatically. For this purpose, I am using the Python-Addin ...
9
votes
2answers
382 views

VS Code autocomplete for ArcPy

I would like to get suggestions/autocomplete as I am typing methods and functions in VS Code for arcpy. Currently, IntelliSense would suggest only functions or methods that I have been using within ...
2
votes
1answer
46 views

Seeking dataset to create reproducible ArcPy example for ArcGIS Pro

I would like to create a reproducible example for ArcPy (for ArcGIS Pro) and cannot locate any example feature classes or rasters that come with installation. I am looking for something like the ...
0
votes
1answer
26 views

Overwrite previously exported Excel file

I am exporting a table to Excel and I would like the overwrite access to be on. Below is the code line. Please let me know how I can give overwrite access through the code if it is possible. #Export ...
0
votes
0answers
31 views

Symbolizing raster as vector field in ArcGIS

I have a number of velocity direction raster and corresponding velocity magnitude raster from a pluvial flooding simulation. I am trying to symbolize each velocity direction raster (combined with ...
1
vote
1answer
29 views

Invalid Syntax on Update Cursor update

I'm using a dictionary created by a search cursor from one feature class to update another feature class with an update cursor. I'm getting an invalid syntax error for the cursor.updateRow(row) and.....
0
votes
0answers
23 views

Loop to Apply Multiple Symbology to Multiple Layers

I am trying to apply multiple symbology to multiply layers that I have created from multi-tasking custom tool. The tool applies buffer, clip tool to multiple feature classes and then all the feature ...
0
votes
2answers
58 views

Definition queries in Python Toolbox tools

I'm trying to set a definition query within a Python Toolbox tool in ArcGIS Desktop. The code below works when I run it in the ArcGIS Python window, but does not perform the definition query or ...