Querying distances between two coordinates

From: Jeremy <jeremy0505_at_gmail.com>
Date: Fri, 10 Jun 2011 17:15:05 +0100
Message-ID: <MPG.285c5369d723481898990a_at_News.Individual.NET>



Hi this is a 10gR2 Standard Edition question.

The requirement is to be able to calculate the distance between two cooordinates  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
Received on Fri Jun 10 2011 - 11:15:05 CDT

Original text of this message