Bookmark this page: Add Derive latitude longitude from integer values to Yahoo MyWeb Add Derive latitude longitude from integer values to Google Bookmarks Add Derive latitude longitude from integer values to Windows Live Add Derive latitude longitude from integer values to Del.icio.us Digg Derive latitude longitude from integer values! Add Derive latitude longitude from integer values to Netscape
  •  
  • Subject
  • Author
  • Date
If you were  Registered and logged in, you could reply and use other advanced thread options
Posted by turntableguy on June 30, 2005, 4:06 pm


I'm a software developer hired to work on a GIS application. My client
has an Access database they purchased a long time ago from some website
that no one remembers. The database contains a list of cities along
with their coordinates (latitude/longitude). I have to process the
coordinates as latitudes and longitudes, but the database has stored
them as signed integers (not decimals). I can't figure out the
conversion from integer to degress/minutes/seconds and was hoping
someone here can help me.

Here is some of the sample data:
(The 'ACTUAL' values displayed below are from a sample application that
shipped with the data, but we don't have the source code for it).

Austin, TX
ACTUAL: 30 17N, 97 44W
STORED IN DB: 3028, -9773

Berkeley, CA
ACTUAL: 37 52N, 122 16W
STORED IN DB: 3787, -12227

Birmingham, AL
ACTUAL: 33 31N, 86 48W
STORED IN DB: 3352, -8680

As you can see, the data provider seems to have encoded the degrees as
is (e.g. 30, 37, 97, 122). What I don't get is how you calculate the
minutes/seconds from the integer. For example, in Austin, TX above, how
do you figure 17 minutes (latitude) from 3028?

If any math wiz can figure out the pattern here, I'd greatly appreciate
it. Thanks!


Posted by Chuck Taylor on June 30, 2005, 4:16 pm


On 30 Jun 2005 13:06:07 -0700, turntableguy@gmail.com wrote:

>I'm a software developer hired to work on a GIS application. My client
>has an Access database they purchased a long time ago from some website
>that no one remembers. The database contains a list of cities along
>with their coordinates (latitude/longitude). I have to process the
>coordinates as latitudes and longitudes, but the database has stored
>them as signed integers (not decimals). I can't figure out the
>conversion from integer to degress/minutes/seconds and was hoping
>someone here can help me.
>Here is some of the sample data:
>(The 'ACTUAL' values displayed below are from a sample application that
>shipped with the data, but we don't have the source code for it).
>Austin, TX
>ACTUAL: 30 17N, 97 44W
>STORED IN DB: 3028, -9773
>Berkeley, CA
>ACTUAL: 37 52N, 122 16W
>STORED IN DB: 3787, -12227
>Birmingham, AL
>ACTUAL: 33 31N, 86 48W
>STORED IN DB: 3352, -8680
>As you can see, the data provider seems to have encoded the degrees as
>is (e.g. 30, 37, 97, 122). What I don't get is how you calculate the
>minutes/seconds from the integer. For example, in Austin, TX above, how
>do you figure 17 minutes (latitude) from 3028?
>If any math wiz can figure out the pattern here, I'd greatly appreciate
>it. Thanks!


It looks like the "integer" values are actually fixed-point values,
with an implied decimal point before the rightmost two digits.

For example, 3028 --> 30.28 --> 30 deg 16.8 min


--
Chuck Taylor
http://home.hiwaay.net/~taylorc/contact/

Posted by Mogens Beltoft on June 30, 2005, 4:19 pm


turntableguy@gmail.com wrote:
> I'm a software developer hired to work on a GIS application. My client
> has an Access database they purchased a long time ago from some website
> that no one remembers. The database contains a list of cities along
> with their coordinates (latitude/longitude). I have to process the
> coordinates as latitudes and longitudes, but the database has stored
> them as signed integers (not decimals). I can't figure out the
> conversion from integer to degress/minutes/seconds and was hoping
> someone here can help me.
>
> Here is some of the sample data:
> (The 'ACTUAL' values displayed below are from a sample application that
> shipped with the data, but we don't have the source code for it).
>
> Austin, TX
> ACTUAL: 30 17N, 97 44W
> STORED IN DB: 3028, -9773
>
> Berkeley, CA
> ACTUAL: 37 52N, 122 16W
> STORED IN DB: 3787, -12227
>
> Birmingham, AL
> ACTUAL: 33 31N, 86 48W
> STORED IN DB: 3352, -8680
>
> As you can see, the data provider seems to have encoded the degrees as
> is (e.g. 30, 37, 97, 122). What I don't get is how you calculate the
> minutes/seconds from the integer. For example, in Austin, TX above, how
> do you figure 17 minutes (latitude) from 3028?
>
> If any math wiz can figure out the pattern here, I'd greatly appreciate
> it. Thanks!
>

No problem :)

The key is that there are 60 minutes to a degree...

So Austin, TX, above was actually 30 17N and 3028 in the database.

You have already figured that the first two digits from the database is
the number of degrees, 30 in this example.

The next part is 17 minutes, which is 17 minutes divided by 60 minutes
per degree eqauls 0.28 degrees, hence 3028 in he database.

Going the other way you take -9773 which makes W (think of a coordinate
system where W is to the left of the axis making values negative) 97
degrees 73 multiplied by 0.6 equals 44 minutes: 97 44W

So N and E are represented as positive values in the database, while S
and W are negative values in the database.

Hope this helped.

/Mogens

Posted by Walter Wright on July 1, 2005, 3:14 am


Mogens Beltoft wrote:
<snip>
> You have already figured that the first two digits from the database
> is the number of degrees, 30 in this example.

I think more accurately the last two digits are the decimal degrees, e.g
the value -12227 represents -122.27.

Walter



Posted by Peter on June 30, 2005, 4:19 pm


turntableguy@gmail.com wrote:
> I'm a software developer hired to work on a GIS application. My client
> has an Access database they purchased a long time ago from some website
> that no one remembers. The database contains a list of cities along
> with their coordinates (latitude/longitude). I have to process the
> coordinates as latitudes and longitudes, but the database has stored
> them as signed integers (not decimals). I can't figure out the
> conversion from integer to degress/minutes/seconds and was hoping
> someone here can help me.
>
> Here is some of the sample data:
> (The 'ACTUAL' values displayed below are from a sample application that
> shipped with the data, but we don't have the source code for it).
>
> Austin, TX
> ACTUAL: 30 17N, 97 44W
> STORED IN DB: 3028, -9773
>
> Berkeley, CA
> ACTUAL: 37 52N, 122 16W
> STORED IN DB: 3787, -12227
>
> Birmingham, AL
> ACTUAL: 33 31N, 86 48W
> STORED IN DB: 3352, -8680
>
> As you can see, the data provider seems to have encoded the degrees as
> is (e.g. 30, 37, 97, 122). What I don't get is how you calculate the
> minutes/seconds from the integer. For example, in Austin, TX above, how
> do you figure 17 minutes (latitude) from 3028?

There are 60 minutes per degree, so in .28 degrees there are 17 minutes
(0.28 * 60).