Database Reference
In-Depth Information
$ source postgis-cb-env/bin/activate
4. Once activated, if you still haven't done it, you have to install the Python
GDAL and simplejson packages needed for this recipe:
(postgis-cb-env)$ pip install gdal
(postgis-cb-env)$ pip install simplejson
How to do it...
Carry out the following steps:
1. FirsttestthewebserviceanditsJSONoutputyourselfwiththefollowingre-
quest (change the q and username parameters as you wish):
http://api.geonames.org/wikipedi-
aSearchJSON?formatted=true&q=london&maxRows=10&username=postgis&style=full
You should getthe followingJSON output:
{"geonames": [{"summary": "London Bridge
railway station is a central London
railway terminus and London Underground
complex in the London Borough of
Southwark, occupying a large area on two
levels immediately south-east of London
Bridge and 1.6 miles (2.6 km) east of
Charing Cross (...)","rank": 100,"title":
"London Bridge station","wikipediaUrl":
"en.wikipedia.org/wiki/
London_Bridge_station","elevation":
18,"countryCode": "GB","lng":
-0.0866,"feature":
"railwaystation","thumbnailImg":
"http://www.geonames.org/img/wikipedia/
115000/thumb-114758-100.jpg",
"lang": "en","lat":
 
 
Search WWH ::




Custom Search