GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Using city,state in search - understanding results  XML
Forum Index -> General
Author Message
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


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

[WWW]
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
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

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