Repair symbology with categories
Hi- We are migrating from ArcMap 9.3.1 to 10.1. In the process, we have to repair some issues with broken SDE data sources for our existing map documents. We can do most of that using Python, we are...
View ArticleAdding table to Table of Contents
I am using Arc 10.1. I am trying to add a table to the Table Of Contents using the following script but it doesn't show up without saving to a new map mxd document. I am using the following code: mxd =...
View ArticleGeodatabase Archiving Script
Hi, I am writing a python script, which is a weekly update of a shapefile. (if I was not going to use my geodatabase it is essentially create new shapefile from excel sheet, copy old shapefile renaming...
View ArticleReload Cache
Folks, I have a script that calculates area on a feature class. Does python provide a way to display the updated attribute field? Currently, I have to either close and reopen the attribute table or...
View ArticleChanging layer symbology
I’m trying to change the class break values for a layer that has graduated colors symbology. The layer has three data ranges and the classification method is natural breaks. Here is the code I’m trying...
View ArticleHow to remove first character from every row of an attribute field
Hello all, I am new to Python and, as you can probably guess, I am having issue with some code I'm attempting to write. The following will describe what I am attempting to do, and hopefully you...
View ArticleHow can I check if a string has numbers (0-9) and dashes?
How can I check if a string has numbers (0-9) and dashes? The user will type a phone number, but I want to make sure he doesn't enter letters, just numbers and dashes. I already wrote code to make sure...
View Articleproblem with WFS Data, GDAL, Python, ArcGIS, & Defining Projection
I'm pulling in data in gml2 format with a EPSG#4267 from a wfs. I create a datastream in python and then run the following from the python window in ArcMap: Code: data = datastream.read() #write the...
View ArticleField Calculator Null Values
Hi I am trying to calculate the incomplete gamma function using Python. For now, the only way that I have found to do this is by using the library "mpmath". Particularly, the "mpmath.gammainc" function...
View Articleprint statement question
Hi folks, I am pretty new to Python and have a general question regarding altering the content/style of print statements. I am wondering how I could alter the last print statement in the code below, in...
View ArticleSearch Cursor Structure
I am using a SearchCursor to return a value from a selected attribute field. But, the cursor does not work or create an error. The ValueGain filed is a Long field type that is has not been set to a...
View ArticleConvertWebMapToMapDocument and extra_conversion_options
Hi, I'm with a struggle on using the extra_conversion_options on the ConvertWebMapToMapDocument function. Basically i'm trying to have multiple SERVER_CONNECTION_FILE on the same dictionary. Well since...
View ArticleLoop through features and create euclidean distance raster per feature
Hi, I am completely new to Python, but need to turn to it due to the nature of my research. I have a point shapefile with 45,000 points ('visits') spread across the UK and I want to obtain a euclidean...
View ArticleRow 'isNull()' problem
Hello, I am attempting to loop over a centerline shapefile and pull out specific values per field value to set as a new row value in another shapefile. However, the code fails when the returned value...
View ArticleList Broken Data Source's Path
Hi everyone, I'm a very amateur Python user. I've managed to get the following, which I pieced together from here and there, working for the most part. I need to create a csv file which has a column...
View ArticleArcPy CAD Layers Iteration to GeoDataBase
I am trying to extract an Ex-Pave layer out of a whole years worth of CAD drawings and I cannot seem to get the code to work I was able to find the following yet have not had an success. If anyone...
View ArticleScript for snapping feature classes in 2 different feature datasets
I have 2 Feature Datasets in a geodatabase. One dataset contains bus routes and the other contains bus stops for each route. I want to create a script that will snap the bus stops to the vertex of the...
View Articlehow default python logging is handled in arcgis ?
Hello I have some difficulties with log files The problem is that running it from ArcGIS Toolbox interface doesn't give me the same result than running it from python IDLE. In python IDLE, a new...
View ArticleCreate layer of records with Max Date
New at Python - appreciate assistance pointing me in the right direction. Using version 10.1 - not SDE environment I need to group an attribute table of inspection data and only select the most recent...
View ArticleHow to Programatically Turn On/Off specific Fields for all layers in an MXD?
Hello there, I'm wondering, with using Python, if there is a way to turn on/off specific fields (make visible/invisible) for all layers in an MXD, where the data type is an SDE feature class(in my...
View Article