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

learn more… | top users | synonyms (8)

7
votes
0answers
275 views

Automating creation of ServiceDefinition from Python script tool of ArcPy without broken project data source?

Summary: I can create a ServiceDefinition through ArcCatalog or ArcMap, but when I try to generate the ServiceDefinition through python, it does not copy the /data folder with it, thus the script ...
6
votes
0answers
158 views

How do I get layers' IDs using python?

I am working in an ArcMap session, I've checked the option to get an ID for each of the layers in my document, so anyone has it. Now, what I need is a way to get these values within a python script ...
5
votes
0answers
124 views

Determining Thalweg line of river without bathymetry?

I have the boundaries and centerline of a river. The Thalweg line defines the deepest elevation of a watercourse (see Image taken from Google). I do not have accurate enough bathymetry or Digital ...
4
votes
0answers
72 views

Cell Statistics standard deviation values incorrect

I'm having some issues with the Cell Statistics tool in a python script I am writing. I am using 30 years worth of global cumulative annual rainfall data as input and am getting strange values in some ...
3
votes
0answers
50 views

Reading Jp2 compression level using ArcPy?

Is the compression quality level used to create a JPEG2000 image stored somewhere inside the file, and how to read it? I would like to know if my images where generated using a lossless compression ...
3
votes
0answers
67 views

Arcpy code only works when run in two chunks, not as one piece

I have a weird thing happening with my script. When I copy/paste it into the python cmd line within ArcMap, I get error messages. However, if I run the first part, then copy in the very last line by ...
3
votes
0answers
81 views

Select IDLE 2.7 (not 3.4) as default script tool editor for ArcPy with ArcGIS for Desktop?

I'm trying to set my default editor in ArcMap (10.3) to IDLE 2.7, but despite using the 2.7 path, when I right-click on a script tool and select Edit, it opens IDLE 3.4:
3
votes
0answers
42 views

Recovering toolbar from disconnected window?

I've faced this problem many times. I created a python addin toolbar and installed it in ArcGIS 10.2 . I work on dual monitors in the office. If accidentally this toolbox is left on the secondary ...
3
votes
0answers
34 views

Mask out values in a raster based on standard deviation

Does anyone know (in Modelbuilder or python) how I can remove any values of a raster that outside of the range of three standard deviations? I have a lot of rasters so it would be quicker than ...
3
votes
0answers
17 views

Problem Importing CAD features using arcpy.MakeFeatureLayer_management?

When importing multiple CAD drawings using "arcpy.MakeFeatureLayer_management" and "arcpy.Merge_management" I encountered a problem. Drawings that have line weights and elevation values assigned to ...
3
votes
0answers
67 views

matplotlib show() suspends ArcGIS

I've written a python script to plot a cross-section from a DEM along a line. Everything works fine except when I Show the plot, ArcGIS hangs and I have to force it to close with Task Manager. I ...
3
votes
0answers
42 views

Why does my Validation Script continue to run when adding the result to the map?

I am in the process of developing a python script that creates a list available imagery for our project areas that would then allow the user to choose which imagery source they would like to add to a ...
3
votes
0answers
261 views

ArcPy QueryPointAndDistance: Incorrect Lengths?

Background: I'm currently trying to determine the chainage (distance m) of my points along a polyline (i.e. proposed railway alignment). A colleague within my firm assisted me with the following ...
3
votes
0answers
140 views

ArcGIS Solar Radiation Tool - How is Local Solar Time/Local Time handled as input to the “within-day” time configuration?

I am scripting hourly interval runs of the Area Solar Radiation Tool, and need a hand understanding how to account for Local Solar Time (LST) versus Local Time (LT) within the tool. First off, I ...
3
votes
0answers
130 views

point feature to raster with count of unique points

I am using ArcGIS 10.1 with Python 2.7 I have a point layer with thousands of points that each hold an id value of its owner. One owner can have multiple points, meaning that points can have the same ...
3
votes
0answers
741 views

Changing workspace path of query layer using ArcPy?

