Re: Querying distances between two coordinates

From: John Hurley <hurleyjohnb_at_yahoo.com>
Date: Fri, 10 Jun 2011 10:28:09 -0700 (PDT)
Message-ID: <b603279c-b4df-479f-ad9e-5c063f34b8ce_at_z37g2000vbl.googlegroups.com>



On Jun 10, 12:15 pm, Jeremy <jeremy0..._at_gmail.com> wrote:
> Hi this is a 10gR2 Standard Edition question.
>
> The requirement is to be able to calculate the distance between two co-
> oordinates expressed as latitude and longitude.
>
> Q1) How would the latitude and longitude be stored in an Oracle table
> (what data types)?
>
> Q2) What would an example query look like?
>
> Q3) Is this even possible with 10gR2 Standard Edition?
>
> Just to be clear (!) this is the sort of simplistic representation I
> guess
>
> item           lat          long
> ----           ---          ----
> P1             50.716667    -1.883333
> P2             51.023332    -1.872231
>
> The format of the lat/long are as I have been informed they are recorded
> in a remote system with which we are needing to integrate.
>
> I would want to be able to calculate the straight line distance between
> P1 and P2.
>
> Thanks for any pointers!
>
> --
> jeremy

This sounds suspiciously like homework but if I were you I would do some research on Oracle Spatial perhaps.

If lat and long are numbers then ... geez ... wonder what data type would be used?

When in doubt try http://asktom.oracle.com ... Received on Fri Jun 10 2011 - 12:28:09 CDT

Original text of this message