GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
how get a simple list of cities inside a US State with the dump files?  XML
Forum Index -> General
Author Message
skoub



Joined: 06/03/2013 17:34:47
Messages: 2
Offline

hi everyone!

i have imported the allCountries.txt. My website will have a form to enter the address of the user worldwide.

get the full list of Countries:
select * from allCountries where feature_code = 'PCLI'

get the full list of states/provinces inside a country, for example USA:
select * from allCountries where feature_code = 'ADM1' and country_code = 'US'
i have tested this query for Canada and USA. Don't know if it will always work for the other countries

get the full list of cities inside a state/province, for example New York / USA
select * from allCountries where feature_code = 'PPL' and country_code = 'US' and admin1code = 'NY'
this is where i don't know where to get only the cities inside a state. I get too much elements with that query.

i get Abbotts, Abell Corners, Abenaki Mobile Home Park, etc... but if i compare it to the officiel list from Wikipedia http://en.wikipedia.org/wiki/List_of_cities_in_New_York, these cities doesnt exist. Also, i'm supposed to see Albany, Auburn but i dont get them with the query.

So my question is, how can i select only the real official cities?
marc



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

With the restriction to PPL you miss all seats of administrative divisions.

GeoNames is a global gazetteer. If you need very specific type of features that only exist in one country then you will need to look for a country specific source.

Best Regards

Marc

[WWW]
skoub



Joined: 06/03/2013 17:34:47
Messages: 2
Offline

Maybe i just don't understand all the structure of the data with the PPL thing yet

So there's no way i can just grab the official cities of an admin division?

If we have admin1 = state, should we have admin2 = cities?

Alex
marc



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

admin2 are counties in the US.

Marc

[WWW]
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team