A site-package created by Esri to expose ArcObjects to Python.

learn more… | top users | synonyms (1)

1
vote
1answer
241 views

Using unicode characters (arabic) in Select By Attribute of ArcGIS for Desktop?

I'm new to Python scripting with ArcGIS for Desktop and I have unicode characters (arabic) in my attribute table. I want to use these characters in my script but when I try to do that the script ...
1
vote
1answer
75 views

Arcpy MosaicToNewRaster problem

I can't seem to get the mosaic created for this. import arcpy arcpy.env.workspace = r"C:\projectTemp\FloodAnalysis\output\2yr\raster" arcpy.env.overwriteOutput = True srName = ...
1
vote
2answers
1k views

Import Arcpy using PythonWin

I tried to install pythonwin26-212 from ArcGIS10.0 Desktop CD. pythonwin26-212 stops working as soon as I press "Enter" in the interactive window. (ps. I downloaded pythonwin26-212 from sourceforge ...
1
vote
1answer
317 views

What is correct Where Clause when using variable and Select By Attribute tool within loop?

I have seen several similar posts related to this technique but I am still having issues. The following script is intended to select all points from one shapefile that are within the boundaries of a ...
1
vote
2answers
184 views

Copy rasters slow, increases file size

I have a folder with ~1200 aerial photos in both jp2 and tif format, of which I need about 380. I wrote a python script to get the names of the files I need, which works fine. But when the script ...
1
vote
2answers
100 views

Adding/updating field to polygon feature class that lists bordering (neighbor) polygons?

I have a dataset of zipcodes. I want to add a new field "NEIGHBORS" that includes bordering polygons in a comma delimited manner such as attached image:
1
vote
1answer
239 views

How to reset ObjectID after running Delete_Features on SDE feature table?

I have a python script that deletes all features on a SDE feature table and then inserts new features to it. I noted that the ObjectID keeps incrementing from where the last feature was with before ...
1
vote
1answer
248 views

“dataset does not exist or is not supported” using large GRID raster

I am trying my hand at arcpy for the first time to create a conditional raster from a set of threshold values. I have 3 large GRID format rasters (mos_zb3, mos_zb4, pca_finb2) I am trying to feed into ...
1
vote
2answers
738 views

Field Filter and Value Pick List for an Arcpy Toolbox ValueTable Parameter

In an ArcGIS Python Toolbox (pyt file), how do I specify a filter for a Value Table parameter? In my value table I have two columns. The first is a a field name derived from a selected table view and ...
1
vote
3answers
785 views

ArcGIS Copy Features tool extremely slow when exporting to ArcSDE?

I have about 10 points in a file gdb that I am attempting to copy over to an sde feature set. In arcpy and in model builder it takes about a minute to execute. Do you know of any tips to speed this ...
1
vote
3answers
533 views

Is the FME Extension for ArcGIS required in order to use arcpy scripts in FME?

Is the FME Extension for ArcGIS required in order to use arcpy scripts in FME? I dont think it is but when i run a simple startup/shutdown script in FME I am getting these error messages. This ...
1
vote
1answer
169 views

pulling an excel sheet with =rand(between) in a Python while loop, and exporting results as .dbf

To preface my question: I am very new to stack overflow, and relatively new to Python. I am working on setting up a sensitivity analysis. I am working with 40 parameters that range from 0.1 - 1. My ...
1
vote
1answer
242 views

Stuck updating one field based on the condition of another using Acrpy or Field Calculator

I have a shapefile with 5,000 city points. I need to populate a new field, "cls_pop", based on each cities population, so that cities with a population > 2,000,000 will have "cls_pop" = 1, cites with ...
1
vote
1answer
227 views

Batch Aggregate Raster using Python

Trying to write a python script to batch Aggregate a bunch of different rasters. get a Parsing Error Syntax error for line 11. # Batch Aggregate raster tool import arcpy from arcpy import env from ...
1
vote
1answer
73 views

How to update attributes of a shapefile using list values?

I am using an update cursor to update the attributes of a shapefile using values from a list. It seems very easy, but I couldn't make it run correctly. When I run the following code, it updates all ...
1
vote
1answer
102 views

Setting More Than One Workspace

I have a number of tables that contain known values in a field. For example, I have a soil type table with one field in it. That field contains a list of known soil types. I have another table that ...
1
vote
5answers
2k views

Arcpy to copy a layer in the ArcMap TOC, rename the copy, and paste back to TOC?

I want to make a copy of a layer in the ArcMap TOC (passed to my script as a Feature Layer), assign the copy a new name, set a definition query on it, and then add the copied Feature Layer back into ...
1
vote
1answer
189 views

How to add layer in Arcscene using script tool

import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd, "*")[0] addLayer = arcpy.mapping.Layer(r"F:\project\Final\Ground floor\steps.lyr") ...
1
vote
2answers
1k views

