Questions tagged [arcpy]

A site-package created by Esri to expose ArcGIS Desktop (ArcMap and ArcGIS Pro) geoprocessing, mapping, etc, to Python.

828 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
1answer
1k views

Renaming 1,200 rasters in File Geodatabase using ArcPy

I've been tasked with renaming a large amount of raster files within a file geodatabase (ArcGIS style). I'm taking weather data which has a name format as such: "G"mmddhhhh I'm trying to add a year ...
4
votes
0answers
60 views

Set default values when value is added to value table in Python Toolbox tool

Similar to Set default values for value table in Python Toolbox tool, I'm trying to populate a value table with default values. However for the linked question the value table is populated once an ...
4
votes
0answers
153 views

Check for mxd write access with python addin

I'm looking for a way to check for write access to an mxd upon the initiation of a python addin tool. My tool should only be enabled if the user has write access to the mxd. I thought there was a way ...
4
votes
0answers
197 views

Adding layer with ArcObjects from Python script tool?

I would like to load an AFR file into a data frame in a currently open MXD and the IMap.AddLayer function is not working as expected if the data frame in which to load the AFR file is activate. And I ...
4
votes
0answers
503 views

Import processing module from QGIS into Python Window of ArcCatalog

It is possible to import processing module from QGIS and run it in Python Window of ArcCatalog? I tried in QGIS import sys output = sys.path and copy output to ArcGIS Python console: import sys ...
4
votes
1answer
1k views

Select and copy attributes features in ArcMap using Python add-in tool?

I'm trying to add a tool to an add-in toolbar to select features from an existing feature class and copy attributes to another feature class, from point to point. TopoHeight_Field_Name='Comment' def ...
3
votes
0answers
39 views

Searching multiple geodatabases for feature classes and merging the results

I've got some Sea Level Rise data from NOAA (https://coast.noaa.gov/slrdata/) stored in 66 different geodatabases. Each geodatabase represents a state or district and contains a set of feature classes ...
3
votes
0answers
121 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 ...
3
votes
0answers
91 views

Making ArcGIS Python Add-In Extension immediately functional after install?

I have a Python add-in that includes an extension class. The only purpose of this extension is for some buttons in the add-in to be automatically enabled/disabled depending on if there are relevant ...
3
votes
0answers
144 views

Check Geometry - Bad Envelope

I have a polygon feature which returns Bad envelope when run through the Check Geometry tool. According to the help: Bad envelope : The envelope does not match the coordinate extent of the ...
3
votes
0answers
306 views

Using RemapRange for Reclassify in ArcPy gives ERRORS 000622 and 000628?

I am trying to reclassify a raster, "Conifer_Focl", which lives in inputData.gdb. The max value for "Conifer_Focl" is 33.217064. I'm looking to reclassify as: I am following the instructions from ...
3
votes
0answers
132 views

Applying Symbology to layer through ArcPy script and values are getting changed?

I am doing a raster calculation over a hdf file and after that i have to apply symbology on it.When i am applying Symbology to the raster layer through script .its values get changed as compared to ...
3
votes
0answers
388 views

ArcGIS pythonaddins.ProgressDialog inconsistent progress bar drawing

I am trying to use pythonaddins.ProgressDialog in a Python add-in. I am on ArcGIS 10.4. I will need to perform several steps that will take some time. To show how much work is done, I plan to use a ...
3
votes
0answers
992 views

arcpy.Delete_management does not delete the directory

I got a problem with Delete_management when I use the FeatureclassToCoverage_conversion function. I don't know why in the gdb I use (arcpy.env.scratchGDB), while the Delete_management is working, the ...
3
votes
0answers
3k views

How to edit a service definition file (SD) so as to change the Data source (User in oracle)

I am using Oracle 11g ArcGIS 10.2 Considering I have an enterprise geodatabase and I am connected as user1/mypass@myIP/xe I create a map from my table "mylocations" I choose share as service-->...
3
votes
0answers
1k views

Get Unique Field Values Within Python Script Tool

Using ArcGIS 10.2.2 and Python. I have a script that currently counts the number of points (representing crimes) in each zip code area, and writes that value to a new column in the FC that contains ...
3
votes
0answers
451 views

How to extract NetCDF raster values to time enabled shapefiles?

Does anyone know a good way to extract NetCDF raster values to each data point from a time enabled shapefile at the correct time? I have tried using a python script tool and a loop that steps ...
3
votes
1answer
124 views

Python upload to service fails in FME but works in ArcGIS

I have added a shutdown Python script to my FME workbench to publish the TIFFs written as a service. import fme import arcpy AGSconnection = "W:\\Entity\\ABZ\\myfolderpath\\gbepabz-file.name.ags" ...
2
votes
0answers
27 views

Raster algebra (subtract) changes extent of output

I have a tool that calculates volume of a portion of a raster DTM. I first clip a portion of the entire raster then fill it. I then subtract the clipped original from the filled raster. My problem is ...
2
votes
0answers
38 views

Exporting all Map Series pages to PDF with page name as output file name using ArcPy

I am trying to export all of my current map series pages into multiple PDFs with the Page Name as the file name. So, "PAGENAME.pdf"... Currently, the code runs, but no output is given. I ...
2
votes
0answers
19 views

My AddLayer script doesn't work within a model but works well on its own

I'm trying to write a script in order to add a output to display (For some reasons I want add the data using a script) This is my script: import arcpy.mapping as mapping mxd = mapping.MapDocument("...
2
votes
0answers
17 views

Determining raster points inside polygon

