gorth
Joined: 13/10/2012 05:19:52
Messages: 2
Offline
|
hi, I wrote a program today to compute "bounding boxes" on countries
by cycling thru every row in the geoname table for each country (huge!
10 million x 251, or 2.5 billion queries), the problem I have is that many
countries include territories on the other side of the world, so I get huge
bounding boxes for countries such as France or England. However, this
exercise revealed what looks like errors. I started with countries spanning
a negative & positive bounding box ("B.B.") to find anomilies, got this:
SELECT country.code, country.name, north, south, east, west
FROM region_bounding_box, country
WHERE east > 0 and west < 0 AND country.code = region_bounding_box.code;
+---+------------------+----------+-----------+----------+------------+
|cod| name | north | south | east | west |
+---+------------------+----------+-----------+----------+------------+
|AQ | Antarctica | 65.08369 | -90.00000 | 34.98050 | -90.57990 |
|BF | Burkina Faso | 15.07060 | 9.43333 | 2.31667 | -5.48333 |
|BR | Brazil | 5.26667 | -33.73694 | 44.46442 | -73.81667 |
|CH | Switzerland | 83.21569 | 45.15000 | 11.06667 | -35.59570 |
|CM | Cameroon | 16.00000 | -41.58988 | 16.13333 | -72.68271 |
|DZ | Algeria | 37.11160 | 18.91635 | 13.00000 | -8.66824 |
|ES | Spain | 43.95000 | 27.63771 | 4.66667 | -18.16667 |
|FR | France | 51.23104 | -11.56667 | 47.36667 | -109.23333 |
|GB | United Kingdom | 64.06667 | 34.56578 | 33.90156 | -13.68333 |
|LC | Saint Lucia | 60.40665 | 13.50000 | 5.00949 | -61.08333 |
|MA | Morocco | 36.61000 | 3.70000 | 2.00000 | -16.82950 |
|ML | Mali | 24.97830 | 10.15000 | 10.35000 | -13.75000 |
|MR | Mauritania | 27.11667 | -19.63525 | 32.08813 | -17.11667 |
|NO | Norway | 71.50000 | 56.15000 | 31.83333 | -13.00000 |
|SJ | Svalbard & Jan.. | 81.00000 | 70.80583 | 34.00000 | -9.07861 |
|TD | Chad | 23.15000 | 7.48333 | 27.13333 | -15.18000 |
|TG | Togo | 11.13333 | 6.10000 | 11.26667 | -0.33333 |
+---+------------------+----------+-----------+----------+------------+
note - i've synthesized my own tables, but this data is based on geonames.
GB, ES, FR, AQ - these I expected, but Saint Lucia? Investigating, I found
Sotra Decca transmitter (geonameId = 7284319), which, googling it,
appears to be on the coast of Norway- an error??
I figured a better approach is to seek huge distances, so this query:
SELECT country.code, country.name, north, south, east, west
FROM country, region_bounding_box
WHERE
country.code = region_bounding_box.code
AND ((north - south) > 80 OR ((east - west) > 70));
produced - dropping the obvious correct countries (US, Russia, France, ..)
+---+-----------------+----------+----------+----------+-----------+
|co | name |north | south | east | west |
+---+-----------------+----------+----------+----------+-----------+
|AQ | Antarctica | 65.08369 | -90.0000 | 34.9805 | -90.5799 |
|BR | Brazil | 5.26667 | -33.7369 | 44.4644 | -73.8166 |
|CM | Cameroon | 16.00000 | -41.5898 | 16.1333 | -72.6827 |
|SB | Solomon Islands | 3.75059 | -12.8833 | 170.2000 | 42.4441 |
|TF | French So. Terr.|-11.50000 | -59.9985 | 138.9913 | 39.7000 |
+---+-----------------+----------+----------+----------+-----------+
(sorry if this text don't align, try dropping it into a lucida-console or
other fixed-width font)
Brazil is odd due to the east-most point, which turns out to be:
Ankokoambo Airport (geonameId = 829929 ..in Madagascar
The next obvious one is what is owned by Antarctica at 65 degrees
latitude??? Answer: Louise Peak (geonameId = 6637194); lat-lon is obviously wrongat 65.083, 63.998.
I could go on (busy).. I don't know if anyone is interested in this info,
I can provide the BB table by request.
/Gorth (vettrasoft.com)
|