Opened 8 years ago

Closed 7 years ago

#6130 closed defect (fixed)

The countries' list in CountryInfo.cpp is not complete

Reported by: sirop Owned by: chiiph
Priority: Medium Milestone: Vidalia: 0.3.x
Component: Archived/Vidalia Version: Vidalia: 0.3.2-alpha
Severity: Keywords: geoip, countries' list
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

If one compares the countries' list in CountryInfo.cpp and geoip file, one sees that at least some island states are missing in CountryInfo.cpp .
For example,

db.insert("dk", QT_TR_NOOP("Denmark"));

is in CountryInfo.cpp , but not Faroe Islands which belong to Denmark
but have different IP ranges https://www.countryipblocks.net/country_range_aggregate.php .

Child Tickets

Change History (3)

comment:1 Changed 7 years ago by sirop

wget http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip
awk -F, '{print tolower($5), $6}' GeoIPCountryWhois.csv | sort | uniq > geoip_uniq

Compare country-coordinates.csv and GeoIPCountryWhois.csv:

awk -F, '{print "\""$1"\"" }' country-coordinates.csv | sort | uniq > c1
awk -F, '{print tolower($5) }' GeoIPCountryWhois.csv | sort | uniq > c2
diff c1 c2 > diffc1c2

http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains

"a1" "Anonymous Proxy"

"a2" "Satellite Provider"

"ap" "Asia/Pacific Region"

"bl" "Saint Barthelemy"

< "cs" Czecho-Slovakia domain has not been use since 1993. The ISO-code cs was later allocated

for Serbia and Montenegro, which used .yu instead.

"eu" "European Union" , "Europe"

< "fx" As I found, it means French exterretorial, but is not used; we do not have "fx" in GeoIPCountryWhois.csv .

< "mf" "Saint Martin" , ok, http://en.wikipedia.org/wiki/ISO_3166-2:MF

< "su" Soviet Union , no correspondence in GeoIPCountryWhois.csv

"tl" "Timor-Leste"

< "tp" Before it became independent from Indonesia in 2002, East Timor was officially assigned the ISO 3166-1 alpha-2 code TP.

< "yu" Yougoslavia, no correspondence in GeoIPCountryWhois.csv

< "zr" .zr is the former Internet country code top-level domain (ccTLD) for Zaire. Because Zaire was renamed Democratic Republic of the Congo in 1997, .zr was phased out

and .cd took its place. In 2001, .zr was finally terminated.

So really questionable things are:

"a1" "Anonymous Proxy"

"a2" "Satellite Provider"

"ap" "Asia/Pacific Region"

"eu" "European Union"

as I do not know how to assign geographic coordinates to them.

We'll also need more flags, maybe, these: http://www.famfamfam.com/lab/icons/flags/ .

comment:2 in reply to:  description Changed 7 years ago by sirop

Status: newneeds_review

Have to correct some awk commands, that's why once more:

wget http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip
awk -F"\",\"" '{print "\""tolower($5)"\" \""  $6}' GeoIPCountryWhois.csv | sort | uniq > geoip_uniq

Compare country-coordinates.csv and GeoIPCountryWhois.csv

awk -F, '{print "\""$1"\"" }' country-coordinates.csv | sort | uniq > c1
awk -F, '{print tolower($5) }' GeoIPCountryWhois.csv | sort | uniq > c2
diff c1 c2 > diffc1c2

http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains

"a1" "Anonymous Proxy"

"a2" "Satellite Provider"

"ap" "Asia/Pacific Region"

"bl" "Saint Barthelemy"

< "cs" Czecho-Slovakia domain has not been use since 1993. The ISO-code cs was later allocated

for Serbia and Montenegro, which used .yu instead.

"eu" "European Union" , "Europe"

< "fx" As I found, it means French exterretorial, but is not used; we do not have "fx" in GeoIPCountryWhois.csv .

< "mf" "Saint Martin" , ok, http://en.wikipedia.org/wiki/ISO_3166-2:MF

< "su" Soviet Union , no correspondence in GeoIPCountryWhois.csv

"tl" "Timor-Leste"

< "tp" Before it became independent from Indonesia in 2002, East Timor was officially assigned the ISO 3166-1 alpha-2 code TP.

< "yu" Yougoslavia, no correspondence in GeoIPCountryWhois.csv

< "zr" .zr is the former Internet country code top-level domain (ccTLD) for Zaire. Because Zaire was renamed Democratic Republic of the Congo in 1997, .zr was phased out

and .cd took its place. In 2001, .zr was finally terminated.

So really questionable things are:

"a1" "Anonymous Proxy"

"a2" "Satellite Provider"

"ap" "Asia/Pacific Region"

"eu" "European Union"

as I do not know how to assign geographic coordinates to them.

We'll also need more flags, maybe, these: http://www.famfamfam.com/lab/icons/flags/ .

Edit country-coordinates.csv

awk -F, '{print "\""$1"\"" }' country-coordinates.csv | sort | uniq > c1
awk -F, '{print tolower($5) }' GeoIPCountryWhois.csv | sort | uniq > c2
diff c1 c2 > diffc1c2_2

0a1,2

"a1"
"a2"

9a12

"ap"

68a72

"eu"

Only these 4 abbreviations will be shown as "unknown".

Edit CountryInfo.cpp

awk -F"\" \"" '{print "    db.insert("$1"\", QT_TR_NOOP(\""$2"));"}' geoip_uniq > CountryInfo_edit

Download http://joomlacode.org/gf/download/frsrelease/11986/48430/phoca_flag_icons_22-14.zip
License: Public Domain

mkdir flags
cd flags
ls  | sed -e 's/\.[a-z]\{3\}$//' > flags
awk  '{print "\""$1"\""}' flags > flags2
diff ../c2 flags2 > diff_flags2_c2
rm catalonia.png
rm england.png
rm galicia.png
rm scotland.png
rm wales.png
rm cs.png
rm nc2.png
cp fr.png bl.png

"aq" "Antarctica" flag is missing.
Download http://upload.wikimedia.org/wikipedia/commons/thumb/6/68/Flag_of_the_Antarctic_Treaty.svg/200px-Flag_of_the_Antarctic_Treaty.svg.png

for i in *.png; do convert $i  -bordercolor Black -border 1x1  $i ; done
for i in *.png; do convert $i -geometry 18x12!   $i ; done

https://github.com/sirop/vidalia_0.3.2_alpha/commit/78b41ae72374a8d386183217561ed50e64b17e6b

country-coordinates.csv had a double space before every LF,
i cleaned out the double spaces.

comment:3 Changed 7 years ago by chiiph

Resolution: fixed
Status: needs_reviewclosed

Awesome work! Merged.

Note: See TracTickets for help on using tickets.