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

learn more… | top users | synonyms (7)

2
votes
2answers
87 views

Remove tables - not just layers - from the map document

How do you remove tables/table views from the table of contents (TOC) in the map document? I've written code that cleans things up after each tool run, but I cannot figure out how to get rid of the ...
1
vote
1answer
41 views

arcpy.TableToExcel_conversion works on layer but not if layer is variable

I'd like to loop through a bunch of mxds, on every layers, and from them I'm trying to export excel files. If I use a layer in arcpy.TableToExcel_conversion it works, but as I set a layer as a ...
1
vote
1answer
60 views

Recalculate fields value using ArcPy and Calculate Field tool?

Im not sure how to pass through a list of fields within the calculate field tool.I have a list of fields and each of them need to be divided by 1000. My code is as follows: import arcpy shp = ...
0
votes
1answer
102 views

How to find identical street names with consecutively numbered addresses using Arcpy

I am trying to write a python script that will only select multiple rows with the same street name if they have consecutively numbered addresses and then place those street names in a list. For ...
1
vote
1answer
83 views

Getting Error 999999 from arcpy.SpatialReference.name?

I'm trying to build a set that consists of spatial reference names using .name method from the arcpy.SpatialRefernce() class. When I do this for a single prj file there is no issue, but when I try to ...
0
votes
0answers
65 views

Arcpy Intellisense in Visual Studio Code - pythonVSCode extension

I'm looking for help on the correct way to setup Intellisense for ArcPy under Don Jayamanne's popular PythonVsCode extension for Visual Studio Code. The project wiki details configuration of ...
1
vote
0answers
26 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
1answer
59 views

Pass sql expression with GetParameterAsText to SelectLayerbyAttribute in .py script

With Arctoolbox and python scripting I'm creating long tool, but one of the steps is to select by attributes with SQL expression. Let's imagine that: featureCar = arcpy.GetParameterAsText(0) is Data ...
0
votes
1answer
40 views

Automation KeyError using Search Cursor / Data Dictionary

I recently received help in modifying a previous code for structures as part of project. The first time I ran it the code worked fine, but when I went to double check it. I keep receiving: ...
2
votes
2answers
80 views

Determining whether point is on left or right side of road using ArcPy?

Is there any way to determine the left or right side of road using arcpy? I was able to find if road is going from north to south,south to north,east to west or west to east.link that helped:- How ...
0
votes
3answers
69 views

Extracting value of raster for specific points (with X and Y coord) and write to column in Attribute Table?

I have specific points in shp file and list of rasters in the same coord system and want to extract values from rasters for each point and place these values in column in Attribute Table of ...
1
vote
1answer
30 views

The same value for X and Y in Attribute Table

I want to extract X and Y coordinates of points from shp file - infc, and put them to corresponding columns in Attribute Table. My code just give the same X and Y for all points in Attribute Table: ...
3
votes
3answers
69 views

Using Copy (Management) from GetParametersAsText() in ArcPy?

Having some issues getting the arcpy.Copy_management to work. Essentially I simply would like to be able to have a user select a folder which contains multiple shapefiles and copy them to another user ...
3
votes
1answer
74 views

Change Map Title Block Information through ArcPy

I am new to python, but I'm currently working on a script tool to loop through all MXDs within a folder and change their associated title block information(Map Title, Report Title, Date, Charge Code, ...
1
vote
0answers
44 views

Creating button on Python AddIn toolbar to run python script when clicked? [closed]

I need to create a button on toolbar of arcgis 10.2 who run a python 2.7 script created before when I click. Then I need to know if it's possible in this button that script write results to an excel ...
2
votes
1answer
33 views

save as Layer script not working

I've created script in Python for ArcGIS to save shape file as layer file..the code throws an error ERROR 000732: Input Layer: Dataset D:\core i 5 data\symon assignment\Swat\clipped\buffer.shp ...
-1
votes
1answer
53 views

Insert Cursor not creating polygon

I used this code to create a polygon in my map, but the polygon isn't showing up anywhere. Does anyone know why? Here is my code: fc = "U:\BuildingFootprints.gdb\BuildingFootprintsCopy" cursor = ...
2
votes
0answers
38 views

