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)

2
votes
0answers
564 views

Cost Path tool in script randomly throws error

I have a script tool that is creating a least cost path for sets of points using a Cursor. When applied, the script runs great, except every so often the tool is stopped because there is an error in ...
2
votes
0answers
295 views

Different results from Spatial Analyst GP Tool and Python

I am writing a script that has to subtract one raster from another. The rasters I have represent 1) Parking Lots (1 = Parking Lot, 0 = not Parking Lot) and 2) a buffer around the Parking Lot (1 = ...
2
votes
0answers
55 views

Difficulty in running the script

I have developed a script tool for adding a layer in the current map document. It did not work.. The message is "Completed script addlayer...". But there were no layers added in the TOC. Another issue ...
2
votes
0answers
835 views

Why does Clip analysis generate (some) empty output?

I am running a script that is working (see below) - it pulls a file from a folder, clips from that file based on an intersection with another file, and creates a new shapefile in a new folder. It has ...
2
votes
0answers
432 views

Can not get text element to update?

I can not get text element to update? Text ELement has been added "Subdivision" Still not updating?.. class ButtonClass2(object): """Implementation for FemaMapper_addin.button (Button)""" def ...
2
votes
0answers
176 views

Problem to transform events from one route to another

I have a road feature class layer containing parts like 1_10, 1_20. 2_10, 2_20... etc. 1_, 2_ is later used to create the route and _10, _20 is indicating the direction (the road feature classes were ...
2
votes
0answers
455 views

How to Load a Record Set Parameter in a tool dialog

I am trying to create a tool that allows a user to update a table row without starting an edit session. I have a script tool set up with a record set parameter and I use this set up to add new rows to ...
2
votes
0answers
2k views

Why am I getting an ERROR 000728: Field *fieldname* does not exist within table even though field exists?

I do some script for a shapefile's table. And this script works for 2 fields and do not for other ones, because of: ERROR 000728: Field FID_158_01 does not exist within table But this field is ...
2
votes
0answers
389 views

ArcGIS/arcpy: Geometry object comparison methods not working. Do they take z values into account?

I have an arcpy script that makes calculations based on an input PolygonZ feature class. What I need to do in several places in the script is test whether a point falls within a polygon in 2D. In ...
2
votes
0answers
221 views

How can I draw an ellipse filling the dataframe with ArcPy?

I need to modify one of my template scripts to draw a circle from the centre of the (inset) data frame to the edge of the data frame. This will then be used to clip the data frame to shape. I'm using ...
2
votes
0answers
465 views

On using R data with ArcPy to make histogram in ArcMap

I am writing a tool in python which passes parameters to a R script, which in turn creates a DBF file. I read this DBF and want to make a histogram out of the data inside ArcMap as one of the results ...
2
votes
0answers
108 views

network related issues arising when running an arcpy script

Essentially I wrote an arcpy script that is within a toolbox that I ported over to a different machine to test out after the script worked locally. The script essentially utilizes the psycopg module ...
2
votes
0answers
200 views

Is there any way to suppress the calculate field dialog box in arcpy script?

I've got a python script that I inherited. The python script takes input from a variety of feature classes and tables and spit it out to a single table. When I run this script via a scheduling ...
2
votes
0answers
775 views

ArcGIS 10.0/arcpy: Can't retrieve the points in a polyline geometry obect: any idea why?

My arcpy script builds a Python dictionary, dictCLPnts, that holds the geometry objects of a polyline feature class. The following code snippet shows the attempt to access the geometry object with ...
2
votes
0answers
1k views

Perfectly running python script gives error when run from web.py

I have the following python script which runs perfectly if run separately: import arcpy val = arcpy.GetCellValue_management("D:\dem-merged\lidar_wsg84", "-95.090174910630012 29.973962146120652", "")...
2
votes
0answers
854 views

Spatial Analyst Cell Statistics seems to give the wrong answer in ArcGIS 10.0

I have a script that calculates standard deviation for a list of grids using the Cell Statistics function in Spatial Analyst for ArcGIS 10.0 The syntax is this: stdevGrid = arcpy.sa.CellStatistics(...
1
vote
0answers
25 views

Creating and updating a table using outputs

I have the following code however I need the outputs in a table which can be analysed further. How can I: Create a blank table Create fields Take the outputs from the code below and input into the ...
1
vote
0answers
17 views

Retrieving user information in ArcGIS Server token protected geoprocessing service using ArcPy?

I have a geoprocessing service on ArcGIS server 10.3 that is protected with tokens. This GP Service is a python script. Is it possible to retrieve the user information, such username and password, ...
1
vote
0answers
35 views

Script to join .csv file to shapefile and export changing column names

I have a shapefile with an attribute table like this: FID Shape ID 0 Polgyon 3 1 Polgyon 3 2 Polygon 3 3 Polygon 3 and numerous csv files which look something ...
1
vote
0answers
36 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 = ...
1
vote
0answers
39 views

Calculating polygon width ArcGIS 10.4

I am trying to calculate an average width of a large set of polygons. I found the script below researching the topic. The function is: def add_average_width(featureClass, averageWidthField='Width'): ...
1
vote
0answers
60 views

Using file opened by GUI in python?

I have these lines of code: import tkFileDialog, arcpy, arcpy.da, numpy as np, Tkinter import arcpy.mapping as mapping fc = tkFileDialog.askopenfilename(filetypes=[('shapefiles','*.shp')],title='...
1
vote
0answers
18 views

Dataset C:\msurya\teritory.sd does not exist or is not supported Failed to execute (UploadServiceDefinition)

I am trying to execute the pythonscript code for the automation of a mapservice. While execution tempdraft.sddraft, and updatedDraft.sddraft files are automatically generated but .SD file has not ...
1
vote
0answers
33 views

How do I use a field attribute in the file name of a PDF export?

I've made a script that iterates through a set of data driven pages. Right now I have it that just the ID number of the data driven page is used in the file name to distinguish between each export. ...
1
vote
0answers
22 views

Nightly backup using Import XML Document arcpy ERROR 000791

I'm having some trouble using arcpy.ImportXMLWorkspaceDocument_management to import an XML document into a file geodatabase for a nightly backup routine. The code for the import is as follows: try: ...
1
vote
0answers
45 views

Pycharm cannot find reference 'SearchCursor' in 'arcpy.da'

Whenever I try to use a search cursor from arcpy in pycharm, I get this unresolved reference error. I should note that it was working fine earlier in the night, I have no idea what happened. I've ...
1
vote
0answers
26 views

arcRest Token Required

I'm using the arcRest sample copy_item.py file to save an AGOL feature service. The complete script on ESRI's github page is here: https://github.com/Esri/ArcREST/blob/master/samples/copy_item.py I'...
1
vote
0answers
44 views

Arcpy: Delete rows from joined table

I would like to delete all rows which are joined to a layer from a csv table. Only the joined records which match (keep only matching records) should be deleted. After the records are deleted, the ...
1
vote
0answers
39 views

spatial join field mapping Arcpy, change merge rule

I have a line feature class which represents a stream network. At a confluence of two river segments, I'm joining the stream segments to the point of intersection via spatial join (one to one join). I ...
1
vote
0answers
29 views

Using ArcPy to run Create Random Raster tool executes successfully every other time, but fails with ERROR 999999 on alternate runs?

I am trying to create a python script to run several ArcMap tools in succession on a DEM. The script will ideally create a random raster (based on a normal distribution, with a mean of 0 and a ...
1
vote
0answers
46 views

Exporting Data Driven pages as JPEG with World File

I have a script that works to export my pages as jpegs, but I want to add the world file to them. I don't want to have to do all the {df} args and whatnot, I just want to skip to the world file. How ...
1
vote
0answers
44 views

Dynamically change labels/symbology to create multiple maps of the same dataset in ArcMap 10.1

I'm working in ArcMap 10.1. I have a data-set of multiple acreage fields that I am joining against a polygon shapefile. Let's say I have acreage fields X, Y & Z (in reality there about a dozen ...
1
vote
0answers
29 views

Prevent ModelBuilder Tools From Running if Published to ArcGIS Server

I'm looking for a way to prevent an ArcGIS ModelBuilder tool from running if it's been published to ArcGIS Server. Or, even better, for a way to prevent the tool from being published to Server in the ...
1
vote
0answers
55 views

Can a map be added to a report generated through ExportReport using Python?

I am currently able to generate a PDF report using arcpy's ExportReport that contains attribute information for records within an attribute table, but is there a way to add a map to that report, as ...
1
vote
0answers
37 views

Arcpy ApplySymbologyFromLayer color problems with extent

I am batch automating PDF maps with many overlapping layers and many different symbology colors. When the map is zoomed far out- two of the layers, lets call it line1 (the only blue layer) and line2 (...
1
vote
0answers
25 views

How to cut polygons to fit grid ArcGIS 10.3

I have a map that displays the distribution of different types of karst all over the US. The different types of soil are portrayed through polygons. I've also created a grid that divides the US, and ...
1
vote
0answers
25 views

Model Builder: Iterating files; Don't know what to make “input” in later tool

I have a simple model where I am trying to iterate through a year of daily tif's and recode everything in them as either snow covered ground or not snow. My problem is I have no clue what to put ...
1
vote
0answers
34 views

How to use arpy.mapping to change 'out jpeg' name to reflect page name

I am an experienced Arc user but new to python. I can not figure out where my syntax is wrong. I'm trying to use data driven pages to export to jpeg where the name of the file is the page name. It ...
1
vote
0answers
25 views

drop list from field to excute SQL request

i'm new to Python programming and now I try to create a python script that allows a selection attribute based on the name of a field in the attribute table of a layer and I would like to configure my ...
1
vote
0answers
23 views

Check whether any feature classes in multiple gdb's has feature class representation

I am trying to find whether any feature classes in multiple gdb's has Feature class representation. If a feature class has represenation, "RuleID" & "override" fields will be in the attribute ...
1
vote
0answers
47 views

Can't specify OID field in arcpy.MakeQueryLayer_management

I manage a library of query layers and have recently had the need to apply the same update to a bunch of them at once. Seems the only way to do that in python is to create new ones and apply ...
1
vote
0answers
39 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 ...
1
vote
0answers
34 views

Classifying a Raster with Unique Values from Existing Layer File and Dynamically Change Labels - How to Create a UniqueValues Raster Layer File?

I'm creating a python tool that needs to have the output raster added to the current map and symbolized using unique values. I have been able to accomplish this by creating a template layer file and ...
1
vote
0answers
74 views

Command works in Console, but not in Python Toolbox

I want to create a memory layer with points in ArcGIS with Python Toolbox. I found an in_memory function. Here is the question: Why this command works in Python Console in ArcGIS, but not in Python ...
1
vote
0answers
26 views

Scripting cursor updates to ArcGIS Online feature is somehow failing

I'm charged with maintaining QA logs embedded in a feature on ArcGIS Online. Basically I just have to change some fields in the feature. The problem is that I wrote scripts using cursors to update ...
1
vote
0answers
63 views

Debugging looped python script (updating picture element link)?

Can anyone help with the following script? It's goal is to list every mxd in a folder, list picture elements in them and the change the path for a specific element. Here's an update version of the ...
1
vote
0answers
27 views

Arcpy Result object - status Waiting, Cancelling, etc?

This is a question similar to Using ArcPy Result object associated with Currently Running Script. I'm curious about how result objects in arcpy can have certain statuses that indicate a geoprocess ...
1
vote
0answers
52 views

How do I edit 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 ...
1
vote
0answers
30 views

Installing Python/site packages on LAN server

I'm going to be sharing an ArcGIS script tool with coworkers and I want to store all necessary mxds, gdbs, and script files in one folder on the server so the file paths are absolute. However, the ...
1
vote
0answers
64 views

arcpy symbologyType is always OTHER, but I need UNIQUE_VALUES

I am trying to load a TIF file to the mxd using arcpy, then add a definition file to map colouring. For one layer I have the problem, that the amount of values will always be different, sometimes it ...