Web Analytics Made Easy -
StatCounter

Node Dangles

arcpy

Question: How do I get ArcMap to automatically pan through an area. As I mentioned in a previous post, I recently had the need to have ArcMap automatically pan through a project area. My first attempt was to print a series of data-driven pages (using a fishnet polygon layer as the index) this but that did not accomplish what I needed so I switched to arcpy, which made the task simple enough.
Seems like a lot of people are finding the ArcMap Field Calculator examples that I have posted useful so I will make an effort to post more of them. Most posts are generated after I do something and think that others might want to know how to do it. (Or so I can go back and remember how I did something without re-inventing it). Something I did today was create a field (!
You may have noticed that this post–ArcMap Field Calculator: Identifying Unique Cases, Single Field–specifies ‘Single Field’. Yes, that was my version of a cliff-hanger post. The basic structure I listed in that post can be expanded on to satisfy your needs. The example in my earlier post was case sensitive for example, you could modify it so it treats ‘a’ the same as ‘A’. Today’s example groups records into different cases based off the values of two fields, !
One of the standards in our databases is to store dates as 8-digit integer values in the format of yyyymmdd. This requires us to occasionally convert values from date fields into this format. We can do this in the ArcMap Field Calculator using this arcpy function: def datetodouble(inNum): splitList = str(inNum).split("/") return splitList [2] +("0"+ splitList [0])[-2:] +("0"+ splitList [1])[-2:]
One of the common functions I have to do is assign each record in a feature class with a unique identifier–normally just a sequential number from 1 to N. In ArcView 3.x, the formula was simply ‘rec + 1’ if I wanted to start with the number 1. In ArcGIS, the process got a little more complex–you had to write a little VBA in Field Calculator as described by ESRI.
I have been working on a python script that I want (NEED) to run as a scheduled task on a remote machine. I got to the point that the script did exactly what I needed when I was interactively running it in a Windows session but had problems when running it as a scheduled task. The debugging process was cumbersome–make a change, schedule a task to run it, log out of the machine, and wait.
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'.
Menu