Web Analytics Made Easy -
StatCounter

Node Dangles

geoprocessing

Awhile ago, I had a ArcSDE problem that required ESRI technical support to help trouble-shoot. The problem was odd but was resolved by rebooting the server. During the process, though, the support person had me set a couple of environment variables for logging SDE activity on the client machine. The settings were SDEINTERCEPT and SDEINTERCEPTLOC. From ESRI’s Help, SDEINTERCEPT specifies what activity to log and SDEINTERCEPTLOC specifies where to save the log files.
I’ve previously posted python code to check if a field index exists for both ArcGIs 9.3 and ArcGIS 10.0. Recently I have been working on a process that was using this code but it was not working because it looks for an index with a specific name. It was not working in this case because the name of the indexes was getting incremented as they were being created. For example, I was building an index on the table C5ST, field RelateId ([C5IX].
Discovered something today. I was working on an arcpy script that copies a raster dataset from a file geodatabase into a Postgres SDE geodatabase and then does some boring routine tasks–building stats, creating a mosaic dataset, adding the raster to the mosaic dataset and making a couple referenced mosaic datasets. It sometimes has trouble with the initial step of uploading the raster because of the sheer size of if (1m elevation raster for counties) and it failed today on one.
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.
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'.
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.
Ever since the ever-popular post, Zipping a shapefile using python, came out, people have been asking (one person, yesterday) for a sample of how to zip a file geodatabase using python. The key trick, as shown in line 17, is appending the basename of the file geodatabase (‘nfg.gdb/’ in my example) in front of each file as you write it to the zipfile. UPDATE: WordPress messes with the spacing when I post code, making it difficult to post code that can just be copied & pasted and have work.
NOTE: I have a post here that shows how to check if a field exists using arcpy in ArcGIS 10.0. In developing a python script to reload a geodatabase, I wanted to create any necessary indexes. No problem creating the index, for example: gp.AddIndex_management(tablename, field, IndexName, "NON_UNIQUE", "NON_ASCENDING") But before creating the index, I wanted to verify that it did not exist. I tried the ever-popular, exists but could not get it to work–either it does not detect indexes or I just never got the fully-qualified name for the index right (ArcSDE using a postgres datastore).
Related to my post on how I enable a script to accept parameters from different sources, I also often set up pythons scripts to output information a variety of ways. This is largely due to the fact that some are called by ArcToolbox scripts. Running in ESRI’s domain, these scripts need to send the output through the arcgisscripting object but if you are running the python outside the ArcGIS framework, you can just print.
I was using Model Builder (ugh!) to select records in one table (CWI.C5ST) that relate to a subset of records ([BHGEOPHYS] = ‘Y’) in another table (CWI.C5IX). There is not an existing tool for doing this in ArcGIS. I did find a post by Layne Seely in ArcForums titled ‘trying to perform ‘relate’ in Model Builder.’ that led me to the Make Table View under Data Management Tools-Make Table View and even had the basic syntax I was looking for (if it hadn’t I probably would have guessed that it would not allow subqueries).
Menu