Thursday, August 13, 2009

Easy Calculate 5.0 - Free Tools for Calculating Shape Geometries

I'm writing this entry in response to StuGotz's comment on my last post (Batch Edit String Fields - Free Tools for Calculating String Fields). StuGotz currently uses VB to populate fields with X, Y, Z, and M values but is looking for a more simplistic method for calculating these fields. This is a good opportunity for a post on Easy Calcuate 5.0 - a set of files (.cal) containing code for calculating a wide range of geometric properties for vector data (points, lines, and polygons) that can be easily loaded into the Field Calculator. The files are available for free here:

Easy Calculate 5.0

Just download the zip file and unzip the file to a directory on your hard drive. These .cal files are extremely easy to use and come in very handy for common geospatial calculations including the very properties that StuGotz is looking for - the X, Y, Z, and M dimensions for point features. Also included are files for calculating the from, to, and midpoint X and Y coordinates of a line, the maximum and minimum X, Y, Z, and M values for points, multipoints, and polygons, the X and Y coordinates for the center of polygons, the thickness ratio of each polygon, and many, many more (see above link for a complete list).

Okay, so I mentioned Easy Calculate 5.0 is easy to use, right? I didn't lie. Once you've downloaded and unzipped the file, here's all you have to do:

1. Right click on a field in the attribute table in ArcMap and select Calculate Values.
2. In the Field Calculator dialogue, click the Load button, navigate to the directory where you unzipped the files, and select the appropriate .cal file for your calculation.
3. Make any changes to the code *if needed* (adjust tolerance, etc).
4. Click OK.

Now is that easy or is that easy? I can see why they called it "Easy Calculate"!

In addition to geospatial calculations on attribute fields, Easy Calculate 5.0 also provides methods for editing the actual geometry of vector features including offsetting lines by a specified distance, generalizing lines and polygons using the Douglas Poiker algorithm, converting polygons to their bounding rectangles (envelopes), reversing the direction of lines, and more. Simply run the Field Calculator on the Shape field when using the files for editing feature geometry.

Field calculations using these files can be made at any of the ArcGIS license levels (ArcView, ArcEditor, and ArcInfo) with ArcGIS 8.x and 9.x. Changes to the fields and feature geometry are applied directly to the original data. If the .cal files are applied out of an Edit session (not available with ArcView), it is a good idea to make a copy of the original data, as the changes are irreversible. Calculations and geometry edits are applied only to selected features. If no features are selected, values for all records will be calculated.

Now, it's not Christmas or anything but I was feeling pretty generous and decided to work on a custom tool for StuGotz so that the fields for X, Y, Z, and M values can be populated with the click of a button (as if Easy Calculate weren't easy enough). So stay tuned and subscribe and/or follow this blog. Once I finish the tool, I'll write an entry on how to use it and upload it to the geospatial database so that it can be downloaded for free.

1 comment: