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

Addin to Style Legend

I created an arcpy script to apply a style to my legend from my style template and it works when using the module within arcmap. But i want to add it as an addin button. import arcpy import Python ...
1
vote
1answer
26 views

Text element not updating in arcpy.mapping?

I am trying to get a text element to input an address using the below code. It seems that the code picks up the right elements, is finding the text elements I want to change but isn't able to actually ...
1
vote
1answer
38 views

Iterate a clip over multiple feature classes using Model Builder or ArcPy

I have multiple feature classes (buildings, airport, land, roads etc) that I would like to clip using a Local Authority boundary. I am trying to create a process in model builder or Arcpy that will ...
0
votes
0answers
6 views

Route Planning Tool for Runners When Given Start Point, End Point, and Distance [on hold]

My orgnization has ArcGIS Enterprise 10.6.1. I also have ArcGIS Pro 2.4.1 and ArcMap 10.5.1. I also have most extentions available such as Network Analyst and Spatial Analyst. I would like to ...
0
votes
1answer
14 views

Arcpy UploadServiceDefinition ignores folders and groups

I am using Esri's guidance for arcpy.UploadServiceDefinition_server (http://desktop.arcgis.com/en/arcmap/10.6/tools/server-toolbox/upload-service-definition.htm) I can successfully upload a service ...
0
votes
0answers
24 views

ERROR 999999: Error executing function. Failed to execute (CADToGeodatabase).What is the issue? [on hold]

import arcpy try: arcpy.env.workspace = "D:\PROJECT DETAILS\Database_Onsite\New File Geodatabase.gdb" Database = arcpy.env.workspace Drawing_Cad_File = "D:\PROJECT DETAILS\Database_Onsite\...
1
vote
1answer
47 views

Raster Combining in batch using ArcPy?

I am trying to combine two different raster files using a loop, with the following script. import arcpy import os thectr = 0 ws = arcpy.env.workspace = r'D:\BRB Snow Cover\Sample\TerAqua' ...
0
votes
1answer
19 views

Script that works in Python Toolbox not working in Standard Toolbox?

This script does not work in a Standard Toolbox but it works in a Python Toolbox. Do I need to delete all the parameters from the script? import arcpy, os, sys, shutil class Toolbox(object): ...
0
votes
0answers
15 views

Updating text elements not working when using APRX path vs “CURRENT”

I am beginner in ArcGIS Pro and I am trying to expand into using python with ArcGIS Pro. I have a working script that will update a specified text element in all layouts in ArcGIS Pro, in my case it's ...
0
votes
0answers
12 views

Missing area when using tabulate area in ArcPy?

I create a polygon layer including 80 buffer areas (they are not overlapping) and want to get the area of each value of a raster file for each buffer area. I can use the tabulate area to realize this ...
0
votes
0answers
13 views

Automation of tracing of line until point layer in ArcGIS Desktop? [on hold]

Problem- Water Distribution system Im doing tracing manual work in arcgis since a long time and want to automate it. Can you help me with any trick or python or VB script? Layers available one ...
0
votes
2answers
21 views

ArcPy: Select_Analysis Invalid Characters

The following script produces the ERROR 000210: Cannot create output... .shp and ERROR 000354: The name containts invalic characters Failed to execute (Select.). The line with arcpy.Select_analysis ...
0
votes
0answers
30 views

Using UpdateCursor in the same loop as SearchCursor

I have 2 layers, one with land plots and one with hazard zones. I want to iterate through the layer with land plots and for every plot I want to add 2 (or 3, depending on some variables) fields. Then ...
0
votes
2answers
66 views

Shift in raster in python 3.6

I have a python script for a color anomaly detection study. I am attempting to create two rasters each with three classes: one raster representing a "target" and the other representing "background", ...
0
votes
0answers
18 views

Snapping together lines within certain tolerance with ArcPy and Basic level license?

I have a GIS layer of bike lanes I created using an open-source GeoJSON which I converted to a shapefile using ArcPy. The end result looks pretty good, with one exception: there is some small gaps ...
0
votes
0answers
31 views

WindowsError: [Error 32]

I get a windows error when trying to run my tool again in the same arc project. It does run again once I shut down ArcMap and reopen and run the tool. Any Ideas? import arcpy, os, shutil, sys # ...
0
votes
1answer
30 views

