I try to calculate distance between two cities and I'm in big confusion because the results are wrong.
I have a model in geodjango like this:
class Address(geo_models.Model): coordinates = geo_models.PointField(srid=2180) objects = geo_models.GeoManager()
Address object using
Lng from Google Maps i this way
a = Address(coordinate = "POINT(%f %f)" % (lat, lng)) a.save()
and then I calculate distance between
Address object and another point (which
lng I have also from Google Maps)
coordinates = fromstr("POINT(%f %f)" % (lat, lng), srid=2180) for a in addresses.distance(coordinates): print(a.distance)
The calculation result is 25 km but I know that it is wrong. Right distance is around 18 km also Google Maps tells that it is 18 km.
Could someone tell me where I make a mistake?
srid=2180 to model and to reference point and now the result is