| Author |
Message |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 03/07/2012 06:17:36
|
mike.cbi
Joined: 27/06/2012 21:19:37
Messages: 4
Offline
|
I'm trying to understand some results that I'm getting back from the searchJSON endpoint.
When using name and searching for 'corvallis', I get multiple results including the city of Corvallis, Oregon. However, if I search with a name of 'corvallis, oregon', I get 0 results (URLs below).
If I switch to using 'portland,oregon', I can get results using name.
When I use q instead of name as the query parameter, I can then get results with 'corvallis, oregon'.
Can someone help me understand these results? Is it a bug, just a quirk of these particular cities, or a complete lack of understanding on my part?
Thanks,
Mike
URLs used (used demo user her for example purposes):
returns multiple results including the firste for corvallis, oregon: http://api.geonames.org/searchJSON?name=corvallis&username=demo
returns zero results: http://api.geonames.org/searchJSON?name=corvallis%2Coregon&username=demo
returns multiple results: http://api.geonames.org/searchJSON?q=corvallis%2Coregon&username=demo
|
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 03/07/2012 06:19:38
|
marc
Joined: 08/12/2005 07:39:47
Messages: 4501
Offline
|
the 'name' parameter only searches on the name of the location. Oregon is not part of the name, but the state. The 'q' parameter searches on all attributes (country, state, county, etc).
Marc
|
 |
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 04/07/2012 06:05:16
|
mike.cbi
Joined: 27/06/2012 21:19:37
Messages: 4
Offline
|
Marc,
That's kind of what I thought, but then it doesn't make sense that 'Portland,Oregon' returns the entry for Portland. The entry for that doesn't have Oregon in the name, either.
Why does 'portland,oregon' act differently than 'corvallis,oregon'? Both of these city names have cities in other states (portland,maine and corvallis,montana).
Thanks,
Mike
|
|
|
 |
![[Post New]](/gforum/templates/default/images/icon_minipost_new.gif) 04/07/2012 06:39:51
|
marc
Joined: 08/12/2005 07:39:47
Messages: 4501
Offline
|
Hi Mike
Portland has a Norwegian translation "Portland i Oregon". This is the altername name you find with your query for "Portland,Oregon".
Best Regards
Marc
|
 |
|
|
 |
|
|
|
|