Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

The people on this site have been wonderful in helping me query a list of the worlds parks with something like this query:

http://api.geonames.org/search?featureCode=PRK&maxRows=10&username=demo

It was great to get that, but is it possible to query for the type of park it is (county/national/state/city) or also to break it down by state and country, or just query within one country?

Is that asking too much or is that possible to do with that API? How could I get those values? And how do I get the total number of parks they have?

Thanks very much!

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

The API supports querying by country by adding the country parameter, which accepts an ISO-3166 formatted name, e.g.

http://api.geonames.org/search?featureCode=PRK&maxRows=10&username=demo&country=US

You can similarly restrict it by state by using adminCode{1-3}, where that data is available. For the 'type' of park you'll likely hit semantic issues: the distinctions you listed hold for the US, but how parks are divided up isn't done consistently between countries, and what defines a park may vary greatly. You can probably figure it out fairly quickly without going too far down the semantics path, I'd start with passing style=full to the end of your query which will give you many additional fields, this in conjunction with Wikipedia top-level 'List of parks in ...' queries should get you pretty far along.

share|improve this answer
    
@scw Thank you. I think what is most confusing is that lets say I want to query by each country code....I don't know what the codes are :) And even in the query you gave me, there is a parameter called fcl - what is that? :) –  Genadinik May 17 '11 at 4:10
    
@scw Oh that style=full hit the spot :) ...was looking for that kind of info!! :) –  Genadinik May 17 '11 at 4:11
    
@scw also, is it possible to know how many results there are total, and how many would crash the server? –  Genadinik May 17 '11 at 4:15
    
I think we're getting a bit out of the spatial questioning area and into specific questions relating to the nature of the Geonames API -- you may want to poke around at the forum as that's a community dedicated to just that one resource: forum.geonames.org The 'totalResultsCount' attribute gives the count, if you're going to be heavily using the service you may want to just download a copy of the data, but the geonames folks would know best. –  scw May 17 '11 at 4:21
    
Yes, once again, thank you very much. You really helped me out and saved me countless hours of time!! :) –  Genadinik May 17 '11 at 5:07
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.