PHP Algorithm for Destination.

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
santi_93
Forum Newbie
Posts: 2
Joined: Mon Oct 20, 2014 8:04 am

PHP Algorithm for Destination.

Post by santi_93 »

Hi guys;

As part of a project I need to design some sort of algorithm which will search the closest match (Destination), however I am unsure as to what data I need and which specific algorithms or code will be needed.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: PHP Algorithm for Destination.

Post by pickle »

"Destination" isn't a data type, so it's hard to help. Is that a set of lat/long co-ordinates? Street address? Cartesian co-ordinates?
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
santi_93
Forum Newbie
Posts: 2
Joined: Mon Oct 20, 2014 8:04 am

Re: PHP Algorithm for Destination.

Post by santi_93 »

I am creating a system which will help users find local business for certain categories. In the sign up page the users must enter in there full address which includes House number/address, city, town and postcode. So I need to creae/find an algorithm that will use these details to find the most local business.
User avatar
Celauran
Moderator
Posts: 6425
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: PHP Algorithm for Destination.

Post by Celauran »

You could create a bounding box and then use the Haversine formula on results inside that box.
Post Reply