A aviation & planes forum. AviationBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » AviationBanter forum » rec.aviation newsgroups » Simulators
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Lat/Lon to country codes/political boundaries



 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old February 13th 06, 11:58 PM posted to rec.aviation.simulators
external usenet poster
 
Posts: n/a
Default Lat/Lon to country codes/political boundaries

"Jeroen Wenting" jwenting at hornet dot demon dot nl wrote in message
...
You'd need a fairly large database of coordinates to determine that.


Not really.

Basically what I'd do is generate a fairly dense grid of cells overlaid on
a world map which lists the countries for each cell and store that in a
database.


Typically, what a program would actually do is store the boundary data as
vectors. Some optimization might be done to narrow the initial search
(perhaps grouping them within each octant of the sphere, for example), but
ultimately all one needs to do is a "point in polygon" test on each country
in the database, using the boundary data.

The boundary data can be as detailed as one wants. Searches go faster with
less detail, but of course that opens the possibility for boundary cases
returning the wrong country. IMHO, there's no practical way to solve that
though, given the inherent errors in the basic data anyway. Except for
boundaries defined by straight lines, no matter how much resolution you
have, there's the possibility for a wrong answer. The main thing is to make
sure the user is aware of the possibility (and to reduce the error enough
that a wrong answer isn't a big deal).

Using vector data is MUCH more efficient than turning the entire world into
a bitmap. Even though the algorithm is more complex, the sheer data
bandwidth issues for a world-sized bitmap more than offsets that.

Pete


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
UK planning to evict N-registered aircraft George Patterson Instrument Flight Rules 67 September 1st 05 09:04 AM
UK planning to evict N-registered aircraft Juan Jimenez Owning 37 September 1st 05 09:04 AM
Cross Country the main focus of soaring? mat Redsell Soaring 77 October 18th 04 11:40 PM
US cross country flight S Narayan Instrument Flight Rules 0 January 7th 04 03:58 PM
US cross country flight S Narayan Piloting 0 January 7th 04 03:58 PM


All times are GMT +1. The time now is 05:38 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 AviationBanter.
The comments are property of their posters.