GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Data missing in allCountries.zip ?  XML
Forum Index -> General
Author Message
Lyrae



Joined: 24/04/2018 17:43:39
Messages: 3
Offline

Hello,

As I was working on the database, I realised that I could not find "Tokyo" nor "Kyoto" in allCountries.zip.

I iterated through all the file comparing the names and I could not find an entity where "Tokyo" is a "capital of a political entity" nor where "Kyoto" is a "seat of a first-order administrative division".

I also tried by comparing the geonameid (Tokyo: 850147, Kyoto: 1857910), and it appears that they are not in the file.
So I counted all the geonameid and found that 1,185,6530 geonameid are not in it.

Am i missing something ?

Thanks for your help !
marc



Joined: 08/12/2005 07:39:47
Messages: 4056
Offline

Hi Lyrae

I guess you have troubles with unzipping or analyzing the file.

What strikes me is that you know the exact number of missing features. How can this be when you don't have the full file?

Best Regards

Marc

[WWW]
Lyrae



Joined: 24/04/2018 17:43:39
Messages: 3
Offline

Hello marc,

You are right, I grep the file and I found Tokyo and Kyoto in it.
I should have thought of it before...

So it appears my python script has troubles reading the file and skip lines for some reason.

Thank you !
Lyrae



Joined: 24/04/2018 17:43:39
Messages: 3
Offline

I found the solution:

for those using python module 'csv' to read the file, make sure you use it like this :
Code:
spamreader = csv.reader(csvfile, delimiter='\t')

and not like this:
Code:
spamreader = csv.reader(csvfile, delimiter='\t', quotechar='|')

Also you will need to add this line atfer the import:
Code:
csv.field_size_limit(sys.maxsize)


Best,
Lyrae
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team