How to do it...

Carry out the following steps:

  1. In this recipe, as with the previous one, you will use a http://openweathermap.org/ web service to get the temperature for a point from the closest weather station. The request you need to run (test it in a browser) is http://api.openweathermap.org/data/2.5/find?lat=55&lon=37&cnt=10&appid=YOURKEY.
  2. You should get the following JSON output (the closest weather station's data from which you will read the temperature to the point, with the coordinates of the given longitude and latitude):
        {          message: "",          cod: "200",          calctime: "",          cnt: 1,          list: [            {              id: 9191,              dt: 1369343192,              name: "100704-1",              type: 2,              coord: {                lat: 13.7408,                lon: 100.5478              },              distance: 6.244,              main: {                temp: 300.37              },              wind: { speed: ...

Get PostGIS Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.