Re: Latitude/Longitude handling in ORACLE?

From: Alvin W. Law <alaw_at_oracle.com>
Date: 9 Mar 93 05:33:41 GMT
Message-ID: <ALAW.93Mar8213341_at_ap221sun.oracle.com>


In article <1993Mar9.005354.9594_at_ml.csiro.au> \ jstander_at_ml.csiro.au (Jeff Stander) writes:

> Here at CSIRO fisheries we are building a fisheries database that
> requires forms processing of vessel positions in latitude/ longitude.
> They are entered in degrees/minutes/seconds and presumably will be
> stored internally as positive or negative decimal degrees (that's our
> current thinking, anyway).
 

> There are some problems inherent in conversion and display of this type
> of data. If any of you Oracle netters have addressed this problem I
> would appreciate hearing from you.

Since this is analogous to displaying a time interval in HH:MI:SS format, try storing the latitude and longitude in plus/minus seconds and retrieve it this way:

select	TRUNC(position/3600) degree,
	MOD(TRUNC(position/60),60) minute,
	MOD(position,60) second
from	table

In this way, you avoid storing number with unwanted rounding.

In term of forms coding, this would only requires additional step in the commit and the post query trigger.

Hope this helps.

---
 Alvin W. Law .............................................. Oracle Corporation
 Senior Software Engineer ...................... 300 Oracle Parkway, Box 659306
 Manufacturing Applications .......................... Redwood Shores, CA 94065
 Email: alaw_at_oracle.com ...... Voice: +1 415.506.3390 .... Fax: +1 415.506.7299
--
 Alvin W. Law .............................................. Oracle Corporation
 Senior Software Engineer ...................... 300 Oracle Parkway, Box 659306
 Manufacturing Applications .......................... Redwood Shores, CA 94065
 Email: alaw_at_oracle.com ...... Voice: +1 415.506.3390 .... Fax: +1 415.506.7299
Received on Tue Mar 09 1993 - 06:33:41 CET

Original text of this message