Author |
Message |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 13/03/2008 19:27:00
|
occ
Joined: 02/03/2007 19:47:24
Messages: 4
Offline
|
I am working on an application that provides latitude, longitude, and timezone for users based on their input of country, state/province and city. I recently tried country_code='us' and admin1_code='pa' and ansiname='Chestnut Hill' and mysql returns 8 records with different latitudes and longitudes. 1 out of 8 records has a different timezone. Why are there multiple records? If I want to provide the users with only 1 answer, will averaging the latitudes and longitudes of those 8 records make sense?
I found a listing of feature_code in the forum, but how about feature_class? What does 'P' versus 'A' feature_class mean?
Thanks a lot.
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 14/03/2008 07:04:09
|
marc
Joined: 08/12/2005 07:39:47
Messages: 4499
Offline
|
'P' means city or village and 'A' means administrative division like 'states' or 'counties' in the US : http://www.geonames.org/export/codes.html
'Chestnut Hill' seems to be a very common name for places in Pennsylvania. This is the reason you find several entries. Place names are not unique and they even occur more frequently in the same areas.
Marc
|
 |
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 14/03/2008 13:59:48
|
occ
Joined: 02/03/2007 19:47:24
Messages: 4
Offline
|
Hi Marc,
Thank you very much for the info.
So you're saying it could be that there is a city, borough, village of Chestnut Hill, etc. and all are listed in geonames as 'Chestnut Hill' and they all have 'P' and 'PPL' codes?
For our purpose, is there a way to locate the city of Chestnut Hill? I believe when we extracted the data from geonames, we only imported admin1_code. I noticed that the admin2 code is for counties. Will admin3 or admin4 give us what we need?
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 15/03/2008 10:58:14
|
marc
Joined: 08/12/2005 07:39:47
Messages: 4499
Offline
|
Hi occ
admin3 and admin4 are not filled for the US in our database. I don't know your 'Chestnut Hill' and which one you are referring to. If you only care about larger populated places you could look at the population and forget all small villages and places without population. (make sure to keep PPLC and PPLA in any case, even if their is no population information).
Marc
|
 |
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 18/03/2008 02:24:01
|
occ
Joined: 02/03/2007 19:47:24
Messages: 4
Offline
|
Thanks for the advice.
I'm going to extract the data again into our database and see whether admin2 and population is going to give us what we need. I assume I need the admin2Code.txt file to load a lookup table for geonames' admin2 column. Is there a schema for admin2Code.txt? I can't find it in "Importing all geonames tables to mysql"
occ
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 18/03/2008 07:25:58
|
marc
Joined: 08/12/2005 07:39:47
Messages: 4499
Offline
|
the file admin2Codes.txt has the Format :
concatenated codes
name
asciiname
geonameId
Marc
|
 |
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 19/03/2008 13:37:05
|
occ
Joined: 02/03/2007 19:47:24
Messages: 4
Offline
|
Marc,
Many thanks. Admin2 is able to distinguish the cities in different counties and that's what we need.
One more question, since we're going to provide only lookup for cities/towns for our users, we plan to eliminate all records with feature_class that are not 'P' nor 'A'. I was checking the data and found > 134000 records with feature_class being blank. Most of them are in the US. What are these?
occ
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 19/03/2008 21:16:36
|
marc
Joined: 08/12/2005 07:39:47
Messages: 4499
Offline
|
they are null because we don't know what type of feature it is.
|
 |
|
 |
|