calculate relevant distance between geocode locations

thellie

Member
Hey :)
I've woken up with a germ of an idea, but want to just throw it out in the open before spending time on it...

1. Googlemap
Using the googlemap, I have geocoded a number of different sightseeing locations in our area. Is it possible to calculate relevant distance between geocode locations, and get a result in km/miles? If so I could then assign a fee per km/mile, which would automate the tour price calculation process... (maybe use the radius widget?)

It would also help with customers creating their own tours, as I could add a time element - eg a tour programme has 8 hours, and each selection the customer makes, deducts the assigned period of time from the total...?

2. Geocode on lookup trigger
Could I (also) set a lookup to trigger, or use a cascading dropdown, when a selection is made?

eg. the customer selects Sight A. This triggers a lookup, or uses a cdd, to bring up the nearest 3 options available via the results from 1. (above ) - it would mean that when a customer is choosing where they wish to go, the programme they create is actually viable, and not just a mish-mash of unachievable options within the programme timeframe.

Does that make sense? It's still only 6am, and I had a few whiskies last night, so it may just be pie in the sky... :)
 
Ideally, both - some of the parts would be trekking, while others are vehicle-borne/on-road. That would presumably mean adding a further element to distinguish the two...?
 
This is doable, but a lot of custom coding that I couldn't really help with, except on an hourly basis.

There is an example in the map element JS, where I recently added the ability to do driving directions in a map element, by specifying another map element to calc the directions from. So there's code in our map JS that shows you how to do that bit, given two map points.

You wouldn't be able to use a CDD type lookup to then get other locations within X distance, as that relies on data hard coded into the database, but you'd need to calculate the distance from the initially selected point on the fly. And that part would have to be done in PHP, using some custom AJAX, and some nitty gritty PHP to do the distance calculations (not sure if it can be done as part of a MySQL query, you'd have to select all your locations then do math on them).

-- hugh
 
Eek, I'm backing away slowly and reaching for the whisky again...

Maybe when I have (a lot) more time, and if I can secure a budget from the foundation, I'll come back to you with this project - I think it's a pretty Good Eye Deer, so I won't be discarding it.

Thanks for taking the time to think through it. It's much appreciated :)
 
Yeah, I get what you are trying to do, and it's an interesting idea. But fairly non-trivial to implement.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top