Field Calculator
In the last week, I have looked for multi-part features a couple of times. Today, I was looking for multi-part polygons after dealing with the fall-out of a case of Clip Gone Wild as shown below.
I have not found a way to write a query to find these but Field Calculator does allow you to calculate a field’s value to the number of parts.
Using the Python parser, just write the formula (note that case matters): !
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 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.
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: