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
vote
2answers
66 views

Compare list of field names located in two separate dictionaries with same key [closed]

I created two dictionaries, dictionaryone and dictionarytwo, and both contain the same key. The key is a file path to a shapefile, for example: C:\TestFolder\Folder1\A\address_pt.shp. In addition, ...
0
votes
1answer
19 views

Problem with unsuspected coordinate values when creating polygons with arcpy

I have a problem when creating polygon features with arcpy. I want to save rounded X and Y vertices for example to two decimal places. Example: I have coordinates given on two decimal places. I am ...
1
vote
1answer
19 views

Use ArcPy to add snapping guides to a layout in ArcGIS Pro [closed]

I'm wondering if there is a way, ideally with Python, to add multiple snapping guides to a layout in ArcGIS Pro. Essentially, I want to reproduce something like the steps below: Right click on the ...
1
vote
1answer
51 views

Catching a system exit caused by ArcPy in PyCharm?

Using ArcPy in PyCharm, I'm constantly getting Process finished with exit code -1073741819 (0xC0000005) in my RegionGroup loop. I have posted my code in a previous question (Process finished with exit ...
0
votes
0answers
25 views

Alternatives to ArcGIS' “RegionGroup” a raster

I'm using the ArcGIS Python 2.7 interpreter in my PyCharm as I need several algorithms of the ArcPy package. However, I am having trouble with the RegionGroup of ArcGIS 10.7, as it sometimes crashes ...
1
vote
1answer
21 views

Getting RuntimeError while creating CreateGISServerConnectionFile using Python

I'm inexperienced using Python and keep getting a RuntimeError when I try to follow the instructions to create an ags server connection file on this page - https://desktop.arcgis.com/en/arcmap/10.5/...
0
votes
0answers
55 views

Process finished with exit code -1073741819 (0xC0000005) from RegionGroup (ArcGIS 10.7)

I'm trying to automate my work using ArcPy in PyCharm on Windows. However, when I run the following (abridged) loop, it exits at random points: sometimes at the 4th iteration, sometimes at the 31st, ...
4
votes
2answers
194 views

Filling dictionary with list of row attributes using arcpy.SearchCursor

I have a dBase database file and I'm viewing and editing the table in ArcGIS Pro. I want to use the arcpy.da.SearchCursor function to fill a dictionary and create a key-value pair by iterating ...
1
vote
1answer
46 views

Adding together GetCount Results

Is there anyway to add together GetCount Results? I am using GetCount to find the number of selected features for multiple layers but when I try to add them all together I get an error message saying ...
0
votes
1answer
78 views

Projecting features to Enterprise Geodatabase in Oracle gives ERROR 000210: Cannot create output

I am trying to project features from a geodatabase and write into an enterprise geodatabase connection. I have permissions to create data and the name I am using also works, but I keep getting error: ...
2
votes
1answer
45 views

Creating NDVI from raster using ArcPy

I have to create NDVI's for multiple raster images, and so want to find out the most efficient way to do it. The code below works, but I wondered if there was a more efficient way to do it? # ...
0
votes
2answers
65 views

Using list of file paths in function arcpy.ListFields to create multiple lists of field names for each shapefile

I have a list object that contains file paths as text. I named the list object filepathlist. An example of a file path within the list is C:\TestFolder\Folder1\A\address_pt.shp. The file paths lead to ...
0
votes
0answers
23 views

Layer missing from arcpy PDF export on first iteration only

