开发者

Coordinates of world continents

开发者 https://www.devze.com 2023-04-10 07:02 出处:网络
I am building a script that\'s powered by google maps where user chooses the a location from a map and save the long, l开发者_Go百科at in database aa a part of directory listing form.

I am building a script that's powered by google maps where user chooses the a location from a map and save the long, l开发者_Go百科at 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.


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.


This website will help you quickly get your own bounding boxes:

http://bboxfinder.com

For example, for one project I didn't want to include Europe all the way North to Knivskjellodden or east to the Urals, so I drew this:

Coordinates of world continents


There are no simple "lat/lng bounding boxes" for the continents because the continents have irregular boundaries. For example Ankara in Turkey has approximatively lat=40, lng=33. But the latitude 40 crosses Europe, Asia and America; and the longitude 33 crosses Europe, Asia and Africa.

Similarly, there are no simple "lat/lng bounding boxes" for states.


If you know the tiling algorithm of google maps you can try the spatial index to get all geo codes from a bounding box from a continent. Like the tiling algorithm this method is not very accurate.

0

精彩评论

暂无评论...
验证码 换一张
取 消