From Cory Eicher

Thursday, March 02, 2006

Oprah does GIS?

Spacing Out
I came across an interesting ESRI support document today: HowTo: Salvage a corrupt shapefile. The title cracks me up. It sounds like something you might see on an Oprah episode... Today's show: salvaging a corrupt shapefile, taming you unruly teenager, er, bloated personal geodatabase, and getting the most out of your relationship...classes...

I'm one that appreciates a bit of irony, and even this technical support document delivers. The document gives you about 15 things to try to fix a dusted shapefile, but it contains this disclaimer: "If the steps in this document do not salvage the shapefile, revert to the back up". Well, if nothing else, this document has inspired me to backup my laptop.

I was actually searching for an answer to this question: "Can a shapefile name contain spaces?". My research is inconclusive. Lots of people/places say that it should not, but ArcCatalog certainly lets you create a shapefile with a space in the name. Seems to me that it'd be bad practice.

Off on a Tangent
Something else, unrelated, that I came across recently. .NET has two Arctan functions. From the Microsoft doc:

Atan - Returns the angle whose tangent is the specified number.
Atan2 - Returns the angle whose tangent is the quotient of two specified numbers.

An interesting difference between the two, is that the return val for Atan is θ in radians where -π/2 ≤ θ ≤π/2 (-90 to +90 degrees). If you're working (like I was) with angles that represent directions in 360 degrees, and you use Atan, you'll probably need to do some extra work with the return val to get what you want... Whereas, with Atan2 the return val is θ in radians where -π ≤ θ ≤ π (-180 to 180 degrees). As far as I see it, this covers you for a full circle. Pass in your cartestian y and x (+ or - values possible) and with Atan2 you'll get the math angle you're looking for, at least I did...

Talk to you soon,

-Cory

0 Comments:

Post a Comment

<< Home