| Author |
Message |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 14/07/2008 21:33:18
|
p_d_austin
Joined: 14/07/2008 21:29:15
Messages: 2
Offline
|
Is there an XML schema DTD or specification for the XML (JSON, CSV etc.) responses from the GeoNames web service APIs?
Also is there a list of what should be returned in the SHORT, MEDIUM, LONG and FULL styles?
Thanks,
Paul
|
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 16/07/2008 22:18:41
|
marc
Joined: 08/12/2005 07:39:47
Messages: 4501
Offline
|
Hi Paul
I am afraid there is no xml schema or dtd. I guess it would be nice, at the other hand you are the first to ask. Proper documentation for the styles is missing as well.
Marc
|
 |
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 23/08/2008 02:46:29
|
moncul
Joined: 23/08/2008 02:42:22
Messages: 2
Offline
|
How about just documentation describing what gets returned? Eg, when i call search, i get back an entries with fields such as "fcode" and "fcl", what to do these mean? What is possible set of values for each of these?
Thanks.
|
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 25/08/2008 20:44:10
|
gbrits
Joined: 11/03/2008 14:33:50
Messages: 14
Offline
|
fcode and fcl are feature_code and feature_class respectively. These can be used to filter based on the features that you want, where feature_class can be viewed of a category of feature_codes.
Please see http://www.geonames.org/export/codes.html for all feature_codes. (The feature-classes are represented as the headings in green)
Note that feature_codes behave as proper partitions (no feature can have more than 1 feature_code (and no feature can have 0 feature_codes, but I'm not sure that is constraint that is 100% obeyed. It might. )
This means that when, for example, you want to have all cities in a particular country, querying for all features with code PPL doesn't suffice. Best approximation is querying for all featurecodes in class P with the exception of PPLX (which is a section of a city).
cheers,
Geert-Jan
|
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 25/08/2008 23:18:43
|
moncul
Joined: 23/08/2008 02:42:22
Messages: 2
Offline
|
Ok, thanks. So let's say i prompt a user for a "city", and now i want to query geonames for all the possible matching cities (eg, if he enters "paris", there may be many cities around the world that match). I then want to show him this list, so he can choose the correct "paris".
From your comments re: partioning, it sounds like i need to look for a particular set of PPL* feature codes. Eg, PPL, PPLCA, PPLC, but then i start getting lost with things like PPLL or PPLS. Should i include these last 2, or ?
|
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 25/08/2008 23:41:17
|
gbrits
Joined: 11/03/2008 14:33:50
Messages: 14
Offline
|
indeed. Quering for all feature_codes under class P except PPLX yield good results for me.
It's all a question of wether recall (coverage) vs precision matters most to you. Particularly although the geonames-database is good, you can't count on it that all small towns / burroughs / municipalities / what-ever-you call it are classified 100% correctly.
Remember, you will likely want to sort your results (think population, for instance and/or PPLA before PPL ) so results at the bottom won't matter that much. Sorting on population gives the additional benefit that:
a - in general people will request for the biggest place given a certain name. (If not, use filters like administrative divisions to narrow that down: ADMx)
b - cities with a large population in generally a lot more stable over time.
If you want to do all this on a live website / server, you're better of importing a dump of the geonames-data. This will require a bit more work, but it gives you far better quering performance (obviously). (and you can do sort on population, etc, since this is available in the dump and not directly in the search-service if I'm not mistaken.
Hope that helps,
Geert-Jan
|
|
|
 |
|
|