And a follow-up to my last post: the population density and customary proximity APIs are now available in Gaze. The additional APIs are:
- get_population_density
- Parameters:
- lat
- WGS84 latitude, in decimal degrees
- lon
- WGS84 longitude, in decimal degrees
Return an estimate of the population density at (lat, lon), in persons per square kilometer, as a decimal number followed by a line feed.
- get_radius_containing_population
- Parameters:
- lat
- WGS84 latitude, in decimal degrees
- lon
- WGS84 longitude, in decimal degrees
- number
- number of persons
- maximum
- largest radius returned, in kilometers; optional; default 150
Return an estimate of the smallest radius around (lat, lon) containing at least number persons, or maximum, if that value is smaller, as a decimal number followed by a line feed.
For instance,
- http://gaze.mysociety.org/gaze-rest?f=get_population_density;lat=51.53;lon=-0.1020 gives the population density of Islington in London (about 8,000 persons/km2)
- http://gaze.mysociety.org/gaze-rest?f=get_radius_containing_population;lat=51.53;lon=-0.1020;number=200000 returns the radius of a circle around that point containing 200,000 people (about 2.7km)
- http://gaze.mysociety.org/gaze-rest?f=get_radius_containing_population;lat=43.09;lon=-95.54;number=200000 the same, for a point near Cylinder, Iowa, USA (about 74km)
Enjoy! Questions and comments to chris@mysociety.org, please.
Are you using CIESIN or LandScan data for the population density?
CIESIN (more here); in many ways the Landscan data would be better (because they have better resolution in places where GPW’s is poor), but I believe that the licence terms for Landscan would prohibit our using it (I’ve asked ORNL whether this interpretation is correct, but haven’t yet received a response).
are there any libraries for accessing the API. would you like us to write one?
many thanks for this great service
There aren’t any libraries, but you’re welcome to write one if you think it’ll help. Gaze only uses very simple URL based queries, which most languages these days support out the box, so it only needs something very light for an API. One function call would probably do.
can i get nearby locations like schools, restaurants, hospitals etc from this web services ? and how ?
Actually i have tried “find_places” function but its not give result.