We have a db which has a suppliers postcode and the number of miles they operate in. We need to create a search where someone can click on a map and it will return a list of all the suppliers that cover that point (ie it checks the distance the point is for each supplier and if this is less than their maximum operating mileage they are returned by the search - dont need to have the actual distance returned) Can anyone suggest an efficient methodology for this or an opensource & free component?
It depends on your data. What does your data look like? But the map must have some boundaries (postal code or geographical, points) so where ever they click you will have the center point. After that all you have to do is supply the radius to the center point and that will give you the furthest point that should be returned. If it's postal codes, create a image map with the postal code boundaries, when they click on that, look up the geographical center point for that postal code, then using that point, adding the radius, lookup all postal codes that fall within that radius.
Unfortunately it is the reverse on the distances. It isnt like a real estate/ estate agency search where the searcher looks for all properties for sale within X miles of postcode BR1 1DP but instead is that simply the user gives the postcode BR1 1DP and the script has to check which of the registered suppliers cover this postcode. ie for each entry it will have to check the distance between the two postcodes and then see if this is within the maxium distance the supplier has said they are willing to travel for a client. I think I have an idea on how to do the actual search I am now just struggling to find a db to use. The free ones I have found are inaccurate/ incomplete (given they say I travel over 1000 miles to work each day) and the cheapest I have found from a legitimate Royal Mail reseller is £300 which is above budget. There are plenty claiming to sell complete for £50 which would be ok in price terms but there is no way to know their accuracy/ completeness before parting with the money (and most look fairly "dodgy" so unlikely to get money back if the data is incomplete)
I don't see the difference. You used BR1 1DP, thats in Bromley, Westmoreland Rd. // minimum, maximum ranges latitude,longitude 0.023087,51.38914 Code (markup): So now if the suppler is in BR4 0ND West Wickham, High St. latitude,longitude -0.007226,51.375013 Code (markup): The equation then becomes SELECT (suppliers locations + maximum radius service distance) where the user selected a location postal code is within that range. Really it's a simple sub-query if you have X and Y points or latitude longitude points for both the supplier and user searching locations. With any good Royal Mail Postal Code database they should have that data. At least the ones I have used. The one I have now is a street level database that I created with map sets from my TomTom subscription, they update a lot more than Royal Mail does and their data is way more accurate when it comes to direct address mapping (point to point, real miles). I used to pay 1200 dollars a year and the Royal Mail data was not that great, it's very good for seeing if an address exists, but location plotting is sometimes way off.
How do you get the data from the tom tom subscription? It is only for a personal hobby site so dont want to be spending too much and likewise need it only to be accurate to within a couple of miles.