title: Most efficient method of pulling in weather data for multiple locations
body: <p>I'm working on a meteor mobile app that displays information about local places of interest and one of the things that I want to show is the weather in each location. I've currently got my locations stored with latlng coordinates and they're searchable by radius. I'd like to use the <a href="http://openweathermap.org/API#weather" rel="nofollow noreferrer">openweathermap api</a> to pull in some useful 'current conditions' information so that when a user looks at an entry they can see basic weather data. Ideally I'd like to limit the number of outgoing requests to keep the pages snappy (and API requests down)</p>
  
  <p>I'm wondering if I can create a server collection of weather data that I update regularly, server-side (hourly?) that my clients then query (perhaps using a mongo $near lookup?) - that way all of my data is being handled within meteor, rather than each client going out to grab the latest data from the API. I don't want to have to iterate through all of the locations in my list and do a separate call out to the api for each as I have approx. 400 locations(!). I'm afraid I'm new to API requests (and meteor itself) so apologies if this is a poorly phrased question.</p>
  
  <p>I'm not entirely sure if this is doable, or if it's even  the best approach - any advice (and links to any useful code snippets!) would be greatly appreciated!</p>
  
  <h1>EDIT / UPDATE!</h1>
  
  <p>OK I haven't managed to get this working yet but I some more useful details on the data!
  If I make a request to the openweather API I can get data back for all of their locations (which I would like to add/update to a collection). I could then do regular lookup, instead of making a client request straight out to them every time a user looks at a location. The JSON data looks like this:</p>
  
  <p><code>
  {
     "message":"accurate",
     "cod":"200",
     "count":50,
     "list":[
        {
           "id":2643076,
           "name":"Marazion",
           "coord":{
              "lon":-5.47505,
              "lat":50.125561
           },
           "main":{
              "temp":292.15,
              "pressure":1016,
              "humidity":68,
              "temp_min":292.15,
              "temp_max":292.15
           },
           "dt":1403707800,
           "wind":{
              "speed":8.7,
              "deg":110,
              "gust":13.9
           },
           "sys":{
              "country":""
           },
           "clouds":{
              "all":75
           },
           "weather":[
              {
                 "id":721,
                 "main":"Haze",
                 "description":"haze",
                 "icon":"50d"
              }
           ]
        }, ...
  </code>
  Ideally I'd like to build my own local 'weather' collection that I can search using mongo's $near (to keep outbound requests down, and speed up), but I don't know if this will be possible because the format that the data comes back in - I think I'd need to structure my location data like this in order to use a geo search:</p>
  
  <p><code>
  "location": {
          "type": "Point",
          "coordinates": [-5.47505,50.125561]
      }
  </code>
  My questions are:</p>
  
  <ol>
  <li>How can I build that collection (I've seen <a href="https://stackoverflow.com/questions/14866363/make-a-http-get-request-to-rest-api-and-convert-to-a-collection">this</a> - could I do something similar and update existing entries in the collection on a regular basis?)</li>
  <li>Does it just need to live on the server, or client too?</li>
  <li>Do I need to manipulate the data in order to get a geo search to work?</li>
  <li><em>Is this even the right way to approach it??</em> </li>
  </ol>
  
  <h1>EDIT/UPDATE2</h1>
  
  <p>Is this question too long/much? It feels like it. Maybe I should split it out.</p>