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

learn more… | top users | synonyms (1)

0
votes
1answer
57 views

Hiding selected features in ArcGIS for Desktop using ArcPy or ModelBuilder?

I'm using data driven pages to create a series of maps of point features. Some of my features overlap spatially and I only want to show some of them on each map. Once I select the features which I ...
1
vote
1answer
82 views

Using Alter Field tool of ArcGIS for Desktop on shapefile?

According the ArcGIS 10.2.2 help this should work: inZoneData = sys.argv[1] # This is a shapefile fieldList = arcpy.ListFields(inZoneData) for field in fieldList: if field.name.upper() ...
3
votes
3answers
142 views

Using da.SearchCursor to get count of unique values in a field

Is it possible to use arcpy.da.SearchCursor() to get a count of unique features in a field without a dictionary? So, by this I mean if I have a field called TEXT which contains 10,000 rows populated ...
3
votes
2answers
104 views

Calculate Field Syntax: If statement over many fields

Apologies if this has already being asked but I couldn't find a page pointing to this problem. I'm struggling with the python syntax in the Calculate Field so that, in the table above: if b, c, d, ...
4
votes
1answer
117 views

How to SUM field and then insert into NULL column?

I am only in the beginning stages of learning Python. I have a column, 'QUANTITY_SOLID', that I want to take the sum of all of its rows. I understand I can do this with 'SUMMARY_STATISTICS', but i'm ...
2
votes
1answer
548 views

64 bit Python on ArcGIS 10.2.2 for Desktop

I am trying to have Python 64-bit with ArcGIS so that I can use my entire RAM when doing data analysis. Apparently ArcGIS 10.2 Desktop comes just with 'Python 32-bit'. Should I install a fresh Python ...
2
votes
2answers
59 views

Avoid adding new generated intermediate layers into ArcMap during Python script running?

I am running my script to do geoprocessing in the python window of ArcMap. Since the geoprocessing includes lots of intermediate files, and these files were added in ArcMap at the same time of the ...
1
vote
2answers
120 views

UpdateCursor only takes last value of SearchCursor

I have this piece of code: #written on python 2.7 for ArcGIS Desktop 10.2.2 import arcpy #set to folder where features are located arcpy.env.workspace = "c:\\Users\\python_ex" #on windows use \\ ...
3
votes
1answer
59 views

Build Network Dataset with python comtypes

I know this isn't possible in arcpy, so I thought I'd give it a stab using comtypes. I am trying to translate some of the VB.NET code to create a network dataset from the help docs: ...
1
vote
1answer
84 views

AttributeError: 'unicode' object has no attribute 'save'

I'm trying to multiply my raster to 100 from my ListRasters. I've adapted the code (especially the for loop portion) also from this site. Now, I'm encountering an error at the last line, when saving ...
1
vote
1answer
37 views

Add multiple fields to attribute table by python, with a prompt window for parameters

