Re: Calculate distance between 2 latitude/longitude Point

2010-07-29 Thread Tomi Pieviläinen
> * > In [45]: Point(40.96312364002175, > -5.661885738372803).distance(Point(40.96116097790996, -5.66283792257309)) > Out[45]: 0.0021814438604553388 The results are what you get from the db. The thing is, you can't assume that the distance in degrees is the same everywhere, so you can't use a simp

Re: Calculate distance between 2 latitude/longitude Point

2010-07-29 Thread Alex Robbins
Geopy has a distance function build in, if you want something a little more widely used/tested: http://code.google.com/p/geopy/wiki/GettingStarted#Calculating_distances Alex On Jul 29, 5:23 am, Alexandre González wrote: > I've solved translating a JavaScript function to python: > > from math imp

Re: Calculate distance between 2 latitude/longitude Point

2010-07-29 Thread Alexandre González
I've solved translating a JavaScript function to python: from math import * RADIUS = 6371 #Earth's mean raadius in km def distance(origin, destiny): (latitude1, longitude1) = (origin[0], origin[1]) (latitude2, longitude2) = (destiny[0], destiny[1]) dLat = radians(latitude1 - latitud

Re: Calculate distance between 2 latitude/longitude Point

2010-07-29 Thread Alexandre González
I going to try it now, but the unique results that I obtain in google searching [1] gd2gcc is this thread :) [1] http://www.google.com/search?hl=en&safe=off&q=gd2gcc&aq=f&aqi=&aql=&oq=&gs_rfai= Did you make some mis

Re: Calculate distance between 2 latitude/longitude Point

2010-07-28 Thread !!CONDORIOUS!!
(lat , lon in radians) pt 1 = lat, lon, alt=0 pt 2 = lat, lon, alt=0 p1_gcc = gd2gcc(p1) p1_gcc = gd2gcc(p2) gd2gcc ( is a standard operation found on the itnernet) dis = sqrt(sum(pow(p1_gcc-p2-gcc, 2))) cheers, 2010/7/28 Alexandre González : > Hi! I'm using the Django GEOS API [1] in my proj

Re: Calculate distance between 2 latitude/longitude Point

2010-07-28 Thread Alexandre González
I've tested it yet multiplying in miles and kilometers but the result if K miles/kms instead the correct result. Thanks for your reply. On Wed, Jul 28, 2010 at 19:00, Bill Freeman wrote: > Having done my geo distance by "hand" instead of Django GEOS, it may not > be relevant, but have you tried

Re: Calculate distance between 2 latitude/longitude Point

2010-07-28 Thread Bill Freeman
Having done my geo distance by "hand" instead of Django GEOS, it may not be relevant, but have you tried multiplying the result you get by the radius of the earth? Most formulas for this kind of thing are applicable to any size sphere, not just the earth, and return the distance as an angle, as se

Calculate distance between 2 latitude/longitude Point

2010-07-28 Thread Alexandre González
Hi! I'm using the Django GEOS API [1] in my project to see the distance between two users. I get the coordinates from google maps in latitude/longitude mode and I need to calculate the distance between them. I'm testing with .distance() method at GEOSGeometry but I receive a strange value. This i