Hi, i have a database that has a lat long for each entry .
I have a query that supplies the lat longs of all entires within a lat long window what i want to do is calculate the distance between each set of lat longs and a base lat long ( i can do the calculation fine) i need to then sort all my entries based on this calculated distance how would i go about this?
Help with Lat long
Moderator: General Moderators
Re: Help with Lat long
So you want to build a distance matrix?
Go look up examples of how to build a multiplication table, there are plenty. It should serve as a base for what you're doing.
Go look up examples of how to build a multiplication table, there are plenty. It should serve as a base for what you're doing.
Re: Help with Lat long
Code: Select all
SELECT
[ FANCY CALCULATION HERE ] as `distance`
...
ORDER BY
`distance`Real programmers don't comment their code. If it was hard to write, it should be hard to understand.