I know how to add field to arcmap shapefile using Python: import arcpy arcpy.env.workspace = "H:\pythonexercise\NZL_rds\NZL_roads.shp" arcpy.AddField_management("NZL_roads", "LENGTH", ...
2
votes
1answer
74 views

Removing last point in polygon geometry using ArcPy?

This polygon was created from a grid of 500 x 500 meters, then Union, Generalize and Dissolve was used to arrive at this geometry, the laspoint not help me, I just want to have points on each vertex. ...
3
votes
1answer
72 views

Copy multiple features in feature class, update field value based on number copied

I have created a field which will indicate the records I want to alter. What I want to do is then cycle through these records, each will contain sum values in a field.Based on the sum I want to copy ...
4
votes
2answers
81 views

How to get arcpy.da.walk to continue walk after encountering corrupt/problem file?

I am relatively new to python. I am trying to iterate through all DWG polylines in a directory with multiple (hundreds) of subdirectories. I would like the code to skip any DWG files that it cannot do ...
2
votes
2answers
49 views

Reclassify a rasterList and sum the reclassified value from each Pixel

I'm trying to write a script in arcpy which reclassified a List of Rasters. This rasters are made by another tool before so there is already a loop. Actually I get the error 000582 and before this ...
0
votes
0answers
55 views

arcpy.Clip_analysis() Automatically Affixing .shp.shp to Target Feature Class Name?

I created a Python script that was previously working fine, but is now giving me an error when I try to use the arcpy.Clip_analysis() function in arcmaps 10.2.1. I am not adding a filetype extnsion ...
-3
votes
1answer
44 views

Why do I get a NameError: name 'gdbSuccessCount' is not defined?

I'm using a 412-line script that gathers and merges online tile data. However, I'm receiving a Traceback error, NameError: name 'gdbSuccessCount' is not defined. I've included the portions of the ...
1
vote
1answer
63 views

Buffering a PointGeometry in arcpy only returns a line?

I am trying to buffer a PointGeometry object in arcpy to a Polygon geometry object with ArcGis 10.2. The PointGeometry object is in lat/lon WGS84 coordinates and as far as I understand, I can only ...
0
votes
1answer
46 views

Is it possible to import arcpy module to PyPy interpreter?

I'm trying to use PyPy for my code because of speed. But my code needs arcpy module to run and I cant find out how to install or import this module to arcpy. I'm using PyPy 2.3, Python 2.7 and Win 7. ...
1
vote
1answer
51 views

What is the file structure of an ArcGIS Place File?

Does anybody know format of .dat file to help with bookmark automation?
2
votes
3answers
108 views

Points from python directly to ArcMap

I have a python code that is generating coordinates one by one. Is there a way to display them directly in ArcMap as they are generated? I am aware of the insert cursor but the lock on the table ...
1
vote
1answer
69 views

Subquery in SearchCursor with ArcPy?

I'm searching for the value from the field "demA_demA" which has the lowest elevation by having the value 8 from the field "outTable_2". How can I do this in the following script. import arcpy ...
0
votes
1answer
41 views

python code to create an intersection loop with a geodatabase [closed]

I am trying create a loop that will intersect each individual township with a statewide section layer. I am having trouble with the syntax of the intersect tool I think, but maybe it is something ...
2
votes
2answers
103 views

Adding ECW file to MXD with ArcPy?

I'm using Desktop 10.2 and I tried ,with this script, to add ecw file to mxd's but the result is a black & white raster(stretched symbology) instead of colored raster(RGB composite symbology) : ...
1
vote
1answer
47 views

How to create a model which executes a SQL stored procedure with user-provided parameters?

How can I create an ArcToolbox that executes a SQL stored procedure and asks the user for two inputs? As it stands now, I have to log in to my SQL server and run an execute statement for the stored ...
2
votes
0answers
64 views

ArcPy Add Graph Window

The arcpy MakeGraph_management tool suggests that a graph is stored via an in_memory representation that can be either: added to the host app or saved using SaveGraph_management. The graph appears ...
1
vote
1answer
57 views

Replacing text string on layout text element by reading lookup value from table via SearchCursor?

I'm not sure what the best way is to go about this, but here's my situation: In short, I exported a domain to a table (and I exported the table as a CSV, too, just in case it might be easier to work ...
0
votes
1answer
60 views

Using insert and search cursors on same feature class to clone row?

I'm using the code below in order to attempt to clone a row in a feature class and add that same row to the same feature class after updating its metadata (Name, date_start, date_end, etc.) The ...
0
votes
1answer
32 views

Rank cell values across multiple grids

I have multiple grids, one for each month of a year. I would like to create a new grid for each month/year combination that the cell value is the percentile rank of that cells value in the grid stack. ...
0
votes
0answers
24 views

Multiple Z point data kriging interpolation? [duplicate]

I asked this question yesterday and is on hold because I was not specific in my question. I have added my trail code for the question. The question is kriging interpolation of many z. To be more ...
2
votes
1answer
91 views

Merge feature classes in feature datasets

I'm trying to merge a group of like feature classes which are contained within separate feature datasets. I can merge feature classes within a file geodatabase without having issues by creating a list ...
0
votes
0answers
17 views

procedurally alter dimensions of embedded Picture_Element

Theoretically, should it be possible using arcpy to alter Picture Element dimensions whose images are embedded? My attempts haven't worked. I thought to clone these as a possible workaround but those ...
1
vote
2answers
110 views

Exporting lists of Feature classes and fields from SDE

I'm using matt wilkies' arcplus module http://gis.stackexchange.com/a/5943/16793 to export a list of feature classes within an SDE database to a text file. I've also written a tool to write field ...
2
votes
1answer
43 views

Batch create maps using arcpy.mapping

I'm trying to create .mxd and PDF outputs for a series of feature classes in an SDE. I'll need to match 2 feature classes (one original, one buffered) in the SDE based on similar file names. The ...
0
votes
0answers
58 views

kriging interpolation of many z

I have similar questions with Iterating through z-values in ModelBuilder. I want to interpolate my z's with my specific interpolation extent raster and extract each value to specific grid points (I ...
3
votes
2answers
276 views

Python script to export .csv tables from GDB

I am very new to Python programming and have been tasked with writing a program to export a csv file from a file geodatabase feature class. The csv should contain only certain fields and the records ...
2
votes
1answer
79 views

How to get the two nearest points between two polygons

I'm trying to draw the nearest line between the nearest polygons in a Polygon dataset (ESRI Shapefile). I know that for this purpose there is the Near Tool (ArcGIS), but it just return the point TO ...
1
vote
1answer
63 views

one-to-many join using arcpy

I have a feature class that contains polygon features with a unique ID column. This shape-file is to be joined with a csv table that I've exported to a file geodatabase table. The unique identifier in ...
3
votes
1answer
52 views

Which parameter data type is used in the Integrate geoprocessing tool for ranking?

I'm trying to figure out which parameter data type is used in, for example, the Integrate geoprocessing tool. It looks like this: I'd like to use it in a geoprocessing tool I'm making, but can't ...
3
votes
1answer
52 views

Does Avenue equivalent of pointPosition exist in ArcGIS 10.2?

There were a couple of awesome methods in Avenue for ArcView: point=polyline.Along(percentage) percentage=polyLine.pointPosition(point) Don't laugh, but one of the reasons I updated to 10 from 9, ...
0
votes
1answer
47 views

Editing KML breaks icons

Edit: Solved it. When I was creating my new zip/kmz my code was creating various folders within the zip/kmz. Changed: NewZip.write(addedfile) to: NewZip.write(addedfile, newfl) /Edit I have KMZs ...
1
vote
1answer
48 views

Geoprocessing service failure

I have a python script tool that I have published to a geoprocessing service. Every time I run the service it fails. Here's what I'm getting for errors: The python code in the tool is below: ...
6
votes
4answers
696 views

How to optimise and speed up Python code? [closed]

Again my lines of surface runoff... I made a script, solving the issue when lines cross other lines. Something like generalization. Like on the picture below. The problem is that I have to solve 30 ...
1
vote
1answer
39 views

Con() does not recognize raster values

I have a problem when using the con() argument. What I want to do is to remap all raster of a raster file ("Red_SL") cells with values larger than 40 to the new value 5. All other values should be ...
2
votes
1answer
112 views

How to start an ArcMap editing session without displaying the Editor toolbar

I'm developing a toolbar with some geoprocessing routines and digitizing functionality. On this toolbar I have implemented a "start edit" button. I want to start an edit session by clicking that ...
1
vote
2answers
69 views

Unable to load shapefile as feature class into geodatabase file, with only 3 of the fields

I'm trying to automate importing census boundary shapefiles to feature class in a Geodatabase File, but somehow could not get it to work with this code: ### ======================== load boundary ...
0
votes
2answers
41 views

Check layer data type in gdb

I have path to layer or feature C:\base.gdb\test How to check is table or feature class by arcpy?
1
vote
1answer
49 views

Iso Cluster tool in script failing to open clip raster

I have been coding in Python for only a few months, so maybe I'm just overlooking a minor detail as a newbie. I have written the script below for a class project. It is supposed to clip two rasters, ...
12
votes
2answers
337 views

How is the data access cursor performance so enhanced compared to previous versions?

The data access module was introduced with ArcGIS version 10.1. ESRI describes the data access module as follows (source): The data access module, arcpy.da, is a Python module for working with ...
1
vote
2answers
68 views

How to use the 'if' function to set field value based on various other field values

I am trying to populate a field with a value from another field in the same row, the condition I have set for this to take place is if a third field is equal to 0. In order to achieve this I have ...