A site-package created by Esri to expose GeoProcessing from ArcGIS to Python.

learn more… | top users | synonyms (7)

2
votes
1answer
69 views

Converting mxd to earlier version using ArcPy?

I am running arcmap 10.2.2 but need to open an mxd saved using 10.3. I do not have access to 10.3. I have an arcpy tool which will do the conversion but it is not working from within 10.2.2. Does ...
-1
votes
1answer
66 views

Filtering the raster type in the arcpy.ListRasters() function

After having read the Help file of the arcpy function: ListRasters(), I cannot find a better way of filtering the raster type than adding some extra python coding. In detail, I have several files ...
1
vote
1answer
22 views

Debugging error 000865 in Python script tool for use with raster elevations?

I'm trying to create a python script tool that will take in a DEM/raster as a parameter, pull out the maximum and minimum elevation values, and iterate through this range of values at a specified ...
4
votes
0answers
59 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 ...
1
vote
1answer
59 views

arcpy.PackageWorkspace doesn't keep reference to SDE enterprise geodatabase

I am publishing a geoprocessing service on ArcGIS Server v10.3.0 that updates data on an ArcSDE Enterprise Geodatabase. I have the following at the beginning of my script: arcpy.env.workspace = ...
1
vote
1answer
54 views

how to save a raster after converted from numpy array?

I'm trying to save a raster after calculation in numpy array. Here is what I wrote: rasterSM = arcpy.NumPyArrayToRaster(SM, lowerLeft, cellSize, value_to_nodata=nodata) rasterSM2 = ...
4
votes
2answers
73 views

how to get max and min from a raster using arcpy?

I have a land surface temperature raster file and I want the max and min of it. minLSTresult = arcpy.GetRasterProperties_management(raster_result, "MINIMUM") minLST = minLSTresult.getOutput(0) ...
4
votes
4answers
148 views

Swapping Lat and Lon coordinates of shapefile?

I have a shapefile that consists of one polygon whose boundary is defined by a large number of points. Whoever originally made the file inverted the latitude and longitude coordinates, so the data ...
4
votes
1answer
61 views

Error saving object from python script using GetParameterAsText

I have a script that takes in a line, and creates a certain polygon based on this. My code obtaining the input information is as follows: inFC = arcpy.GetParameterAsText(0) hasClearway = ...
1
vote
1answer
60 views

Batch convert dgn files to separate shapefiles in ArcGIS

Actually, currently we are doing dgn -> shp file conversion using ogr2ogr. Batch convert dgn files to shp files using ogr2ogr The problem is, at times the point layer is not getting read properly ...
0
votes
0answers
30 views

Multiprocessing - Point Solar Radiation

I need help getting to work with point solar radiation and multiprocessing. I want to calculate solar radiation with all values from list (transmittivity, diffuse_Prop) by for loop. import arcpy, ...
3
votes
1answer
67 views

Skipping Non-spatial Data in For Loop

I'm working in ArcMap 10.3, and I have a script that searches through all the folder and files in a directory using arcpy.da.Walk, grabs any file containing a key word, and copies it over to new a gdb ...
2
votes
1answer
71 views

Python script outputs polygon feature class with no shape_area or shape_length and therefore doesn't show up in arcmap

I am trying to copy features a number of times based on a numeric field value. The code below works for points when the POINT type is chosen. However, when I switched the feature type to POLYGON it ...
1
vote
1answer
41 views

Convert searchcursor object to variable