How to Add Shapefile with Symbology from Layer File to ArcMap MXD using ArcPy/Python?

Say I have a Shapefile: C:\DATA\points.shp A layer file: C:\SYMBOLOGY\symbology.lyr And a map document: C:\MAPS\map.mxd How can I add points.shp to map.mxd with the properties of symbology.lyr ...
1
vote
2answers
1k views

What might cause invalid syntax from ArcPy with Raster Calculator and Multiple Rasters?

I am having trouble for writing script in Python (ArcGIS 10.1). The task is generally divide each raster by 100. I have many of these raster files.... So what I've done is the following: from ...
1
vote
1answer
208 views

Arcpy Update Cursor error [duplicate]

I'm trying to take a field calculator equation and do it in arcpy directly through IDLE, but am running into a problem where the process runs correctly, but the results in the field show up as 0. I've ...
1
vote
1answer
236 views

Database Connections folder is empty when viewed with ArcGIS tool

I'm trying to create an ArcGIS tool which accepts an SDE connection file as an input. I made a new interface with an input parameter and set the type to Database Connections. When I open the tool and ...
1
vote
3answers
706 views

How to create a spatial reference file

I am using python, arctoolbox and arcpy 10.0 I am running a script that is tied to an arctoolbox. The toolbox serves to enter in my parameters. I have a feature layer as an input. The feature layer ...
1
vote
2answers
644 views

How do results from a Python script get added to an ArcGIS map? [duplicate]

I have a Python script for ArcGIS that makes a new feature class. I can add this to ArcGIS as a new Script (without parameters), however the resulting feature class is not automatically added to the ...
1
vote
1answer
557 views

Why does arcpy append from file geodatabase to SDE fail?

I'm trying to append a feature class from a file geodatabase to an Arcsde featureclass using this line of code: arcpy.Append_management("parcel_copy", sde_path+"parcel" ,"NO_TEST") This line works ...
1
vote
2answers
86 views

Automating attribute completion of new polygons

Good Afternoon I am currently outlining property boundaries and then copying and pasting in the necessary attributes on a daily basis. I would like to speed up this process and remove the chance of ...
1
vote
1answer
822 views

Modify dataframe extent using data driven pages and arcpy.mapping

I'm customizing an automated mapping method using arcpy.mapping and data driven pages. Essentially I have a script that loops through each page, and modifies the location of the inset map, legend, ...
1
vote
2answers
532 views

UTM coordinate conversion to Geographic coordinates

I have about 500 separate files containing GPS points in UTM coordinates from multiple zones. I am looking for a simple and fast python or Php script that i can use to carry out a batch conversion ...
1
vote
1answer
782 views

arcpy: creating polyline features from the following text file format

I am looking into a way of reading the following file format with python, where 0 0, 0 1, 0 2, ect... is the polyline object number and 0(1) 464736.1645 260940. 098377 are x, y coordinates of ...
1
vote
1answer
232 views

ArcPy: Creating weekly-sum layers by summing field values from seven consecutive daily .dbf's

So I have 490 consecutive daily rainfall shapefiles/.dbf files in a single directory. Each consists of a uniform even-spaced grid of 220 points having uniform pointIDs, number of records, field names ...
1
vote
1answer
246 views

Small issue with field calculator

What am I doing wrong in this field calculator logic? Pre-logic def re_score(elev_t,f2, contour): f2=contour if elev_t.endswith('.5'): f2 = "Midi" return f2 Expression for field "Contourtyp" ...
1
vote
1answer
1k views

How do I get statistics out of a table using Python in Arc 10?

I am very new to programming (I started learning this semester) and would very much appreciate helop with one piece of a project. I have the following table, and I need to write a script compatible ...
1
vote
2answers
1k views

Python script has execution error first time through on a JoinField, but not the second time

I have some Python code that takes a shapefile, creates its centroids via FeatureToPoint, joins an auxillary field from the shapefile to the centroid via JoinField, and then goes on to do some more ...
1
vote
2answers
550 views

