Sunday, October 30, 2005

Some Great AM Hours & Solving a Problem

I tell you, there are few things that can compare with the supreme satisfaction that I experience when I have a single problem, a solvable problem, and of course the time in which to solve it.  Well, time of course is the scarcest commodity, but that’s what the AM hours are for eh?

And, let’s face it, this is what attracted (and still attracts) me to librarianship.  Every day I manage data/information, research data/information, help and educate others to do the same, but am rarely forced to interpret or compile the data into any hard and fast thesis (aka write a paper) and rarely am faced with a project deadline similar to the private sector.  Sure I have to give a little in terms of a smaller salary (slightly…or perhaps not), but it is so worth it.

Why am I writing about this now?  Well, I just spent some great AM hours tackling a problem, solving the problem, and now (best of all) I get to hand it off to the actual researcher who will do the actual work.  Here is the story:

Geosciences professor is having trouble calculating the azimuth between a series of points in a feature class.  After I imagine some headaches trying to figure this out, the professor asks me if I have done this before.  Well no, I say, but surely there must be something built into ArcGIS that can handle this, right?  If there is, the professor says, I sure could not find it.  All right-y then…

So, with a definitive task in mind, I grab myself a nice tall cup of water, sit down at the computer, and pleasantly begin the search.

Easy to use button?
  • Nope.

Not even a geoprocessing tool?
  • No.

Shoot on over to ArcScripts but no script in sight.
  • OK then.

Pull up to the ESRI Forums.
  • Wow, there is something here.  Others have had this problem before.

  • Found a thread: Measuring azimuth between 2 points.

  • This is good.

  • The poster, one H Gonzago, posted an ArcObjects sub-procedure.  The post states that he got it (copy & paste) from the ArcObjects Developer Help.

  • OK, so I quickly create a button in ArcMap, call the sub-procedure on the onClick event, and presto it works like a charm.

  • A for/next loop will be necessary to process all the points, and I sent this to the professor.  Of course I even offered to write the loop for the professor.

Now this was a couple of well spent AM hours that has given me much satisfaction.