(In advance i have to say that i'm a a self instructed greenhorn at python) I've vbeen struggling getting a seemingly simple job done: Using a python script, i would like to read through a table which ...
3
votes
0answers
43 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 ...
0
votes
1answer
30 views

How to update annotations from fields values to annotations objects

I have annotations feature class and need to update some field offset and alignment values When I edits them manually at attributes table in ArcMap, new values applies to objects and they changes ...
1
vote
2answers
43 views

Update Cursor keeps Crashing and Skipping

I use a 3rd party software that exports the name of JPEG as I collect points, in this case street signs. I know the names stay static and are all unique but different features may have the same JPEG ...
3
votes
1answer
31 views

Changing draw text element to be right to left using ArcPy?

I'm trying to produce a set of maps in certain locations using Data Driven Pages. I'm using a script written in python that generates a dynamic table in each sheet. The table has attributes of all the ...
1
vote
0answers
56 views

Creating Flooding depth Rasters at every feet

I am explaining the issue I am facing to automate the process. I have created a DEM from LIDAR and the Asset elevation is incorporated into the surface. Purpose of this task: Once I get the new ...
0
votes
0answers
10 views

Using ArcPy to insert Excel table into ArcMap Layout View? [duplicate]

I have been using python to batch automate maps and I have been using a manually drawn table on the layout view and have been using the ArcPy text elements to replace text with the values for each ...
5
votes
2answers
71 views

Changing grid interval using ArcPy?

I work with ArcGIS 10.3 (Python 2.7.8) and I need to change the grid interval in 70 MXD's. I tried to find Python code that can do it. Currently, the interval in each MXD is 200 meters and I need to ...
0
votes
0answers
22 views

ApplySymbologyFromLayer does not work in my python code

I have a layer file. I make a button in ArcGIS 10 with .NET. I want to change layer symbology with the layer file. For this purpose, I write python code and execute it from C#. If the following code ...
0
votes
0answers
41 views

Remove layers in sub folders using python- path orientation

Expanding on my previous question Remove layers using python- path orientation, i try to remove layers from mxd's (in ArcMap 10.3, Python 2.7.8), that don't appear in the layout view. The layers ...
0
votes
1answer
31 views

Remove layers using python- path orientation

Expanding on my previous question Code error - remove layer using python, i try to remove layers from mxd's (in ArcMap 10.3, python 2.7.8), that don't appear in the data frame with this code: import ...
3
votes
1answer
40 views

creating unique sets randomly distributed values for many defined areas…in a raster.

I have a large approximately circular study area comprised of 5000+ polygons which represent forest parcels. For each of these polygons I have up to 4 different species. These species occur in ...
2
votes
0answers
56 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
46 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. ...
1
vote
2answers
41 views

Unable to set ValueList for parameter in python tool in ArcGIS

I have a tool I am writing that takes in a multiple parameters. The last of these, Codenumber, I want to define to be 1,2,3 or 4. I am attempting to do this by use of a Value List. See below section ...
2
votes
2answers
54 views

Update a group layer using arcpy

I work with several MXD'S and i try to update a group layer named "allHa" containing several layers with this code: import arcpy,os,sys,string import arcpy.mapping from arcpy import env ...
0
votes
0answers
14 views

Apply Symbology to shapefile - change the field value but not the symbology (arcpy)

I have a shapefile that has multiple fields. I have a applied a manually applied graduated colors, and ranges. What I need to be able to do is copy the shapefile in the toc and change the Symbology ...
3
votes
1answer
42 views

Referencing Dataframe with ArcPy in Geoprocessing Service?

I have a geoprocessing service that was successfully published to our Server instance. I'm using 10.3 which means we could not publish unless it was successfully run as a tool in ArcMap. But now when ...
4
votes
2answers
56 views

What is the correct syntax for the geometry object's “intersect” method in ArcPy?

I'm building a script that utilizes the intersect method of the geometry class so that I can run an intersect analysis on individual polygons within a feature class. As stated here, "intersect ...
3
votes
1answer
25 views

Arcpy mapping text element reset

I am writing a script to create thousands of maps and I am trying to create a table that updates for every map. Basically an updating table of the information specific to each map. I have been trying ...
1
vote
1answer
57 views

How to handle temp files created during Extract by Mask (Spatial Analyst)?

I have three scripts running simultaneously that processes raster data in several directories. The problem I am encountering is that ArcGIS is creating a temporary grid file called 'Extract_recl1' ...
0
votes
0answers
18 views

Removing existing backup layers and renaming current live layer in ArcSDE

Looking at the attached screenshot of Catalog, there are the file "CRT_CANAL" and many backups. The aim of this code is deleting old backups in the ArcSDE database, renaming the existing "CRT_CANAL" ...
0
votes
1answer
58 views

How calculate sequential values based on group field?

In field calculator i calculate sequential values in field [ORDER_ID] What need change in script to calculate sequential values based on group field [GROUP_ID]. I select values manually and use ...
1
vote
0answers
44 views

Correctly Setting Spatial Reference for Geometry Objects when Geoprocessing

I'm attempting to find the nearest distance between a set of points, and a set of polygons. I don't want to use near tables because I have to do this operation for a large number of different ...
1
vote
0answers
28 views

Using arcpy to add several rasters

I need to do some raster/vector processing on some non-overlapping tiles. My python script needs to find the correct tiles and then extract the raster values and count them up. My script needs to be ...
1
vote
0answers
24 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 ...
1
vote
1answer
33 views

Append tool snippet not working in Pyscripter?

I need to append two shapefiles together. The append tool works within the ArcMap toolboxes AND Python window, but it does not work when copying over the python snippet to PyScripter. It'll completely ...
2
votes
2answers
54 views

Search MXDs with specific dataSource layer using Python

I work with ArcGIS 10.3 and I try to search a specific layer (with dataSource named "D:\desktop\Project\layers\1.jpg" ) in hundred of mxd's that spread in folder "D:\PROJECTS" and it divided to ...
2
votes
1answer
76 views

Looping through AGOL services with arcrest

Using this example I am trying to loop through my Arcgis Online account using ArcREST in order to download feature layers locally. However I have not been able to drill down into each folder to ...
1
vote
0answers
40 views

Zonal histogram script VALUE row suffix problem

I'm running 2 Python scripts. The first it is to apply Zonal Histogram to several rasters. The second it is for saving the Zonal Histograms to a text file. My problem is when the first script creates ...
6
votes
2answers
155 views

Calculate walking time on existing paths (hiking) in ArcGIS

I would like to calculate the walking time on existing paths in ArcGIS (hiking trails). I have a dem of my area (30px cell size) and I consider that the slope is the main factor which affect the ...
5
votes
1answer
66 views

Self written polygon tool is not creating output

I have written a script with the aim of producing a rectangular buffer from two sets of coordinates that denote the ends of a line. The aim is to create an array of points from the end points of the ...
0
votes
0answers
26 views

Overwrite existing Map Service through ArcPy keeping the existing cache tiling scheme

This is a follow-up question to Overwrite existing map service in ArcGIS Server 10.1 (through ArcPy) The issue arises when I try to overwrite a map service that has a cache already defined. If I ...
10
votes
2answers
208 views

Retrieving size of shapefile in ArcPy?

Is it possible to retrieve the size of a shapefile using python and arcpy? If so, how?
1
vote
1answer
40 views

Define Projections for layers with multiple locations in MXD's

# Script to use Layers in MXD source file paths to locate and redefine projections import arcpy, glob, os, sys, arcgisscripting mxd = arcpy.mapping.MapDocument("N:\MXDs\_ThomaKL\MXD GPS ...
3
votes
3answers
92 views

Using ArcPy to identify Shapefiles instead of os.walk() via *.shp file extension?

I am trying to write a script that identifies all Shapefiles within my folder structure and write a list of the .shp files with their full path file name to a newly created .txt file. I was able to ...
0
votes
0answers
29 views

ArcPy combination of different featurelayers in Combox

I developed a Combox which: combines values from different featurelayers the User can select an ID or activitycode (acode) the active view zooms to the object (biotop or Protected Area) The ...