Adding result of geoprocessing service — consume in ArcMap desktop

I am new to ArcGIS Server. I have a Python script tool that I've published as a geoprocessing service. The script takes a point feature class, writes a subset of the input FC as a new FC in the ...
1
vote
1answer
3k views

Using the arcpy.UpdateCursor to delete rows doesn't delete based on counter

I am trying to delete rows from a shapefile using arcpy.UpdateCursor. The first thing I did was get a unique list of values from the key field "PolyGUID", then I iterate that list doing a ...
1
vote
1answer
659 views

help writing a python script

Hi I need help with writing a script: The task I have a point feature class of graffiti incidents and a polygon feature class of patrol zones with some empty attributes already created for you. I ...
1
vote
2answers
660 views

arcpy.sa.Viewshed with OFFSETA

This is using ArcGIS10 arcpy with spatial analyst. I need to call Viewshed, but with an observer height set. I have tried using a Z-aware point feature set, but that only throws an error. I am ...
1
vote
1answer
424 views

Issues with defining projection to that of the current root file

I am creating a shp file with the extent of all the raster file in a set of directories and it works fine when all the rasters are in the same projection but not when they switch around. So I want to ...
1
vote
2answers
740 views

What changes will be made to arcpy in ArcGIS 10.1? [closed]

I heard that two big changes to arcpy will be add-ins and new, faster cursors. Also, new features include "the ability to administer your enterprsie geodatabase (ArcSDE) using Python scripting" and ...
1
vote
1answer
31 views

Automation of changing symbology for a given layer

I have a shape file that is a 10-by-10 grid of squares. The shape file has 50 attribute columns (named p_1 through p_50) where each column has 100 entries (corresponding to the 100 grid squares) and ...
1
vote
1answer
42 views

Problem with tool validation script in ArcGIS?

I have tried to write some validation code for a script in ArcGIS. This validation code more or less repeats what the script itself does, which is a simple cutting up of a long string by using the ...
1
vote
1answer
16 views

Can Arcpy Reconcile Initiate the Interactive Conflict Review?

I'm pretty new to python but trying to hide a lot of the nitty-gritty of creating a grandfathered version and reconciling from my users. I've gotten pretty far, but can't figure out a way for a ...
1
vote
2answers
63 views

Setting field equal to raster Name ID for batch process in ArcPy

I am wanting to set an existing field called RasterID to the name of the raster for which the attribute table belongs to, but for a batch of rasters. Is there a way to do this with my current code ...
1
vote
1answer
64 views

Error: 'NoneType' object is not iterable (arcpy.ListRasters)

I am trying to extract a raster through a particular shapefile. import arcpy from arcpy import env from arcpy.sa import * arcpy.CheckOutExtension("Spatial") env.overwriteOutput = True ...
1
vote
1answer
38 views

How to define NoData values in the ArcPy Clip raster tool?

I'm clipping some rasters with the ArcPy Clip tool (from the raster toolset) and a polygon feature and I'm having some problems with nodata values. The script I'm using is based on the code from ...
1
vote
2answers
94 views

arcpy.mapping.ListLayers() without calling current mxd document

my question is how can I use the arcpy.mapping.ListLayers() function without calling the current mxd? I'm hoping to run the python script without having an ArcMap document open. My setsymbology code ...
1
vote
1answer
33 views

How can I show a label for a certain field in an attribute table for a shapefile?

names = ["Schools"] layers = arcpy.mapping.ListLayers(mxd, "*", df) for layer in layers: if layer.name == "Schools": layer.showLabels = True My code labels the default field in the attributes ...
1
vote
1answer
26 views

Geoprocessing service fails if output paramter is empty

I have made a network isolation model that lets the user pick a point on the network to simulate a pipe 'failure'/section that needs to be isolated and finds all valves that need to be turned and ...
1
vote
1answer
70 views

errors after installing 64 bit background geoprocessing on ArcGIS desktop 10.2.2

I installed 64 bit background geoprocessing on my ArcGIS 10.2.2 and then changed my pythonpath to "C:\Python27\ArcGISx6410.2" so that my code can benefit from the 64bit. then I had to install a 64b ...
1
vote
1answer
39 views

Iterate Through Folders within Folders

I am having some trouble creating a model that will iterate through folders and subfolders. I want to be able to have the top level folder as a parameter and then have the code go through each of the ...