Python batch script to delete Attributes

I currently have a script that will select and delete all the values less than 0.1 in a column. The script below works, however it specifies a specific .shp, I want to batch this so it runs through ...
0
votes
1answer
33 views

Copying feature service to local geodatabase using ArcPy and ArcGIS API for Python?

I am trying to export/copy a feature service to a local geodatabase where I can work on it locally. I have provided the code below. I keep getting an "Object: Error in executing tool" for the last ...
1
vote
1answer
30 views

ArcPy: Create NDVI with Raster Calculation and Map Algebra

My target is to create NDVI Rasters but I'm stuck with python loops, since I'm new to that, so sorry for a maybe basic question. I have 2 folders, one with rasters (tif) with the red band, the other ...
0
votes
2answers
43 views

arcpy Polyline.within(Polygon) return False for all lines between pairs of Polygon vertices

I'm trying to develop a function which will find the longest straight line length that can be drawn within any of the polygons in a feature class. (To keep things simple, I'm only including lines ...
1
vote
0answers
39 views

Writing more than 1000 rows with arcpy.da.InsertCursor? [on hold]

I have a GeoJSON which I'm able to successfully covert to a shapefile via the following process: using arcpy.asShape to find geometry, and inserting this geometry as new fields using cursor insertRow)....
0
votes
1answer
26 views

arcpy.SelectLayerByAttribute_management ExecuteError

This python code works in ArcGIS Pro but Not in ArcMap . I read some issues that mention a get around by making a feature layer. I tried that and I then get an error saying polytest doesn't exist. ...
0
votes
0answers
20 views

Import Arcpy error [duplicate]

I am having an issue with importing arcpy. Initially I thought that it might be that the version of the Anaconda software that I had been running was 64 bit, therefore I changed it to 32 bit to try ...
1
vote
0answers
12 views

Using two Python Addin Combo Boxes to choose Folder then Layer

I am trying to create a Python add-in for ArcMap for users to quickly select layer files from within several different folders. This will require 2 combo boxes. User selects the folder from the first ...
2
votes
1answer
52 views

Getting parameters of Python Toolbox tool to appear in ArcGIS Pro?

I can't get the parameters of my tool to show up in ArcGIS Pro 2.1 Because of my work I can't put my exact code here, but I'll put the skeleton of what I'm doing and hopefully someone can see what I'...
0
votes
1answer
21 views

ArcGIS geoprocessing DomainToTable_Management script crashing

I needed to dump all of the domains in my file geodatabase so missing values can be identified. The script runs fine if the domain name has no spaces but, unfortunately this one has many multi-word ...
2
votes
0answers
22 views

Exporting layout file from ArcGIS Pro project to *.pagx file using ArcPy?

I'm trying to implement a tool to import *.pagx files exported from ArcGIS Pro to a project, modify text elements and export the altered layouts back to the *.pagx files. It is pretty easy to export ...
0
votes
0answers
28 views

Creating raster from grid algebra expression using point attribute values?

I have a point shapefile representing groundwater production wells with annual pumpage values distributed over a general area. I'd like to create a raster layer with each cell representing the ...
2
votes
0answers
15 views

Is it possible to select annotation by color so that I can correct the Annotation Class?

I have some municipal data that was converted into a GIS and all of the address numbers were coded as dimensions in the annotation feature class. There is an annotation class for address, but none of ...
0
votes
1answer
29 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, ...
1
vote
1answer
35 views

Filter fields by expression arcpy

