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

learn more… | top users | synonyms (8)

0
votes
4answers
47 views

Copying feature from one feature class to another without creating new feature class?

i need to copy a line feature from a line feature class to another existing feature class without creating a new feature class. As copy feature tool creates the copies feature in a new feature class ...
0
votes
2answers
26 views

Choosing data type to use for input as feature class or shapefile in Python script tool using ArcPy?

I am writing a Python script tool within a toolbox with *.tbx extension. I need to make the input parameter flexible (feature class or shape file) , so which data type I should select for this ...
0
votes
1answer
23 views

Toggle Graphic Element inside ArcMap's Layout View using Arcpy

I am trying to toggle unwanted graphic elements inside of ArcMap's layout view before exporting them as a pdf. I have no problem reading the correct graphic element or relocating it to another ...
2
votes
1answer
313 views

Unsupervised raster classification using GDAL

Is there an equivalent in GDAL to the Arcpy ISO data unsupervised classification tool, or a series of methods using GDAL/python that can accomplish this?
1
vote
0answers
19 views

Why .getOutput(0) is needed after GetCount_management? [duplicate]

parcelCount = int(arcpy.GetCount_management("Parcels_lyr").getOutput(0)) print parcelCount while parcelCount < 200: arcpy.SelectLayerByLocation_management("Parcels_lyr","WITHIN_A_DISTANCE",\ ...
9
votes
2answers
4k views

Casting ArcPy result as integer instead arcpy.GetCount_management()?

I am trying to get a number by counting how many points are in a shapefile. And this works (I think), except I then am running into trouble using that number somewhere else. Eventually, I'll be using ...
1
vote
0answers
53 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='...
3
votes
1answer
187 views

Export Stretch Function values - Arcpy

I'm looking for a way to export Stretch Function values from images that’s stored in a Mosaic dataset. Not values from the whole set, but specific stretch functions per image. The set is stored in ...
1
vote
1answer
32 views

Appending Feature Class from Geodatbase to another using ArcPy?

I'm trying to write a python script to load feature class from an existing geodatabase to a new one, here is my script: import arcpy from arcpy import env import os import traceback #Set up ...
3
votes
1answer
36 views

Select Features within a distance and direction

Is there a way to select features in a layer by location based on their proximity to another feature and the direction? E.G., select all features within 10 meters north of current selection? I am ...
1
vote
1answer
112 views

ExecuteError: ERROR 000358 - Using a variable within arcpy.Select_analysis() [duplicate]

I have looked at Including variable in where clause of arcpy.Select_analysis()? and while it is very similar to the question I'm asking I ran into the same issue after implementing its syntax. I feel ...
1
vote
3answers
25 views

arcpy field mapping for a spatial join: keep only specific columns

I want to perform a spatial join to find the join point (a node in the code below) that is closest to a target point (a consumer in the code below). In the result, I only need certain attributes from ...
0
votes
1answer
50 views

Filtering parameters in ArcPy Python script tool avoid repeating selecting same value in sequence parameters?

I am trying to make a tool in which there are many sequence parameters (based on the same field of a feature class), and each of them is multi value to make a user choose from a check a list one or ...
-1
votes
1answer
24 views

Finding common two vertices for two adjacent polygons and drawing line feature connecting them in ArcGIS for Desktop?

I need to find the common two vertices between two adjacent polygon and draw a line feature connecting these two common vertices: I have tried the following code but it is not working: polygon1 = ...
0
votes
2answers
22 views

Converting all values in attribute table to zero (0) in shapefile using ArcPy?

I'm looking for a python script using ArcPy that can convert all values in a shapefile's attribute table to a value of 0 as I will then populate with other values from another source. I have ...
1
vote
1answer
55 views

Creating multi-value choice list of field values and using selected for select in ArcPy?

I have created a multi-value choice list following this blogpost: https://blogs.esri.com/esri/arcgis/2012/07/16/generating-a-multivalue-choice-list/ I changed the validation code to my needs but now ...
0
votes
0answers
11 views

Creating two multi-choice lists for field value selection in ArcPy?

Related to one of my other questions (Creating multi-value choice list of field values and using selected for select in ArcPy?) I have a follow-up question. I have set up two of these multi-choice ...
0
votes
2answers
69 views

Creating a value-counting table with search- and update cursor

I'm a python beginner. I`m working with ArcGIS 10.2.2 and IDLE Python 2.7.5 I have a shapefile with around 20 fields, each attribute has a value between -3 and 3. This would look like this: I ...
1
vote
2answers
2k views

Overwrite existing map service in ArcGIS Server 10.1 (through ArcPy)

I am using ArcGIS DT and Server 10.1. I want to over write existing map service though ArcPy and going through this link and getting an errorRuntime error Traceback (most recent call last): File "&...
4
votes
4answers
2k views

Converting all values in all fields of table to uppercase using ArcPy & Python?

Does anyone know how to use the .upper() in a stand alone python script so it can be used to change all characters in a table into UPPER case? I don't want to use the field calculator since I have ...
1
vote
1answer
754 views

How to add Table View to Data Frame using ArcPy in ArcMap 10.0?

How does one add a table to the current map in ArcMap 10.0? 10.1 has the function arcpy.mapping.AddTableView, but this function does not exist in earlier versions. Must the table be made into a layer ...
1
vote
1answer
35 views

Problem looping and summing rasters using ArcGIS 10.3 and Python Script

I need a python script that seeks to cycle through a number of viewpoints, deriving an AGL raster in each case (using arcpy.Viewshed_3d) and progressively summing the AGL rasters into a single ...
0
votes
0answers
6 views

how to set a default value for GPFeatureLayer parameter in arcpy

I'd like to provide a default value for a GPFeatureLayer parameter in arcpy. The parameter is created like this: paramPointFeatures = arcpy.Parameter( displayName ='A point layer', name ='...
1
vote
1answer
51 views

Using arcpy.da.SearchCursor() to update text elements?

This is an update from my original post for more specificity. I have grown a lot in the past 48hrs regarding my Python ability. At this point, I can use SearchCursor to update a single Text Element ...
3
votes
2answers
4k views

Exporting mxd to image with transparent background from ArcGIS for Desktop?

I cannot get ArcMap 10.0 or 10.1 to "Export Map" to a png or gif with a transparent background -- no matter what I set the background and transparent colors to. Thus, I created the following script, ...
0
votes
1answer
100 views

How so I solve FDO error: 0? How do I get code that worked in a file geodatabase to work in an SDE version?

I used python add in to make a tool bar in Arcmap that edits features on a map. It works on a file geodatabase, but not on an ArcSDE version one. I've been getting an FDO error: 0. The potential ...
0
votes
0answers
30 views

I can't import arcpy to python in arcgis. What do I do?

I'm running ArcGIS 10.3 on Windows 10. I get an error message when I try to import arcpy. I'll include the error message that I print screened. Should I just un-install ArcGIS and reinstall it? or ...
1
vote
1answer
30 views

ArcGIS Calculate Field, Python Shape Expression

Using ArcGIS 10.1 and Python 2.7- I am trying to write an expression that calculates the mid point of a line. I've tried many different expressions, but I continue to get syntax errors. #An example ...
0
votes
1answer
12 views

Arcpy MakeFeatureLayer_management issue using SQL condition

I have a lines shapefile. I made a small code to select some of its elements and turn them into a standalone layer. The code is like this: arcpy.env.workspace = r"C:\MyDirectory\Mygdb.gdb" network = ...
0
votes
1answer
29 views

Can't get new rows added with Arcpy / InsertCursor

I'm not getting any errors but can't seem to get these rows added. Everything else in the script works fine. I only dabble with Python occasionally so please forgive me for missing anything obvious ...
0
votes
0answers
18 views

Set Script Tool Parameter to Accept Either Input or Output

I've created a script tool that has an optional output parameter of an Excel Workbook. If it's populated, the script will add a new worksheet. However, every time the tool is run, ArcGIS is somehow ...
1
vote
1answer
186 views

Accessing bands in .pix (PCIDSK) file in python/arcpy

I am trying to perform zonal statistics on a single band from a multi-band raster in .pix format. I have things working great with a tiff file. I am able to access the bands using this code: desc = ...
2
votes
2answers
349 views

ArcPy Data Driven Pages AttributeError: PageLayoutObject: Error in executing ExportToPDF

I am trying to export a series of datadriven pages. Executing on a single page fine no issue, executing on a few pages no issue. executing on many pages serious drama. Initially i thought it might be ...
3
votes
2answers
61 views

Calculate visibility with polygonal visual barriers

I have the raster file for my digitial elevation model as well as a polygon shapefile with polygons representing different kinds of environments (forest, field, meadow, etc), and wouldlike to ...
2
votes
3answers
68 views

ArcPy find points that are paired in time and space

I have a shapefile that that is time stamped and tracks two animals. I would like to create a field that denotes "together" based on proximity and location. And example of the data is: time ...
0
votes
1answer
46 views

How to access output parameters from a Python Toolbox Tool called by .NET?

I am trying to access an output parameter from a Python toolbox tool and cannot find any information about how this is done: I am developing an Esri Add-In for ArcGIS 10.1 SP1 for Desktop (Build 3143)...
0
votes
1answer
31 views

Parsing error SyntaxError: EOL while scanning string literal (line 5)

I want to create a number of featureclass using a template featureclass import arcpy from arcpy import env env.workspace = "C:\new_docs\BIO-FILES\GIS_prog\Lesson1" arcpy.CreateFeatures_management('C:...
4
votes
1answer
46 views

Arcpy Copy_management does not copy all records

I need some help with a python script that is copying a shapefile to a new folder location. I am using ArcGIS 10.3. I have a shapefile of imagery tile outlines that contains 17425 polygons. I need to ...
3
votes
1answer
77 views

Get nearest polygons in both sides of a polyline with arcpy

I have polyline shapes representing roads and another shape layer with polygons that are representing buildings. I have to find some way with ArcPy to measure the distance from a point within the ...
1
vote
1answer
21 views

lyr replaceDataSource not reflecting

The changes I made to the MXD with ArcPy is not reflecting the changes in ArcMap. arcpy.env.workspace= "C:\Users\UserID\Desktop" mxdlocation=os.path.join(arcpy.env.workspace,mxdname) mxdloc = ...
5
votes
1answer
3k views

ArcPy replaceDataSource

I'm attempting to replace a datasource in an outline map frame using ArcPy. The rest of the script seems to run OK, but after the script has run the datasource the datasource of that layer shows an ...
2
votes
1answer
177 views

Using ArcPy to fetch Information from a .GDB

I am new to GIS and I would appreciate if you could guide me a little. I have a .gdb folder with data and I need to process that data to find educational institutions which are within say X Km of the ...
2
votes
2answers
533 views

How to get easting & northing of cell in raster using ArcPy?

It might be very simple task. But I would appreciate if someone can comment on How I can get easting and northing of a single cell raster using arcpy as this value is used for in further steps.
3
votes
2answers
50 views

ArcGIS Script Tool RuntimeError: cannot open 'GPL0'

I Cannot find what this error means or what could be causing it? Script worked until I added the lines under "Set map label to containing quad name". My environment is ArcGIS 10.1 SP1, Windows 7. Here ...
4
votes
3answers
4k views

Using arcpy.da.InsertCursor to insert an entire row that is fetched from a search cursor?

This is a simple process using the legacy cursors, but I cannot figure out how to do it with the newer Insert Cursor from the Data Access module. I basically want to take the entire row from a Search ...
1
vote
2answers
51 views

Iterate over multiple shapefiles, changing year from “2014” to “2015” in file name

I have about 50 shapefiles I would like to change each of their file names which contains "2014" to "2015". I would like to use a python script but have not been able to figure out how to do it. I ...
0
votes
0answers
29 views

Updating table from Excel spreadsheet using ArcPy? [on hold]

This is my code import arcpy arcpy.env.workspace = r"D:\Users\ShawnO\Desktop\PythonExercizes\Parcel_Ownership_update_model\Parcels.gdb" # Local variables: Parcel_Owners = "D:\\Users\\ShawnO\\Desktop\...
0
votes
0answers
20 views

ArcGIS 10.3.x Python tool script - Automatically adding multivalue output feature class to display

I am developing a Python tool script in ArcGIS 10.3.x that is meant to be later published as a geoprocessing service. The tool script produces two output feature classes that I would like to ...
0
votes
1answer
38 views

Python new packages installation with ArcGIS interpreter?

I would like to introduce some functions derived from scipyin my code. Since I also need arcpy, I use the Interpreter installed inside ArcGIS, whose directory is: (C:\Python27\ArcGIS10.3\python.exe). ...