PL/SQL (MOSC)

MOSC Banner

Is point to point distance calculations heavy in oracle ?

edited Jun 2, 2010 9:49AM in PL/SQL (MOSC) 2 commentsAnswered
I am designing an application to do GEO/RF mapping and need to crunch some numbers specifically the distance between points. I will be using great circle distance calculations with given latitude and longitude points :

var R = 6371; // km
var dLat = (lat2-lat1).toRad();
var dLon = (lon2-lon1).toRad();
var a = Math.sin(dLat/2) * Math.sin(dLat/2) +
       
Math.cos(lat1.toRad()) * Math.cos(lat2.toRad()) *
       
Math.sin(dLon/2) * Math.sin(dLon/2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
var d = R * c;

If I had to calculate distances between 500,000 points,  would this take a long time and is it worth pursuing via pl/sql or should this be done in java or python ... something like that ?

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center