I am trying to perform zonal statistics on a input DEM and a polygon shapefile using ArcPy in Python 2.7. I have done this in Python 3, but want to be able to do it using ArcPy tools in Python 2.7. So ...
2
votes
0answers
30 views

Python script runtime error - ImportToolbox and run a custom geoprocessing tool

I am very new to Python. I created a simple tool using Model Builder that updates a few columns of data in a SDE feature class. The model runs perfectly within ArcMap 10.5. I need this script to ...
2
votes
1answer
121 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
61 views

Using 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 ...
2
votes
1answer
54 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 ...
2
votes
0answers
26 views

Transforming descriptive CSV data to known locations in GIS using Python

I have to transfer CSV data that describes a FROM and TO segment into spatial data. The segment descriptions do not follow any logical convention, but rather describe road junctions, places, or road ...
2
votes
0answers
27 views

Variable type for Value Table parameter in Modelbuilder?

I've created a python tool with a multivalue input box (parameter type: GPValueTable). The box is small and will contain long strings. I'm hoping to be able to add values to the input box with ...
2
votes
0answers
114 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 ...
2
votes
0answers
35 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
0answers
37 views

Where_Clause expression working for one FeatureClassToFeatureClass_conversion export but not another

I am attempting to export a feature class to both a shapefile and feature class with a where_clause restriction on particular values within particular fields. I have written a function to take dataset ...
2
votes
0answers
43 views

ESRI Geometry Union slower than Built in dissolve which is slower than Shapely

I work with point datasets a lot. We try to keep a running layer of points and update the dataset with new points while removing the old points. So, we do a lot of checking the extents of the new ...
2
votes
1answer
41 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 ...
2
votes
1answer
212 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 ...
2
votes
0answers
37 views

Selecting annotation by color to correct Annotation Class using ArcPy?

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 ...
2
votes
0answers
48 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 ...
2
votes
0answers
72 views

import arcpy in multiprocessing make script to hang indefinitely

I have a simple script to test multiprocessing with arcpy, but the script hang indefinitely. The problem is with the import arcpy statement that seems to be a problem in the child processes. Other ...
2
votes
0answers
52 views

Speed up ArcPy CopyRows_management process on large feature layer?

I am attempting to automate an ArcMap process with Python and I am having difficulty with a particular part of a process taking too long when performed on larger datasets. The process is as follows: ...
2
votes
0answers
280 views

Arcpy 'Append_management' much slower than ArcMap Tool?

Basically I have a script that grabs data from a web service, parses it, stores it in an intermediary local fgdb, then appends that data to the feature class in the enterprise gdb. The portion of the ...
2
votes
0answers
38 views

ArcPy name raster layer

I am using ArcPy to save a TIFF file in a geodatabase file with this code: arcpy.RasterToGeodatabase_conversion(Input_Rasters=r'D:\Projects\GEBCO_2019_Geotiff.tif', Output_Geodatabase=r'D:\Projects\...
2
votes
2answers
66 views

Opening different XLS spreadsheets as table with ArcPy?

I am trying to write a Python script that uses a xls file with different spreadsheets as input to build features and domains in a geodatabase. This is the data in Sheet1: and this the data in ...
2
votes
0answers
398 views

Deleting temporary files from geoprocessing tools using ArcPy

As is not possible formulate, or add a solution to question: Delete temporary files from geoprocessing in ArcGIS 10 and above , because is [closed] I would like to make this question with same ...
2
votes
0answers
81 views

Creating features from JSON without writing to disk first using ArcPy?

In ArcPy, I want to use JSONToFeatures_conversion, but I'm working with data that I pulled from a web service. I have no need to save the data to disk. So, I thought I could do something like this: ...
2
votes
0answers
105 views

ListDatasets() returning empty array on sde workspace

I am trying to get list of datasets within sde connection.This sde connection is already present in ArcMap and all datasets are visible. I am posting snapshot my code. It is returning empty array,...
2
votes
0answers
28 views

arcpy.ArcSDESQLExecute with UPDATE and OUTPUT

Is there a way to get OUTPUT through arcpy.ArcSDESQLExecute? Whatever I do I get only True. When running UPDATE through MS SQL Server Management Studio I get OBJECTID of all updated features (rows): ...
2
votes
0answers
42 views

Removing extra dots when loading Python script

This is probably a silly question, but I'm having a problem whenever I load a Python script in ArcMap where extra dots are loaded with the script (see below) that I must manually delete prior to ...
2
votes
0answers
218 views

Copying tables results in duplication of some tables, feature classes and relationship classes

ArcGIS Pro 2.2.3. I have a file geodatabase called "supportSource.gdb" with 3 tables, 2 feature classes and 3 relationship classes. I just want to copy the contents of this file geodatabase to ...
2
votes
1answer
978 views

Using Reclass in Arcpy, Error 010005: Unable to Allocate Memory

I've derived a raster of slopes from a 10 m DEM resampled to 15 m for an area of approximately 20,000 mi^2. I want to use Python to reclassify those slopes into categories according to range, but ...
2
votes
0answers
413 views

Moving Feature Class to Different Feature Dataset within Same File Geodatabase using ArcPy?

I want to progammatically move a feature class into a different feature dataset within the same file geodatabase. I'm wondering if there is a way of doing this without including code to rename and ...
2
votes
0answers
85 views

Map Algebra loop only creating one raster

I'm trying to transform a bunch of rasters in arcpy according to specific functions to create suitability rasters. This portion of the code is supposed to find all the rasters with interpolated ...

1
2 3 4 5
17