GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Missing cities after import - anyone else see this?  XML
Forum Index -> FAQ - frequently asked questions
Author Message
peppy



Joined: 18/06/2016 22:31:11
Messages: 2
Offline

Greetings,

I downloaded and unziped the allCountries.txt file to my server today. I have a PHP script that opens and runs through the file for a few minutes and saves data to mysql. It seems to be importing fine because there are about 10 million rows stored in the database when it is finished.

I did a couple of test searches on the "name" column and could not find "Seattle" (for the city of Seattle Washington) - which is supposed to be in the database: http://www.geonames.org/5809844/seattle.html - or another search for a small city like Tomahawk, KY (Tomahawk in Kentucky). It shows the city of Tomahawk in other states, but not KY, which supposedly is in the database: http://www.geonames.org/4311038/tomahawk.html .

Please note that I did not store the "asciiname" or "alternatenames" columns. Is there a reason why a major city like "Seattle" would not show up in the "name" column?

Is this a bug, or am I doing something wrong?

Thanks
Kind regards
CrazyCat


[Avatar]

Joined: 11/06/2016 13:32:08
Messages: 4
Offline

No trouble for me,
Code:
sqlite> select * from geonames where name = 'Seattle';
 5809844|Seattle|Seattle|Gorad Siehtl,SEA,Seatl,Seattle,Seattlum,Siatl,Siatul,Siehtl,Sietl,Sietla,Sietlas,Sijetl,Siyaatil,Séatl,ciyattil,shiatoru,si'aitala,siaeteul,sietʼli,siyatal,siyatala,syatl,xi ya tu,Σιάτλ,Горад Сіэтл,Сиатъл,Сиетл,Сиэтл,Сијетл,Сієтл,Սիեթլ,סיאטל,سياتل,سیئٹل,سیاتل,سیاٹل,सिअ‍ॅटल,सीऐटल,সিয়াটল,சியாட்டில்,ಸಿಯಾಟಲ್,ซีแอตเทิล,სიეტლი,ስያትል,ស៊ីតថល,シアトル,西雅圖,시애틀|47.60621|-122.33207|P|PPLA2|US||WA|033|||608660|56|56|America/Los_Angeles|2014-10-27
 
 sqlite> select * from geonames where name = 'Tomahawk';
 4133678|Tomahawk|Tomahawk||36.06063|-92.70655|P|PPL|US||AR|129|||0|301|302|America/Chicago|2010-09-05
 4226771|Tomahawk|Tomahawk||34.11538|-84.41354|P|PPL|US||GA|057|||0|281|295|America/New_York|2006-01-15
 4311038|Tomahawk|Tomahawk||37.86871|-82.5971|P|PPL|US||KY|159|||0|204|215|America/New_York|2006-01-15
 4495230|Tomahawk|Tomahawk||34.71128|-78.3275|P|PPL|US||NC|163|||0|30|31|America/New_York|2006-01-15
 4824824|Tomahawk|Tomahawk||39.53037|-78.04695|P|PPL|US||WV|003|||0|143|141|America/New_York|2006-01-15
 5769789|Tomahawk|Tomahawk||44.21193|-103.52852|P|PPL|US||SD|081|||0|1470|1475|America/Denver|2006-01-15
 10177450|Tomahawk|Tomahawk||-40.86699|147.75603|P|PPL|AU||06|61810|||0||12|Australia/Hobart|2015-04-07
 5275884|Tomahawk|Tomahawk|Tomakhavk,tamhawk  wyskansyn,twmahwk,Томахавк,تامهاوک، ویسکانسین,توماهوك|45.47108|-89.72986|P|PPL|US||WI|069|||3397|442|443|America/Chicago|2011-05-14

I think you have a trouble with your import, peharps because of persian, chinese, arabian, ... characters
peppy



Joined: 18/06/2016 22:31:11
Messages: 2
Offline

Nevermind, I was able to figure it out. Apparently there is a difference between fgets and fgetcsv when iterating through a txt file in php, which is something I've never seen before.
CrazyCat


[Avatar]

Joined: 11/06/2016 13:32:08
Messages: 4
Offline

Really strange, I never seen any difference.
Maybe it's the way you loop, or the enclosure you use which may cause this trouble.
 
Forum Index -> FAQ - frequently asked questions
Go to:   
Powered by JForum 2.1.5 © JForum Team