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 Boolean on a Parameter Basis  XML
Forum Index -> General
Author Message
petermetzger



Joined: 04/08/2010 01:17:44
Messages: 3
Offline

Hi,

I'm stumped as to how I can accomplish the following.

Using the general "http://ws.geonames.org/searchJSON", I need to run a standard query, returning only results that match the adminCode1 value of "WI" or "MN".

So far, I can get results for one state at a time, but not both. I tried setting the operator parameter to "OR", however, this returns oodles of results that don't pertain to the original query.

Therefore, a query for "Rice" with the country parameter set to "US" should return only results from Wisconsin and Minnesota.

Any advice?

Thanks in advance,
Peter
geotree


[Avatar]
Joined: 23/07/2007 18:28:40
Messages: 138
Location: France
Offline

There is no way to get "MN or WI" in a single query.

You may perform a full US query then filter the results to keep only MN and WI :
http://ws.geonames.org/searchJSON?country=US&q=Rice&fcode=PPL

or perform 2 queries then merge results :
http://ws.geonames.org/searchJSON?country=US&q=Rice&fcode=PPL&adminCode1=WI
http://ws.geonames.org/searchJSON?country=US&q=Rice&fcode=PPL&adminCode1=MN

Christophe
geotree.geonames.org
geotree.geonames.org/geotree.html
[WWW]
marc



Joined: 08/12/2005 07:39:47
Messages: 4501
Offline

I will put it in the 'nice-to-have' folder, maybe we have someday time to implement it.

Best

Marc

[WWW]
petermetzger



Joined: 04/08/2010 01:17:44
Messages: 3
Offline

That'd be great! It's not a huge deal doing some of the filtration on my end, but it'd definitely be convenient to have implemented on the server-side.

Thanks again,
Peter
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team