Sorting a Coded-Value Domain Add-In (ArcGIS 10)
I am working on an data-entry application to edit feature classes that contain several coded-value-domains. The problem with some of the domains, however, is that some entries have been added after the initial creation. So the first 25 entries are in alphabetical order and there are some stragglers at the end that are in the order they were appended.
This can be confusing for users–they go to select ‘Milli Vanilli’ and look between ‘Madonna’ and ‘Motley Crue’ but can not find their favorite band there–they have to go to the end of the list to find their selection.
Quick & Dirty arcpy: Batch Splitting Polylines to a Specific Length
For some odd reason, I wanted to split all the arcs in a polyline feature class to a specific length–if a specific feature was longer than the target length, it would become two or more separate polyline records.
Here is the bare-bones script that copies an existing feature class into a new feature class then processes each record, splitting it into multiple records if the polyline is longer than the user-specified tolerance.
Change Detector arcpy Script
During a process I was working on, I needed to compare a feature class before and after some edits. I did not quickly find anything in ArcToolbox but searching ArcResources led me to Change Detector script by Bruce Harold. After making a couple of tweaks–for some reason in one of my feature classes, the Shape field had an upper case ‘S’ and in the other it was a lower case ’s'.
ArcIdeas: Scale-Dependant Settings
Someone mentioned an idea on ArcIdeas for making various display settings on a feature classes scale-dependent. Right now some of that can be accomplished by loading a feature classes multiple times, adjusting the settings, and setting the visible range. Working more and more in ArcGIS Server, I can see the value of increased scale-dependent settings.
I’m not sure how rapidly ESRI takes ‘Ideas’ into consideration but if you feel like it would benefit you, why not promote this idea: Scale Range, SQL Query and Symbology Rendering in ArcMap.
Quick & Dirty arcpy: Field Listings
I have to often get a table structure for a feature class or table into either a spreadsheet or word processing document. There might be an easy way to do this in ArcGIS 10 but I haven’t found it. So, as is my nature, I decided to roll my own.
This is a bare-bones script that iterates through the fields, printing the field name, type, width, and precision. There are three optional features to it:
Updating Access ODBC connections using VBA
I don’t do much in Access or VBA but sometimes you inherit things that force you, at least temporarily, to go retro.
We have an Access-based data extraction routine that uses several (21) pass-through queries that use an ODBC connection. The queries are pulling data from an Oracle database maintained by a different agency that enforces a time-out of passwords every three months.
So every three months I have to go through the ODBC connections for these queries and change the password.
Using arcpy to List Domains Assigned to Featureclass Fields
I was making an edit (adding leading ‘0’s) to a coded-value domain in an SDE database and realized that my edits were changing the order of the rows of my domain. Rows were moved to the bottom of the list when they were edited.
So I went through the process of converting my domain back to a table, made my edits in Access and exported the rows to a .dbf in the order I wanted them.
Revoking Public Permissions in PostgreSQL ArcSDE
While banging my head on how to grant access to a referenced mosaic dataset , I did something out of frustration that I normally would not do–I granted ‘public’ access to some data.
Then, after figuring out the problem, I went to revoke public access using ArcCatalog and received this error message:
Error 999999: Error executing function.
The Object being referenced does not exist [ERROR: role ‘public’ does not exist::SQL state: 42704]
Referenced Mosaic Datasets Permissions on SDE
While I’m enjoying the functionality of the new Referenced Mosaic Dataset that have been introduced in ArcGIS10, something that I stumbled over recently was administering the privileges to a referenced mosaic dataset.
A referenced mosaic dataset is a raster datatype that uses a mosaic dataset as a base. For example, we loaded a series of DEMs into a mosaic dataset and then created a referenced mosaic dataset that does the meters to feet conversion for us.
ArcMap Field Calculator: Calculating Geometry using arcpy
One of the things I had not gotten around to doing in ArcGIS 10 was figure out how to directly manipulate the geometry of a record using the Field Calculator. When I stumbled upon a bug in the way the Extract Values to Points tool handles Null geometries, I figured it was time to figure it out. Setting the X, Y to 0,0 was sufficient for my needs.
I set the Parser to Python and the formula was simple once I figured out the syntax: