Maptitude - http://research.umbc.edu/~roswell/maptitude.html

--------------------------- ListBot Sponsor --------------------------
  Get fast, easy info by phone: Call 800-555-TELL.\nNews, weather,
restaurants...& much more!\n\n
http://on.linkexchange.com/?ATID=27&AID=2143
----------------------------------------------------------------------

All:

>I don't think that it recognizes D/M/S format either...

There is a way to handle coordinates in D/M/S format, basing your import on 
formula fields. Just use the basic formula:

DecimalDegrees = Degrees + Minutes/60 + Seconds/3600

or, if the degrees are negative:

DecimalDegrees = -1 * (Abs(Degrees) + Minutes/60 + Seconds/3600)

or, in any case:

DecimalDegrees = Sign(Degrees) * (Abs(Degrees) + Minutes/60 + Seconds/3600)

The hard part can be separating out the degree, minute, and second parts of 
a single field. There are a plethora of ways to format degrees, minutes, 
and seconds. If the format is fixed, the Left(), Right() and Substring() 
functions can pick out the pieces.

If there are simple separators, like spaces, tabs, and punctuation marks, 
you can use the Word(string s, integer position) function to get the nth 
word. Since a period is a punctuation mark, any decimal part of the seconds 
would be dropped. But, since the seconds are at the end, you could probably 
use the Right() function to get the whole thing.

When you convert a character string to a number with Value(), trailing 
non-number characters will terminate the number; e.g. 123' will be read as 
123, ignoring the minutes sign.

So, say your coordinates are like this, in character fields:

DMSlat = 23 45' 67"
DMSlon = -98 54' 76"

The following formulae would work:

Lat = Sign(Value(Word(DMSlat,1))) * (Abs(Value(Word(DMSlat,1))) + 
Value(Word(DMSlat,2))/60. + Value(Word(DMSlat,3))/3600.)

Lon = Sign(Value(Word(DMSlon,1))) * (Abs(Value(Word(DMSlon,1))) + 
Value(Word(DMSlon,2))/60. + Value(Word(DMSlon,3))/3600.)

If you have GISDK, try the following in the Immediate Execution dialog box:

DMS = "-98 54' 76\""
ShowMessage(DMS)
Lat = Sign(Value(Word(DMS,1))) * (Abs(Value(Word(DMS,1))) + 
Value(Word(DMS,2))/60. + Value(Word(DMS,3))/3600.)
ShowMessage(string(Lat))

Thus endeth the lesson!



Peter

----------------------------------------------------------------
Peter Van Demark
Director of GIS Products and Training        Phone: 617-527-4700
Caliper Corporation                            Fax: 617-527-5113
1172 Beacon Street                     E-mail: [EMAIL PROTECTED]
Newton MA 02461-9926            Web site: http://www.caliper.com


______________________________________________________________________
To unsubscribe, write to [EMAIL PROTECTED]

Reply via email to