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

learn more… | top users | synonyms (7)

1
vote
1answer
89 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
88 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
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
1answer
66 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
85 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 to ...
0
votes
3answers
79 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
32 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
80 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
49 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
36 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
57 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
40 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
54 views

Using date field and today's date with arcpy.SelectLayerByAttribute_management()? [on hold]

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
65 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
32 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
40 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
81 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
47 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
59 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
34 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
69 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
36 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
49 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
87 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
40 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 = arcpy.mapping.MapDocument("CURRENT"...
3
votes
1answer
189 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
42 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
48 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
91 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
36 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') arcpy.env....
1
vote
2answers
96 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
67 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
52 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
105 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
38 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
121 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
102 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 ...
2
votes
1answer
59 views

Updating MXDs with arcpy

I am trying to loop through a bunch of mxds in a folder and make some changes, in this case in particular I am trying to replace a text string. This should change all instances of "9/26/2014" with the ...
1
vote
1answer
66 views

In_memory workspace in geoprocessing services

I have a arcpy python script that runs a process that I publish as a geoprocessing service on ArcGIS Server 10.3.1. The python script uses various input feature classes. These feature classes are ...
1
vote
1answer
57 views

Calculate Field not saving on joined layer

I'm joining a table to a layer file, calculating a field in the layer and then removing the join. The code below runs with no errors, but when I check the field in the attribute table, nothing has ...
3
votes
2answers
131 views

Calculate Field - getting the code value but not the description

If STREETNM value are blank or _ then I want to replace them with the value of ST_DESIG. My code below returned the code value of ST_DESIG but not the description. How can I get the description ...