Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [arcpy]

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

743 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
0answers
62 views

Adding script tool to ModelBuilder in ArcMap?

I have create a script and want to add it to the model I have provided. The code is: import sys, string, os import arcpy import numpy Table = arcpy.GetParameterAsText(0) Field1 = arcpy....
2
votes
1answer
121 views

Cannot assign output field name to FieldMap

In attempting to map input fields to output fields, I am finding that I cannot correctly assign the output field name. Running the script produces no errors, but for a given FieldMap object, the ...
2
votes
1answer
106 views

Distinguishing between Layers and TableView using ArcPy?

I am working with ArcMap and am using ArcPy. My task is to loop through mxds and find broken data sources. My code is: mxd = arcpy.mapping.MapDocument(fullPath) brknMXD = arcpy.mapping....
2
votes
0answers
424 views

Automating topology error fixing with ArcPy?

I have a web application where folks upload a zipped up file geodatabase, I unzip it and manipulate the feature classes and then transfer them using insert cursors to an SDE database. I am wondering ...
2
votes
1answer
783 views

Run Python 3 scripts on ArcGIS Server 10.5

Is it possible to run Python 3 scripts on our ArcGIS Server 10.5 running windows? Basically, I have a script that I want to publish as a geoprocessing tool that exports an .aprx (ArcGIS Pro) file to a ...
2
votes
0answers
118 views

UpdateCursor doesn't give error until the next iteration ('NoneType' object is not iterable)

I have a string field within a GDB that does not accept all string values, giving a "The row contains a bad value" error. I have fixed the issue with InsertCursor (prompts user for new value), but can'...
2
votes
0answers
78 views

TableView has no workspacePath in ArcPy?

One of my colleagues is running a script which includes the following Python in ArcMap... oTble = arcpy.mapping.TableView(tbleName) Workspace = oTble.workspacePath print "oTble: '{}'".format(oTble) ...
2
votes
0answers
227 views

Programatically assigning NoData value in raster output?