I have a script that will iterate through a folder of data driven page mxds and export only the correct page for each. It has previously worked without a problem (I wrote it a couple years ago and use ...
2
votes
0answers
87 views

Getting ArcPy Error 00354

Just to get the obvious out of the way, I am very new to python and arcpy. I know almost nothing. That being said, I've inherited a script that is run once a year and I'm now the only one responsible ...
0
votes
0answers
17 views

Calculating Cut & Fill amounts for a road, using a feature class representing road and DEM?

I have designed a road centerline in the context of my study area using CAD scripts in python. Then I have converted it to a feature class containing Z-values using ArcPy. Now I need to calculate ...
0
votes
0answers
36 views

Moving geometry at same distance in different coordinate systems

I haven't been making tools in ArcPy for a while and stuck in one case. My goal is to create a serie of geometries in a center of current extent by running a script. I.e when I move ArcMap's extent ...
1
vote
0answers
32 views

ArcGIS Python Add-ins Password Input

I am working on a ArcGIS Python Add-ins which need user login to get data. Rather than exposing user's password in a combobox forever, we need to have a password input box which only show * while user ...
1
vote
2answers
63 views

Create a list and append objects created from function arcpy.Exists through a loop

I used a SearchCursor object to create a list containing file paths and saved the list to a variable called FilePathList. Next, I iterated through elements within the list using a for loop. ...
0
votes
1answer
43 views

Using IF statement to create 2 different output files in Python Script tool of ArcPy

I have a model which needs to only produce 1 final report but is dependent on whether a variable is provided.So there are 2 different flows following on from that selection Something like this, a ...
0
votes
1answer
29 views

Multi choice parameter data type in ArcMap Toolbox

I'm a beginner ArcMap user. I created a toolbox in ArcMap/mytoolboxes which will run an specific Python script from my hard drive. In my python script I need user to choose between 2 options. I want ...
2
votes
1answer
40 views

Parameter dependencies based on two datasets in Python toolbox

I am setting up the parameters in a Python toolbox. I have a parameter that I would like to list fields based on a user input feature class. I am wondering if it is possible to list fields based on ...
0
votes
0answers
32 views

Low-pass filtering raster with a mask - matrix

I have to do low-pass filtering with a mask - matrix: 1 2 1 2 4 2 1 2 1 This is my code import arcpy import numpy as np arcpy.env.workspace = r"C:\Users\ASUS\Documents\ArcGIS\Default.gdb" raster = ...
1
vote
1answer
57 views

Accumulate values from raster using ArcPy [closed]

I wrote the script: import arcpy if arcpy.CheckExtension("Spatial")=="Available": arcpy.CheckOutExtension("Spatial") print("Spatial") from arcpy import env from arcpy.sa import * env....
2
votes
1answer
78 views

Passing list containing file paths into function arcpy.Exists to determine if shapefile exists in directory

I have a dBase table that has a field containing file paths. Within this field there are over 1,000 records. I created a list, using a search cursor, that contains all the file paths. An example of an ...
0
votes
2answers
34 views

Change Drawing Order with Python in ArcGIS Pro? [closed]

Working on a Python script that does some routine table management of a couple of feature classes. In one step I define a table join and then export that to a GDB. When that runs, it will add it to ...
0
votes
1answer
41 views

Can Extent Indicator symbology by automated with ArcPy?

I have a map series of 30+ data driven pages that I am altering the layout of, trying to do as much of it with ArcPy as possible to save time. I need to change the symbology of the Extent Indicator. ...
1
vote
1answer
29 views

Why does Arcpy CalculateField alter string being written to string field?

I have a "Model_Version" field in my feature class that is being used for record keeping. I do not intend to ever do any numeric operations with it, so I am storing it as a string field. Right now ...
2
votes
1answer
72 views

Python Toolbox Value Table values and list inputs

I am trying to create a Value Table I will use to create a field mapping object. First column will represent the target field, second column carries the source field. The first column is populated ...
0
votes
1answer
57 views

Dynamic extent indicator in ArcGIS Pro

I'm working on map series in ArcGIS Pro, where I'm generating 5129 maps using fixed layout, though till now I got output which is needed for my project, like using dynamic text but I'm facing one ...
2
votes
0answers
29 views

Print functions for data projection and rename file

I have been struggling with functions in this script as I would like to see the projection in the file and then rename. The problem is that it causes and definitions are not done properly Here is the ...
2
votes
1answer
48 views

Adding data using Python from ArcGIS Online/ArcGIS REST Services directory to a ArcMap MXD

I want to update over 100 MXDs by adding 4/5 ArcGIS Online/ArcGIS REST Services directory layers. I am unsure whether this is possible using Python and can only find documentation on how to access ...
2
votes
2answers
26 views

Using map algebra get minumum and maximum value in ArcMap

I am looking for an easy solutions with Map Algebra for this one without Saving: # Import system modules import arcpy from arcpy import env from arcpy.sa import * # Set environment settings env....
1
vote
1answer
59 views

Arcpy RuntimeError: An invalid SQL Statement on UpdateCursor

I'm trying to populate a field based on the values of another field. CalculateField was buggy, so I switched to da.UpdateCursor. This initially worked when I ran it as part of a script tool on ArcGIS ...
3
votes
2answers
85 views

UpdateCursor for field calculation based on unique values

UPDATE TO PREVIOUS QUESTION: I have an address feature class. I want to use an UpdateCursor that focuses on two fields: StreetName and Block_ID. For every instance of a unique StreetName, I want the ...
1
vote
2answers
45 views

Finding geographic coordinates of shapefile using ArcPy with ArcMap

I want my Python script to check if the first coordinate in a GeoJSON polygon is within a polygon in ArcMap, and if so draw the polygon to a featureclass. My issue is that the GeoJSON file is using ...
1
vote
1answer
59 views

Computing unique values in ArcPy

I'm trying to use ArcPy in order to change the layout of many Imagine files in my MXD. Import Symbology from a layerfile does not seem very straightforward to me when using ArcPy (see this earlier ...
1
vote
1answer
33 views

Field mapping features to different feature with different field names using ArcPy

I was trying to you this instead of field mapping because field mapping is hard to understand. outfc = r'\\water.com\Blank.gdb\SewerCollection\ssLateralLine' infc = r'\\water.com\Test.gdb\...
0
votes
0answers
52 views

Spatial Join works when invoked through ArcMap GUI, but “Out of Memory Error” through ArcPy

I want to join an input feature class (~11,000 polygons) with another feature class (~31,000,000 polygons). When I do this through ArcMaps 'Join - based on spatial location' tool, it takes quite long ...
1
vote
1answer
65 views

Python user defined function written for ArcGIS Pro returns None when it should return an address?

I am rewriting a 2.7 Python script for compatibility with ArcGIS Pro and organizing it with user defined functions so that I can debug portions of the script as I go. I am new to the process, but I ...
1
vote
0answers
19 views

Combining two images one over other using ArcPy [closed]

I have to combine images from different satellites (with different spatial and spectral resolution) such that features of both are present in the final image. I am using ArcGIS. Please help me with ...
1
vote
1answer
45 views

Copy feature class from multiple gdb to a single gdb

I need to write a Python script that is copying. I want to copy a common feature class of these gdb to a single gdb import os import arcpy arcpy.env.workspace = ("D:/Planchas") workspaces = arcpy....
0
votes
2answers
54 views

Changing legend item properties using ArcPy

I'm developing a Python script to created several map document (.mxd) files from .shp file and .xlsx file automatically. After setting symbology of layer and changing labels, I want to hide heading of ...
1
vote
1answer
28 views

Avoiding Python NameError when rewriting script with user defined functions for ArcGIS Pro

I am rewriting a script for Python 3.6 and ArcGIS Pro compatibility and it seems like user defined functions will be necessary to clean it up. I am fairly new. I separated the code block into two ...
2
votes
1answer
45 views

Getting max() from list of dates using ArcPy [closed]

Using Python 3.6.8 I had the below portion of my script working previously on some test data, but now that I've tried to spool it up to the production data, it's not working. This is a snippet of a ...
2
votes
1answer
76 views

Raster Calculator in Arcpy Script Tool

I am working on a script tool that will be run from a custom toolbox in ArcCatalog. I have written everything with the inputs hardcoded into it for testing. Works great running from IDLE. I had ...
1
vote
0answers
17 views

SWITCH_SELECTION, CalculateAreas_stats and ARE_IDENTICAL_TO not behaving as they should be in ArcPy

I want to select features by location using "Are identical to" method and then want to switch the selection so that I have only the features that have been edited or newly created. Then I'll select ...
1
vote
0answers
41 views

Calculate field with a value in a list based on field

I didn't want to write an if statement for every field. I wanted to know if there was another way to field calculate each field with the values related to it in this example table. Fields (X,Y,...
1
vote
0answers
39 views

arcpy.mapping.UpdateLayer returns runtime error

I am trying to update the style for a layer present in my saved map document with a source .lyr file present on my disk in the home folder. It returns an assertion error. The code I am trying to run ...
1
vote
1answer
61 views

Creating Attribute Rules using ArcPy in ArcGIS Pro

I am attempting to create attribute rules for a signalized intersection asset inventory, so when features are addded using collector they are automatically updated in the database. I am also working ...
0
votes
1answer
28 views

Choosing Field in Python Script Tool using ArcGIS Pro

I am writing a script to quickly split large FCs and make them shareable. So I need the tool needs to know what the FC name is and What the Field Name is to split the FC into manageable segments. To ...