| Author |
Message |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 07/03/2013 06:48:56
|
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?
|
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 08/03/2013 15:45:15
|
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
|
 |
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 08/03/2013 22:07:14
|
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
|
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 28/04/2013 07:52:07
|
marc
Joined: 08/12/2005 07:39:47
Messages: 4501
Offline
|
admin2 are counties in the US.
Marc
|
 |
|
|
 |
|
|