A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

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

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

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, ...
0
votes
0answers
17 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
46 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 ...
1
vote
0answers
11 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/...
2
votes
0answers
77 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 ...
4
votes
2answers
143 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 ...
6
votes
1answer
774 views

Drawing shapes with highest possible decimal accuracy

I am trying to read input of lat and long to draw the shape based on condition.The input is standard array of lat and long with 15 decimal accuracy. I am realizing - I am loosing some decimal accuracy ...
1
vote
1answer
43 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 ...
1
vote
1answer
1k views

Count rows of attribute table of a shapefile in ArcGIS with Python

I need to count the rows of a certain selection of the attribute table of a shapefile. I am very new to Python and have never executed it in ArcGIS. When I run this code in the Python console of ...
2
votes
1answer
41 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? # ...
4
votes
3answers
4k views

How to truncate file geodatabase tables with Python?

I need to truncate file geodatabase tables (1 or all) with Python. What is the code for that?
2
votes
2answers
482 views

Error in response to “import arcpy” - RuntimeError: NotInitialized

I am setting up a new computer and installed ArcGIS 10.4 with Python 2.7.10. I then downloaded PyScripter to use as an editor. When I try import arcpy, I get the following error: Traceback (most ...
11
votes
5answers
17k views

Avoiding import arcpy error (RuntimeError: NotInitialized) when using IDLE?

ArcGIS Version: ArcGIS 10, Python 2.6.5 Machine: Windows 7 64bit (Intel) I'm receiving the following error when importing arcpy using the the IDLE (gui and cmd prompt) and when using pythonwin. I ...
-8
votes
0answers
30 views

Physical geography [closed]

Using earth.nullschool.net to understand high and low pressure areas and global circulation patterns ow click and drag the globe until the North Pole is centered in your screen. Next, click "earth" ...
0
votes
1answer
38 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 ...
6
votes
1answer
2k views

Deleting geoprocessing results in ArcGIS without closing mxd file

I am trying to run a loop of a couple thousand maps in ArcGIS Desktop 10.1 but the program keeps crashing after printing about 100 maps at a time. I read at GeoNet that I need to make sure my results ...
0
votes
2answers
50 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
1answer
44 views

arcpy.Mapping.UpdateLayer not working

The layer to be updated (ul) does not get applied with the style from the source layer (sl) and the code executes without throwing any error. import os import csv import arcpy #Set home geodatabase. ...
0
votes
1answer
65 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
0answers
22 views

ERROR 000210: Cannot create output from gdb [duplicate]

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 this ...
6
votes
1answer
749 views

Calling Python through BAT for Scheduled Task

I'm using ArcGIS 10.1 and setting up some scheduled tasks to run on our server. I am calling a python script in a .bat file. When it runs, the connection to our SDE database is "invalid" or do not ...
-1
votes
1answer
579 views

Export Query Layer to shapefile using arcpy [closed]

Composing a map using query layers in ArcGIS 10.4.1 (Basic) the final step is to backup the data used when the map is finalised. Exporting manually is straight forward. But using the conversion tool ...
1
vote
1answer
40 views

Why will arcpy.Project_management not create output?

I have 2 feature datasets in a .gdb (CNMS_Inventory and CNMS_Inventory_Albers). I set the dataset for CNMS_Inventory to 4269(NAD83) when I created it and it contains a feature class called ...
1
vote
0answers
54 views

TableToTable_conversion using PostgreSQL and ArcPy

Currently, I am trying to convert a geodb to a table in my PostgreSQL db with arcpy as such. I've tried both with the parcels table being created and the parcels table not being created arcpy....
3
votes
1answer
1k views

ArcPy not executing CopyFeatures_management to write feature class to ArcSDE geodatabase [closed]

I have some problems with my Python script. The script gets an JSON with different information about images. The information includes general information about images and also the gps position of them....
2
votes
1answer
68 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
0answers
21 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 ...
0
votes
0answers
27 views

Shortening use of If statements with ArcPy [closed]

New python user here I was wanting to know if what a better way to condense this update cursor script that I'm trying to write. database = 'C:\M2_Q3.gdb\data' attributes = ['S_0__FT_', 'S_1__FT_', '...
1
vote
2answers
222 views

CreateTable_management as part of a script tool fail

I am trying to create a table as part of a script tool, and it always fails with error 999999. The general idea of the script is that it is calculating proportional coverage of things in a series of ...
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
18 views

Changing URL in Data Source through ArcPy on ArcGIS Pro [closed]

I'm looking for Python code that grabs the URL of a Feature Service and replaces it with a different URL. Picture below:
0
votes
1answer
54 views

Accessing Specific Tile from Compact Cache v1 with ArcPy?

I'm trying to benchmark the read performance of different cache types. One of the cache types I'm benchmarking is the ESRI Compact Cache v1. If there is not a function in the ArcPy library which can ...
2
votes
1answer
36 views

Set Windows temp file location

I am running some ArcPy scripts and the tools keep wanting to write to my c:\users\appdata\local\temp location. I have set the scratchworkspace and workspace environment variables of arcpy to a drive ...
0
votes
0answers
35 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 ...
0
votes
1answer
40 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. ...
0
votes
1answer
561 views

Raster in TOC to geotiff on disk in ArcPy

I am attempting to automate some ArcGIS10 work w/ netcdf files. Basically, I am able to automate the creation of the netcdf into a raster with arcpy.MakeNetCDFRasterLayer_md. However, I would simply ...
1
vote
0answers
28 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
1answer
92 views

Specifying trusted SSL certs in ArcPy?

I know that you can do an https request in python, passing in a cert or bundle to requests.post(), with the verify argument. Is there any way to do something similar in ArcPy? I'd like to fully ...
1
vote
2answers
50 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
60 views

Importing ArcPy in PyCharm?

>>> import arcpy Traceback (most recent call last): File "<stdin>", line 1, in <module> File "D:\Program Files (x86)\ArcGIS10.5\Desktop10.5\ArcPy\arcpy\__init__.py", line 22, ...
4
votes
2answers
719 views

Union on lines using ArcPy?

Essentially I want to union multiple (20) congruent line shapefiles, where overlapping line segments in the input shapefiles are combined into a single resulting output shapefile. But I can't union ...
4
votes
2answers
953 views

Importing Survey123 SQLite Database from Device

I need to import an SQLite database generated by ESRI Survey123 to a csv or some other useful format. I modified this script so that I can use arcToolbox to acquire input and output parameters. I am ...
2
votes
1answer
33 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 ...
1
vote
1answer
36 views

Exporting webmap into PDF without layout using ArcPy with ArcGIS Pro

I try to export a webmap in using arcpy into a pdf. This works fine, if there is a Layout available using: aprx = arcpy.mp.ConvertWebMapToArcGISProject(webmap, None, None, notes_gdb) aprx....
0
votes
0answers
49 views

Writing multiple array expression using Python Parser and ArcPy cursor in ArcMap Field Calculator [closed]

What I need is when the SiteID_Species array has an occurrence > 1 then I would like to see if the last two Estimated_Area values have been Zero. If only the last two Estimated_Area values have been ...
0
votes
1answer
27 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 ...
0
votes
1answer
64 views

in cursor.updateRow(row) RuntimeError: Object invalid or no longer set

I'm running an arcpy code in IDLE that update a field in shapefile. After updating it get the following error: Traceback (most recent call last): File "C:/Users/10/Desktop/test.py", line 21, in ...
1
vote
1answer
105 views

Establishing attribute order in table using ArcPy with ArcGIS Pro?

I have the following piece of code hoping to have a table with a set of fields on a specific order: #Removing the fields we do NOT want to show in the output arcpy.MakeFeatureLayer_management(...
1
vote
1answer
129 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 ...
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 = ...