How to zoom to layer with page definition query set in arcpy?
I have data driven pages enabled on a mxd, with a page definition query set on one of the layers to only show features that match the current index feature. This layer looks like this: After enabling...
View ArticleLabels placement in ArcGIS
I need all labels to be placed outside of the boundary (polyline features). Most of the labels are placed outside the boundary line, while others (marked with red color) are placed inside the boundary....
View Articleformatting SQL expressions in arcpy
I’m trying to use SelectLayerByAttribute to find the last point added to a FC. I figured I could use the objectid field because it’s serial. I wrote the following:...
View ArticleArcGIS 10.2 Copy Rows error
I’m very confused by this one. I have run a polygon neighbors analysis in ArcGIS 10.2 and appended some data from another table to help me whittle down the neighbors list before my next action. So I...
View ArticleHow to set up parameters in Python toolbox tools?
I build a model builder and export it to python. How can I define parameters for python script in python properties? May you explain about Data type in script proprties? thanks alot
View ArticleTrouble using saveACopy with group layers [on hold]
This code works fine on layers in the TOC that are not group layers, but errrors out if there are any group layers in the TOC. import arcpy, re, os arcpy.env.overwriteOutput = True #loop through layers...
View ArticlePython Field Calc for Document Hyperlink
I am trying to create a script that will hyperlink to a .tiff or .pdf. These files are stored in one folder on a shared server. I want the script to look in a field: ‘PLAT_IMAGE’, which has the plat...
View ArticleDraw middle ordinate perpendicular to chord, out to curve, with arcpy
I’ve been assigned to find the radius of road curves. My boss found this article describing a pretty straightforward method of doing so: find the start/end points of the curve; create a chord; create...
View ArticleHow can I generalize “field name” variable?
Here is my code: import arcpy import math arcpy.env.workspace = "C:RGKings CountyTest.gdb" fcs = arcpy.ListFeatureClasses("NVF_*") try: for fc in fcs: rows = arcpy.UpdateCursor(fc) for row in rows: if...
View ArticleArcGIS 10.2 Geoprocessing Service based on Python Fails with IOError: “SDE”...
I have a Python Script that inserts X,Y Point in the SDE Point Feature Class. It works fine when executed in ArcMap 10.2, but it fails with IOError when published as Geoprocessing Task service in...
View Articlebuilding a progress dialog with pythonaddins in ArcMap
As a component of my add-in, I compute a bunch of summary statistics when the user clicks a button. This can take a while to process and it can appear as though the program has stopped responding. I...
View ArticleWhy does ArcPy Excel To Table give AttributeError: 'module' object has no...
I’m trying to import an excel workbook using arcpy. ExcelToTable, but I get the following traceback: ERROR updateParameters Execution Error: Runtime error Traceback (most recent call last): File...
View ArticleReplacing double quotes in filename using
I am working with data in an SDE, when I create a new feature class within the SDE I get a file name which contains my user name in double quotes. I do not have administrative permissions to the SDE...
View ArticleMoving Esri grid format and info folder inside working directory?
Using the below code, I want to extract a new raster from an original raster using value field and I want to automate the process for 70 more rasters. However, for testing purpose, I’m using only 3...
View ArticleSubquery 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 import...
View ArticleHow would I group values in a field based on range of number using python,...
An example of what I’m trying to accomplish is described below, however they don’t describe how to use the data update cursor to update the attribute column. data – Group values based on range of...
View ArticleCreate polylines from point array Python
I am working on building polylines from an array of points I have created from a csv file and am completely lost in building the lines. My code works as follows: I have the point array working, I need...
View ArticleAdd multiple fields to attribute table by python, with a prompt window for...
I know how to add field to arcmap shapefile using Python: import arcpy arcpy.env.workspace = "H:pythonexerciseNZL_rdsNZL_roads.shp" arcpy.AddField_management("NZL_roads", "LENGTH", "TEXT","","","50")...
View Articlesum count column in raster attribute
I am a beginner to python coding in GIS. I want to calculate the total number of counts in raster attribute table. In order to do that: I would like to build a attribute table of raster data use a loop...
View ArticleCreateObject cannot open map document error when cycling through list of MXDs
I have a stand alone Python script that aims to make a list of data sources from a series of folders/sub-folders full of MXDs. However I am continually getting the: CreateObject cannot open map...
View Article