![]() |
| 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. |
|
|||||||
|
|
Thread Tools | Display Modes |
|
#3
|
|||
|
|||
|
"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 | |
|
|
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 |