Forum Moderators: phranque

Message Too Old, No Replies

'how do they do that' question

enter postcode, given nearby attractions

         

chrisandsarah

1:21 am on Feb 21, 2004 (gmt 0)

10+ Year Member



Hello
Ive just been checking out some uk tourism websites and on one of the bigger ones, you can enter your postcode and the site serves up attractions, hotels etc nearby. How do they do this? and is it a pricey/difficult technology to get implemented on a site?
I have a site that this sort of thing would be ideal on. It's a php/mysql driven website. Someone does the programming for me but he's not around to ask.
thanks for any info on the matter,

coopster

1:40 am on Feb 21, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



It all boils down to calculating distances on the earth's surface. The formula I have used will give mathematically and computationally exact results except when the two points are antipodal (on opposite sides of the Earth), then the formula is ill-conditioned, but the error, perhaps as large as 1 mile, is in the context of a distance near 12,000 miles. I could be wrong here, and I'm going to go out on a limb, but I don't believe anybody is trying to locate something they are going to drive to within 12,000 miles ;)

The tables used are two-fold:

  1. A table containing the sites to locate (and any additional information, such as address, phone, email, web site, etc.)
  2. A table containing the postcode, latitude and longitude (actually I believe it is the radians that I have stored)

I would estimate the cost of such an application at US $75 - $ 150 and to keep up to date with postcodes is roughly US $150 per year from a dependable service.

chrisandsarah

1:53 am on Feb 21, 2004 (gmt 0)

10+ Year Member



I forgot to mention also, if you click on an attraction to view its page of details, towards the bottom of the page they list nearby hotels and other nearby attractions and give the approximate distance in miles from the attraction i am looking at, to the other listed attractions/hotels.
eg:
Attraction1 Page Title
details and picture

Other nearby attractions:
Attraction2 (<1 miles from attraction1)
Attraction3 (8 miles from attraction1)
Attraction4 (14 miles from attraction1)

Nearby Hotels
hotel1 (<1 miles)
hotel2 (3 miles)

coopster

11:38 am on Feb 21, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



That information is derived the same way. All you need is a column representing the type of location (attraction, hotel, restaurant, etc). The actual distance is calculated during the query and used to determine what should be displayed (within nnn miles/km) and you can return that distance to show how far it is from the starting point (usually the requester's postal code).

chrisandsarah

12:32 pm on Feb 21, 2004 (gmt 0)

10+ Year Member



Ok thanks for the information. It helps alot. I'll talk to my programmer guy about it when he gets back from his hols. Its definately something i want to implement