I'm trying to change the workspace path of a query layer using the code below and it always breaks. The layer is connected to a view in an Oracle Spatial 10g database. The database is SDE enabled ...
3
votes
0answers
533 views

SetNull in Python script for Arcgis assign 0 value

I am writing a script in Python where I assign to few Tiff defined in a function as inputRaster a NoData value as follows: whereClauseSetNull = "VALUE > 100" outSetNull = SetNull(inputRaster, ...
3
votes
0answers
135 views

arcpy.mapping.ExportToTIFF fails to render layer?

Has anyone else had this problem? I have an mxd file with two layers in it, one of which is fairly 'heavy' (i.e. takes a minute or so to draw). All layers are visible by default. I have the ...
3
votes
0answers
408 views

How to use Python's subprocess module in a for loop ArcGIS?

I am new to scripting with ArcGIS. Although this might be an easy thing for those that know Python well, I haven't figured out how to use the subprocess module in a script. I actually think I'm ...
3
votes
0answers
171 views

Missing data and negative predictions - kriging daily rainfall?

I want to perform the interpolation of daily rainfall data for 7 years. I am now working on python using arcpy module. I face several problems while performing interpolation Some day there is no ...
3
votes
0answers
91 views

ArcPy: Initialize zero valued grid Raster and iteratively increment

I'm jumping right into ArcPy to help out a friend who needs to automate some ArcGIS work. The problem at hand can be reduced to the following pseudocode: accumulationRaster = SomeZeroedRaster for ...
3
votes
0answers
1k views

Cause of ExecuteError: ERROR 010067 from arcpy.sa.CostPath?

By using the code below that creates least-cost paths between several polygons, I obtain this error message: ExecuteError: ERROR 010067: Error in executing grid expression. Initalization failed ...
3
votes
0answers
472 views

How to extract zipped shapefile and check its shape type using arcpy module without writing on disk

I have a zipped shapefile saved on my disk. I want to extract it in memory and check the shape type. I'm using arcpy module and want to stick to only default modules comes with python installation. I ...
3
votes
0answers
263 views

python.multiprocessing and “FATAL ERROR (INFADI) MISSING DIRECTORY”

I have a question which is closely related to this old question here: python.multiprocessing and "FATAL ERROR (INFADI) MISSING DIRECTORY" I have also looked at this, which seems to relate ...
3
votes
0answers
82 views

arcpy adding time to Raster Mosiac Footprint

I am trying to create a raster mosiac for use in animating data over time. The current workflow is: Create .gdb (arcpy.CreateFileGDB_management) Create Raster Mosaic (arcpy....
2
votes
0answers
38 views

Using Arcpy.UpdateCursor to delete adjacency rows based on a group ID

I have this sample file shown in the picture 1 below. it is a sample data set of a phone survey of drivers. I am trying to find out when those drivers started to drive. My main goal is to build a ...
2
votes
0answers
19 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
0answers
53 views

ArcGIS Dissolve failing with small polygons

I have an arcpy script which clips (Clip_analysis) a shapefile of polygons to a grid square, converts any multipart polygons created to singlepart polygons (MultipartToSinglepart_management), runs ...
2
votes
0answers
32 views

Creating a Legend with arcpy and comtypes

I am relatively new working with python and arcobjects. Under normal limitations I know that you cannot create a Legend or any arcobject with arcpy.mapping. Is there a generic example of creating a ...
2
votes
0answers
17 views

How to create .sat files for .jpg tiles

I want to create map overlays for a TomTom GPS. Relief shading, ortophoto etc as map background while navigating in Map View mode. Instructions for creating custom overlay can be found here So far ...
2
votes
0answers
73 views

intermittent failures with SelectByLocation in an ArcPy addin

ArcGIS 10.2, Windows 10 this is the line that fails: arcpy.SelectLayerByLocation_management(WRS_layer, "INTERSECT", gridLayer, "", "NEW_SELECTION") The WRS_layer is in a file gdb, the gridLayer ...
2
votes
0answers
28 views

Using arcpy to loop through multiple network analysis tasks

I am writing a script with ArcPy to look at modelling closed roads and the length of possible diversions. This is being done with the network analyst tools. The basic process I am using is to: ...
2
votes
0answers
39 views

extracting raster using values

I have an original .tif file which has values ranging from 2 to 28. From that original .tif file, I am extracting cells having a value of >=10 using the following code: import arcpy, os from arcpy ...
2
votes
0answers
51 views

Extracting Mean from Raster and Writing to Table in ArcPy?

I am simply trying to extract the mean of each raster within a geodatabase and write the value to a table. I have done this successfully with another set of rasters, but now I keep getting the ...
2
votes
0answers
84 views

Benchmarking ArcPy / ArcMap Performance on different computers?

This project came out of my need to build a justification for a faster work computer. Before asking for new equipment I want to be prepared to show the increase in performance by adding RAM or more ...
2
votes
0answers
84 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
89 views

arcpy.AddIndex_management error for in_memory variable

I am trying to optimize a script that uses addJoin_management. To do this efficiently, I am attempting to add an attribute index on the join table. I am getting a generic error when i do this though. ...
2
votes
0answers
100 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
58 views

Arcpy.sa NoData issue with saving TIFF

Similar to the poster here, I am attempting to convert numerical NoData values to actual NoData cells. The solution in the linked question doesn't work for me, however, as when I use the save method ...
2
votes
0answers
86 views

Extracting Multivalues to Points from NETCDF4 Raster using ArcPy seems imprecise?

I'm getting some strange results in a multivalues to points extraction from a NETCDF4 layer from the MERRA reanalysis product. In particular, it seems like the values being assigned are way off in ...
2
votes
0answers
148 views

How to add a separator to an ArcGIS python add-in menu?

In several places (e.g. Making separator and button menu in customized Toolbar using ArcObjects?) I have seen it mentioned that the way to add a separator for add-in menus and toolbars is adding the ...
2
votes
0answers
86 views

arcpy RasterToNumPyArray causes shift in location of values

I am converting a couple rasters to arrays, then performing calculations on them. First step- polygon to raster. This creates a 1/0 mask that I can multiply the larger raster by. After noticing my ...
2
votes
0answers
87 views

How to save Result File from command line arcpy?

What do I need to do in order to get a custom arcpy script to save an execution run into the Results window, and/or just straight to an .rlt file directly? The script is run from the command line ...
2
votes
0answers
58 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
83 views

Cul-de-sac (curve) turns generation in flow for parallel lines using ArcGIS for Desktop?

I'm using ArcMap 10.2 and I need to generate a parallel lines within the polygon and connect them one to other with the curve, with the proper radius and return radius (the same as cul-de-sac tool ...
2
votes
0answers
105 views

Using ArcPy Python Add-In Interval Caller to do auto-refresh?

I am using this code set called pythonaddin_interval_caller (written by Jason Scheirer) to do some map refresh every several seconds. The code was designed for arcgis python-addin. The benefit of this ...
2
votes
0answers
32 views

I have a large dataset of lakes, which I want to group into n clusters, based on a target total amount of perimeter they have. Suggestions?

There's a longer explanation of why I'm interested in this below, but in short, I'm wondering how to run something like a k nearest neighbors formula, with the number of groups determined by a maximum ...
2
votes
0answers
203 views

Updating Field Mappings Parameter on table selection in Python Toolbox?

I am building a python toolbox with ArcPy and would like to associate an input feature class parameter with a field mapping, so that once user selects the input feature class the field map populates ...
2
votes
0answers
150 views

Using Python to iterate through directory to create event layer and perform kernel Density for each file?

I am new to Python for ArcGIS, but have been using ArcGIS a while. I have a large directory of tables with point data. For each file of each folder I want to create a kernel density layer. I have ...
2
votes
0answers
133 views

Inserting accumulative attribute in dynamic text element based on Date field using ArcGIS for Desktop?

I've got a line feature class that contains Date field. I've made a layout view in order to display time animation of this feature class. I've managed to enable the time option in the layer and to ...