Search code examples
phpgeolocation

Coordinates of world continents


I am building a script that's powered by google maps where user chooses the a location from a map and save the long, lat in database aa a part of directory listing form.

I was thinking to add a search functionality by world continent for (America, Asia, Europe, Africa).

but this require having the coordinates of these locations like America long between 'xx' and 'yy', lat between 'aa' and 'bb' so I can look it up in the database.*

And I don't seem to find these info any where,

Any help would be appreciated.


Solution

  • Ok, as a quick solution for this search functionality, I'd set-up two tables in a database. One would map every listing to a country, another would map every country to a continent, so that search could be performed joining these two tables. Use google geocoding to get country from latitude/longitude if needed.

    A mysql continent/country database can be found here.