I have to trasform a script (which I didn't write myself) from QGIS to ArcMap. In the script a filter by expression is used. The function has the input inl (= the layer with the data that should be ...
0
votes
0answers
15 views

ArcGIS RuntimeError: Not signed into Portal [duplicate]

I'm running ArcGIS Pro Python IDLE and getting an error that says: RuntimeError: Not signed into Portal. This happens no matter how many times I run the script. I looked at my ArcGIS administrator to ...
0
votes
1answer
28 views

Opening/loading layer file in ArcPy?

I ran a script for location allocation on ArcPy, which worked. After running it, I used the Save to Layer File to save the result. Now that I have the result saved (and can even open on ArcMap), I ...
1
vote
0answers
30 views

Using ArcPy.AsShape results and converting them to feature class?

I have a GeoJSON that I'm trying to convert to a feature class or shapefile using ArcPy. The original GeoJSON is taken from a web link here: geojson Here's a sample of the GeoJSON: { "type": "...
2
votes
1answer
51 views

Getting ExecuteError: ERROR 001558: Error parsing JSON file in ArcPy?

I'm trying to convert some open-source data in JSON format to a shapefile for use in ArcGIS Desktop. I'm attempting to do this in ArcPy with ArcMap 10.7. The data I'm trying to access is here, in ...
0
votes
1answer
25 views

Making dropdown in ArcMap tool where each item links to spreadsheet?

The script below imports a spreadsheet into ArcMap and generates a shapefile. Currently, I can use the ArcMap tool that interfaces with the script to navigate to the spreadsheet I want to import. This ...
1
vote
1answer
29 views

Updating gdb with JSON?

parcelsFC = os.path.join('temp.gdb',JsonDirectoryLocation) arcpy.JSONToFeatures_conversion(parcelsFC) Created gdb with above code. How can I add attributes to gdb with another JSON file?
1
vote
2answers
45 views

Using SearchCursor and ArcPy to add message?

This Validates that all Polygons have a map unit. verify that the absence of a Map unit is caught by the check... here we test for the empty string or the python "None" type. Verify that this is how ...
2
votes
0answers
38 views

Obtaining extents of each data-driven page using ArcPy?

I have a set of index polygons (rectangles) that vary in size and orientation on which data-driven pages are based. I am looking for a method that would give me extents Xmin, Xmax, Ymin, & Ymax ...
1
vote
1answer
28 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 ...
3
votes
2answers
76 views

Saving Python objects into memory for repeated use of Python toolbox?

I have made a Python toolbox which processes relatively large polyline feature class (millions of features), builds a network graph from it as dictionary of lists, and depending on user selected ...
2
votes
1answer
60 views

Delete layer created during Buffer_analysis

I am trying to figure out how to delete the layer that is created during the Buffer_analysis line. I have searched all over the internet and have honestly tried about 100 different methods and cannot ...
1
vote
2answers
35 views

Performing Union_analysis on outputs created with arcpy.GetParameterAsText()?

I am trying to write a script tool for my geospatial programming class and I am stuck (this is an online course and we get NO support from our instructor). What I need to do is create buffers (...
0
votes
1answer
23 views

Make Query Layer only returns first row of each table

I have been trying to conduct an arcpy.MakeQueryLayer_management and it is only returning the first two values from each table in the SELECT. When I run the same SELECT statement in Oracle SQL ...
2
votes
2answers
62 views

How can I create an inset map in DDP that zooms to a feature in a layer besides the index layer?

(ArcMap 10.6.1) I have a map that is using DDP to index through and show ~1800 short line features (bridges), and I need the map to be pretty zoomed in because I'm wanting to show the immediate ...
0
votes
1answer
51 views

Getting same result with less code with PythonWin ArcPy? [closed]

I have finished writing code and it does what I need without having any error. However, I am wondering if there is any option to get the same result in fewer lines, pecially the for loop inside the ...
0
votes
0answers
13 views

Automate simple kriging of multiple fields from the same shapefile using ArcPy?

I'm trying to interpolate temperature data that's in multiple fields of a shapefile automatically using ArcPy. It doesn't sound like a difficult task but I'm new to both ArcGIS and Python, so here's ...
-1
votes
2answers
56 views

Updating Z coordinates of points in polygons with ArcPy

I am trying to update Z values of polygon shape with ArcPy. This script is working without error but increasing the first (0 position vertex) vertex twice. I want to update only once. How can I avoid ...
0
votes
1answer
52 views

Getting 'list' object has no attribute using ArcPy for ArcGIS Pro? [duplicate]

I am using ArcGIS Pro with Python 3.6. I'm posting this as a new question because I've made significant headway in narrowing down the problem. I believe the issue is how ArcPy is used with ArcMap ...
1
vote
0answers
24 views

Layers being removed erroneously at Python script tool finish? [closed]

I've got two Python scripts as a tools in a standard toolbox, and when the tools finish they will sometimes remove a layer from the MXD. It is most likely to happen on the first run of the tool ...