I have written a tool that operates on raster data. When the tool finishes it outputs a raster into a gdb, but the output does not have a NoData value listed under properties (input does, output does ...
2
votes
0answers
173 views

Summing numeric attributes of field during Spatial Join using ArcPy?

Just performed a spatial join operation on a polygon layer (made of 500 grids cells) and point layer (1 million points). The aim was to find the sum of a field in the points layer (field AREA) during ...
2
votes
0answers
180 views

arcpy connect to accdb with 64bit background processing

I'm trying to read from a accdb MS Access Database via python in a ArcGIS Toolbox tool. I already established a database connection (via Add OLE DB in ArcCatalog) which I can use in a 32bit python ...
2
votes
0answers
38 views

Arcpy: MXD automatically removing layer whose data source was overwritten

I have a large script that does many things, but at the end it creates a buffer whose output is an existing feature class that is overwritten. That feature class is the data source for a layer that ...
2
votes
0answers
360 views

Unable to run scripts with arcpy using ArcGIS Pro and Pycharm?

I have installed ArcGIS Pro 2.0 which runs Python 3.5.3. I am trying to get started with the Arcpy library using the IDE PyCharm. I started a new project and pointed to the python file of the ArcGIS ...
2
votes
0answers
251 views

Using ArcGIS workspace defined as version in ArcPy?

I am trying to define my workspace as the current version that I am connected to. The Python tool that I am running utilizes the arcpy.da.Editor() function, and I used a workspace variable that is ...
2
votes
0answers
116 views

Iterate through layers in mxd and describe CRS

I have mxd's that have information loaded from many different locations (some FCs from FGDB, shps, FCs in EGDB) and I want to check the coordinate reference system quickly for them. I have attempted ...
2
votes
0answers
29 views

obtaining the viewer extent of an ArcGIS portal page w/ python widget

I will be hosting various locations of features on an ArcGIS portal page, and want to add a geoprocessing widget (Python toolbox) that will export those features currently seen in the viewer. The ...
2
votes
0answers
145 views

Faster equivalent of arcpy distanceTo method

Unfortunately arcpy distanceTo method is painfully slow. When speed is crucial, I am still using Avenue to work around it, but it is getting harder to transfer ArcView 3 to newer computers. As ...
2
votes
0answers
194 views

Manipulating Pop-ups using ArcPy with ArcGIS Pro?

I am using the ArcPy libary at the moment to manipulate data in layers. It looks like ArcGis Pro allows the user to use "pop-ups" for each layer which allows selected data to be displayed in a pop-...
2
votes
0answers
313 views

arcpy Union_analysis general function failure problem

As part of a longer script, I use this code: import arcpy, os Polygon = r"pathtoashapefile.shp" workspace = r"path_to_a_folder" output = os.path.join(workspace, "test.shp") arcpy.Union_analysis(...
2
votes
0answers
112 views

Understanding why arcpy.CreateScratchName() gets slower with more file geodatabases in folder?

In my ArcGIS Pro 1.4.1 application, I noticed that a short section of ArcPy code that creates a scratch name, and then uses that to create a file geodatabase (always in the same folder with the same ...
2
votes
0answers
105 views

Numpy Array to ArcGIS GRID gives dimensional error with masked array

I have an 84x73 masked numpy array to load into ArcGIS (version 10.3.1, Windows 8.1). To overcome the fact that Masked Numpy arrays cannot be saved to .npy file as of yet, I am saving my array from ...
2
votes
0answers
141 views

Problems using REST API to generate Tile Packages from World Topo (For Export)

Using the python script below it seems that I can request the generation of tile packages from an ESRI ArcMap REST service, and then download the resulting tpk file generated by ESRI. But when I try ...
2
votes
1answer
264 views

Make Feature Layer from Query Layer yields an ArcPy error?

My project starts from a MXD containing Query Layers. I have to prepare the data in this "MasterMXD" for use in an offline application. Working with ArcMap 10.2.1 for this project. My Python script ...
2
votes
0answers
226 views

Using update cursor to update feature class field from another table with incremental date/time query?

I have a feature class called AO15_16 where the field id needs to be updated. The update will contain a unique id based on a query of another table where I am querying issueddate, issuedtime and `...
2
votes
0answers
617 views

Using arcpy.FieldMappings() to load data into tables

I have been tasked with bringing in a dataset from one table with a hard and fast schema into another table with the same. Both tables have very similar fields, but the names and capitalization are ...
2
votes
0answers
104 views

Point Solar Radiation Computation using ArcPy?

I want to use ArcGIS Point Solar Radiation tool to compute the solar radiation for more than 1000 data points. The table for the shapefile point data looks like this: Hour represent the time of ...
2
votes
0answers
45 views

Referencing layer object which was created as result of geoprocessing inside MXD without iterating through TOC?

I am creating a python tool which must be run in and open MXD in ArcMap (10.2, ArcFM). The MXDs we use have a LOT of layers, and often multiple layers from the same datasource. In the script I need to ...
2
votes
0answers
246 views

Breaking single large raster into NumPyArrays using arcpy memory error

I'm trying to run raster calculator on a large raster file using the following approach : http://pro.arcgis.com/en/pro-app/arcpy/functions/rastertonumpyarray-function.htm, but I seem to run into ...
2
votes
0answers
127 views

Field Mapping in Custom ArcMap Script

I'm writing a script which takes, for its first two parameters, feature classes (or tables). For the third parameter, I want to provide the user with a field mapping option similar to what ArcMap uses ...
2
votes
0answers
348 views

Extract Values to Point “RASTERVALU” rename field

Is it possible to rename the RASTERVALU field on the attributes table, perhaps somewhere in the code? I need to loop thru this command for several raster files due to "Extract MultiValue to Point" ...
2
votes
0answers
42 views

ArcPy - Force layers to inherit their ColorMap when visualized

I have a large set of GeoTiff's which after manipulating I apply a colormap to the ones I want to visualize with: arcpy.AddColormap_management(raster, "", color_map) I then add them to my ...
2
votes
1answer
120 views

What permissions needed to add an index with a protected version?

Using arcpy and ArcGIS 10.1 SP1 (Build 3143) against an Oracle 11g enterprise geodatabase, I am trying to add an index to an existing attribute in an existing feature class: arcpy.AddIndex_management(...
2
votes
0answers
210 views

Locking/unlocking layout elements using ArcPy with Esri Production Mapping?

I need to update a text element in a group of MXDs that I manage. That element, however, is locked in the layout using the lock function from the Production Cartography tool. Using python, is there a ...
2
votes
0answers
160 views

How to save raster output in different directory without duplicate in set workspace? Arcpy

I am using the Weighted Overlay tool in Arcpy and I've not had this issue before with other tools. I'm wondering if it's a tool-specific problem. The output I get from the weighted overlay tool saves ...
2
votes
0answers
541 views

Pixel based Regression

I have 80 .tif files, and each pixel value represents NDVI. The whole stack of images is a time-series. I want to run a regression for each pixel using NDVI and time. I have tried to approach this ...
2
votes
0answers
628 views

Classifying data as Natural Breaks using ArcPy?

Is there any chance I can create a simple python script to classify my data as Natural Breaks? I have only created a script for quantile classification, but it is not enough for my work. arrp = ...
2
votes
0answers
42 views

How to export specific DDPs from a set of DDPs?

I have a set of data driven pages and I would like to have a string parameter in the tool that allows me to export specific pages from the set of data driven pages. An example would be if I had a set ...
2
votes
1answer
57 views

drop list from field to execute SQL request

I'm trying to create a python script that allows a selection attribute based on the name of a field in the attribute table of a layer. I would like to configure my script such a way that permits the ...
2
votes
0answers
73 views

Import csv value to an empty field in a point feature class

I have a .csv with three colums and a point feature class with an empty field that i would like to fill with a value of the csv. In the .csv i have 15 rows with a code. In the feature class just one ...
2
votes
0answers
273 views

Editing stretched raster legend labels using ArcPy?

I'm trying to edit a stretched raster legend item to only show values instead of the "High : " and "Low : " that are standard. I've created a layer template that doesn't include the high/low in the ...
2
votes
1answer
777 views

Python with ArcGIS: import scikit-learn fails (bad numpy.dtype)

I am trying to install scikit-learn 0.17.1 (current) into my Python 2.7.3 that accompanies my ArcGIS 10.2. The installation through easy_install goes through smoothly, but I get the following error on ...
2
votes
0answers
226 views

How to display geoprocessing service results in an ArcGIS Online Map?

I am implementing a python script that filters features in a feature service. For this I used the following lines of code: import arcpy # URL with service, where clause and field parameter baseURL= "...
2
votes
0answers
198 views

Arcpy doesn't recognize spatialite tables after editing with QGIS

I'm working on a project that would like to use spatialite as a go-between for field edits using QGIS/IntramapsRoam and then loading the data to a file geodatabase. The workflow is as follows ...
2
votes
0answers
126 views

Reading feature class attributes with or without quotes in ArcPy?

I'm working on a script that clips a batch of feature classes by a selection made in another feature class. The way it works is by reading the clip feature fields, then allowing the user to select the ...
2
votes
0answers
134 views

Counting Subdatasets in GRIB using ArcPy?

I'm trying to utilize the extractSubdataset_management tool on a large set of GRB files. Each GRB file has a different number of subdatasets. Is there any way to execute this tool on all subdatasets ...
2
votes
0answers
434 views

arcgisscripting.ExecuteError: ERROR 001270: Consolidating the data failed

I am working on PuTTY and trying to create service definition file in server. My Python script is creating .sddraft but I am receiving 'Consolidating the data failed' error when I run stage service ...
2
votes
0answers
174 views

Arcpy.sa NoData issue with saving TIFF

Similar to Reclassify raster values of 9999 to NoData, leaving all other values alone, in ArcGIS Desktop?, I am attempting to convert numerical NoData values to actual NoData cells. The solution in ...
2
votes
0answers
84 views

Spatial Analyst tools adding extra column of NoData

I've got a script tool in ArcGIS that runs Curvature and Aspect from Spatial Analyst, and the outputs of both contain an extra column. I've attempted to set the extent in the both the tool and the ...
2
votes
0answers
384 views

Arcpy script for summing pixel values in loop can't handle large number of rasters

I want to sum the pixel values of large numbers of rasters of different extents (ArcMap v10.2). 16GB RAM. I have the following code (with help from this site) which solves the different extent ...
2
votes
0answers
724 views

How to convert a raster file (*.tif) into a composite geodataset by using Python in ArcGIS 10.2.1

I created geotiff rasters (approximately 6000 rasters) in .tif format by using Matlab Mapping Toolbox. When I examined the properties of the data, I realised that it is 64 bit double type. I need to ...
2
votes
0answers
227 views

What can I use to calculate drive times /with/ traffic considered?

I am looking to obtain drive times for a large list of addresses and want the results to take traffic conditions into consideration. For example, drive times from a distribution centre to a store at ...