|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
If there is a bettere place to ask this question or a site where this is
explained, please let me know, as I dit not find it while searching for it. First the instroduction: I have on one hand the latitudes and longitudes from each of the 1147 Belgian postalcode (http://houghi.org/Fun/PC_lon_lat.txt) I also have the same for 100 stores. I measured the distance from each postalcode to each store (Rather I did it from each store to each postalcde) with the great cirlcle calculation¹ That way I build a raster that contains all posalcodes and all stores and distances. What I want to do is that when somebody enters his own postalcode on a website, he or she will be able to see what the 5 closest stores are, This is a very small smaple of how this looks at this moment. From left to right, postalcodes, from top to bottom, storenumbers. This way when a new store is added (about weekly) I can just measure the distiance from that store to all postalcodes and be ready 1000 1010 1020 2000 ... 1001 8927 8361 2282 8254 1004 7217 2572 7237 8762 1010 8272 9828 982 8712 1088 9128 8127 3652 6516 .... So if I enter 1020 as postalcode and I want to see the 2 closest stores, I should get: 1010 1001 in that order. That I then can link to the database with the actuals stores in them with the adresses and so on in them. So what would be the best way to do this? ¹If you like, I can explain in much greater detail how I did it, but basicaly I used GoogleAPI for the coordinates and a bash script using the great cirle distance to measure between two points and put that in a file. houghi -- Remind me to write an article on the compulsive reading of news. The theme will be that most neuroses can be traced to the unhealthy habit of wallowing in the troubles of five billion strangers. -- Heinlein |
|
![]() |
| Outils de la discussion | |
|
|