ListFeatureClasses isn't returning anything in GDB [closed]

I am writing a script that performs a series of operations on line, point, and polygon files in my file geodatabase matched through a unique number in their filenames. My geodatabase looks like this: ...
0
votes
0answers
49 views

Arcpy expression using date field and today's date?

I would like to create an expression similar to the following to incorporate into the arcpy.SelectLayerByAttribute_management function. It's not correct, I just wrote down what I would like it to do. ...
3
votes
1answer
60 views

Transfering features class from ArcSDE to File Geodatabase using ArcPy?

I would like to know if it's possible to use python to transfer features class from SDE into a GDB and then transfer it back to SDE without losing SDE parameters such topology, versionning, ...
1
vote
2answers
29 views

Add raster attribute table to raster using arcpy

I have downloaded US soil raster data by state from https://gdg.sc.egov.usda.gov/GDGOrder.aspx at 10m resolution. I am now trying to add a modified raster attribute table to tif that was exported ...
1
vote
2answers
39 views

Arcpy Reclassify by Standard Deviation

I would need some help with the Reclassify tool. I have written a script that produces rasters which I need to reclassify. My problem is, I want the values to be reclassified by standard deviation ...
2
votes
2answers
77 views

Update Cursor for automation of tedious data entry which keeps crashing ArcMap

I coded the Update Cursor for automation of tedious data entry where I am applying a previous Survey Company Identification Data to STRUCTURES_15096.shp from "OFFICIAL_STRUCTURES2015.shp" and it keeps ...
0
votes
1answer
40 views

How to list features “in_memory”

I have a script that creates a number of features "in_memory." Once I have them in memory I need my script to create a list of everything "in_memory" - I'm not sure how to achieve this. Is anyone ...
0
votes
0answers
22 views

Save update feature class (Python toolbox)

I created a Python Toolbox tool to reorder fields I am trying to save the feature class determine path,any advise? here is acode I'm trying: import arcpy import os class Toolbox(object): def ...
1
vote
4answers
71 views

Run a model in arcpy

I have been looking at ways to run a ArcGIS model directly in arcpy, without having to export it and correct all sorts of things in the code. But somehow I can't seem to make it work. This is how I ...
0
votes
1answer
57 views

Spatial Reference not working with If-Else

I'm attempting to use a script to check a folder of data sets to see if they match a projection of another data set in a target folder. I need to be able to re project any that don't match the same ...
3
votes
1answer
28 views

Automate map symbology using varying input data in ArcGIS/arcpy?

I'd like to generate a series of maps, where each map displays graduated colors based on a different variable in the feature's attribute table. The geographic area is the same in each map. I'm using ...
0
votes
1answer
55 views

permissions problem with creating a new text file from the python interpreter in ArcMap? [closed]

I'm attempting to create a .txt file as the output from a larger python script I'm running within ArcMap. The code I'm having trouble goes like this: x = open('adfd.txt', 'w'), and my error message ...
0
votes
0answers
8 views

Map export templates locale

I have created a map export template, where labels and scalebar labels are shown fine when the map export service is published on gis servers where the windows language is english. However, when ...
0
votes
0answers
35 views

Offset and scale of netCDF rasters using Python and ArcGIS

I'm using the arcpy.MakeNetCDFRasterLayer_md command in Python to convert a netCDF archive into multiple rasters, one for each date. Below is a minimum working example of my code, that I've written ...
1
vote
1answer
79 views

Python for ArcGIS: Code refuses to accept a defined variable as input

I'm learning to use arcpy, and I am starting to try and script some geoprocessing tools. While trying to use arcpy.Select_analysis, I found that the code does not accept a defined variable as input. ...
0
votes
1answer
40 views

arcpy.Intersect_analysis using Geometry object as input

Is there a way to run arcpy.Intersect_analysis using an arcpy.Geometry object as one of the input datasets? I've tried different variations of the following, but I can't seem to get it to work. with ...
0
votes
3answers
82 views

Searching for changes of 2 layers based on geometry, Arcgis for desktop (ArcEditor

I´m trying to make a tool that would be able to compare 2 layers of any type (polygon, point, polyline) and find differences between them. Lets say i have a layer of roads (Polyline) from 2005 (layer ...
0
votes
1answer
39 views

Accessing one feature at time to do netwoprk analysis from ArcPy?

I am a bit stuck with my code right now. I have a two feature classes, one for schools, one for residential buildings. So far I have built a model with the modelbuilder, whichs works perfectly as well ...
0
votes
1answer
20 views

Changing coordinate system in which WMS is served using ArcPy?

I am trying to change the coordinate system of a WMS. what i have tried is: prjFile = lokaal + "opmeting_straatkolk.prj" sr = arcpy.SpatialReference(prjFile) mxd2 = ...
3
votes
1answer
186 views

“ ”.join(list) not inserting spaces when calculating field

I have a Python script where I'm trying to take the values from three fields (street address data - direction, street name, street type) and combine them into one field, e.g. S, Main, St should be S ...
0
votes
1answer
38 views

Monitor open sde connection

How can I monitor the open ArcSDE database connections without sdemon? I need to see at any time how many sessions are consumed from my app and if they are related to ArcGIS. I use Oracle 10.2.
0
votes
1answer
45 views

python addin manager validation of code

I have a toolbar (in ArcGIS) set up with two buttons using python addin manager, can someone help me make sure this works, when I run these buttons nothing happens. import arcpy import pythonaddins ...
1
vote
0answers
43 views

Arcpy cannot find shapefile attribute [closed]

I want arcpy to perform the following: load a shapefile, prepare to edit it, open its attribute table, perform a numpy.digitize using the values of a certain attribute and some bins provided ...
0
votes
4answers
86 views

Count Points on Points using arcpy

I have a point feature class which contains features scattered around the city, with some of the points intersecting other points. These intersecting features are correctly different features (they ...
0
votes
0answers
33 views

Mosaic Rasters Arcpy

I am trying to mosaic numerous rasters with the following code: import arcpy import os arcpy.env.workspace='H:\Sheyenne\Normalized_Indices\Fuzzy_Overlay' List1=arcpy.ListRasters('*.tif') ...
1
vote
2answers
80 views

Arcpy Calculate Geometry (coordinates)?

Does anyone know if it is possible to Calculate Geometry with Arcpy? I need to replicate the command > Right click field and Calculate Geometry except with Arcpy as I need to integrate this into my ...
3
votes
1answer
57 views

How can I overwrite files in a geodatabase (outside the workspace environment)?

I initially set the workspace environment to a directory and included the option, arcpy.env.overwriteOutput=True, but at some point in my script, I convert a shapefile in that directory to a ...
3
votes
0answers
52 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:
0
votes
1answer
49 views

Arcpy 10.3 add ins [closed]

I am working with arcpy 10.3 and i want to build a add-in. Unfortunately it's not working when i add a button like: import arcpy import pythonaddins class ButtonClass1(object): """Implementation ...
0
votes
2answers
87 views

SetNull() failing with input raster in ArcPy?

In ArcGIS 10.3, I am trying to use SetNull to identify streams in a raster based on an existing flow accumulation raster. The process involves setting all raster cells with flow accumulation value of ...
1
vote
1answer
36 views

How to access script (source) of custom tool stored in tbx?

I have few custom toolboxes, with script tools. I can access individual toolbar by: ToolBar=arcpy.ImportToolbox(toolbar_path) I can access each tool by iterating through ToolBar.__all__ I’d like ...
3
votes
2answers
76 views

Table does not contain OIDs arcpy Error 000339

I have a script I'm working on that takes a SQL table view and performs a Table to Table (arcpy.TableToTable_conversion) If I leave out the Where Clause the Table to Table works flawlessly, however ...
0
votes
1answer
86 views

Having arcpy.da.SearchCursor access only selected row in attribute table?

In ArcMap 10.2, I'm attempting to build a tool that, when run, will iterate through a network of pipes to locate an outfall point. My network is composed of polyline data representing pipe, with input ...