Project

General

Profile

Feature #1471

Location to hardiness zone function

Added by Franz Gatzke over 2 years ago. Updated almost 2 years ago.

Status:
Reviewed
Priority:
Normal
Assignee:
Start date:
03/05/2018
Due date:
% Done:

10%

Estimated time:
Motivation:

The main purpose is that the UX is: setup location --> here this plants grow in your location.


Description

From practical plants, we have plants associated with Hardiness Zone .
Now we need a function/module that gets from
(lat, lon) -> Hardiness Zone

A Quick research only brought me maps about US and not much more, but it should be quite easy to calculate that with historical weather data.

First Idea: Easiest way, but maybe not the nicest solution would be to grid the world into A x A (e.g. A could be 50km) ask an open API for weather data of the specific coordinates from the last 50 years (ethically, by not asking to often) and then calculate the average minimum temperature of this point.

We found ftp://ftp.ncdc.noaa.gov/pub/data/noaa/ for historical weather data. We can use this data for non-commercial use. First we need a script for going over the data (per file should be 365/364) entries - which is per weather station. The fields are explained here: ftp://ftp.ncdc.noaa.gov/pub/data/gsod/readme.txt

1. Get the files of the last 50 years. Go over the files find the minimum temperature for each station, per year. Calculate the average minimum temperature. Keep the file general enough to change the time span, and maybe easily change it to for example average maximum temperature or average strongest winds etc.

2. Next step would be to calculate the station identifier to Geo Coordinates - we found something previously, not sure where documented: ftp://ftp.ncdc.noaa.gov/pub/data/noaa/isd-history.txt

3. Function for finding nearest weather stations for Geo coordinates.

4. take altitude into (get altitude of geocoordinates) account (my weather knowledge -1° degree per +100m)

5. write api which takes geolocation and replies minimum average temperature of that location (keep general for)

6. a plus would be a nice layered map preferably on OSM for hardiness zones (this service would be public and used to make pr for pp)


Recurrences


Related issues

Related to powerplant - Feature #1120: Weather APIClosed2017-08-30

Related to powerplant - Feature #1624: Publish Next ReleaseClosed2018-08-06

History

#1 Updated by Franz Gatzke over 2 years ago

#2 Updated by Franz Gatzke over 2 years ago

  • Motivation updated (diff)

#3 Updated by Franz Gatzke over 2 years ago

  • Description updated (diff)
  • Status changed from Draft to Reviewed
  • Assignee set to Erin Grasmick
  • % Done changed from 0 to 10

#4 Updated by Franz Gatzke over 2 years ago

  • Description updated (diff)

#5 Updated by Franz Gatzke over 2 years ago

  • Description updated (diff)

#6 Updated by Erin Grasmick over 2 years ago

Update:

1. Get the files of the last 50 years. Go over the files find the minimum temperature for each station, per year. Calculate the average minimum temperature. Keep the file general enough to change the time span, and maybe easily change it to for example average maximum temperature or average strongest winds etc.

This is done.

2. Next step would be to calculate the station identifier to Geo Coordinates - we found something previously, not sure where documented: ftp://ftp.ncdc.noaa.gov/pub/data/noaa/isd-history.txt

This is done also; I currently have both LAT/LON for each station as well as a geohash string.

3. Function for finding nearest weather stations for Geo coordinates.

This will be handled by MongoDB's "geoNear()" method. I will work on putting this data into MongoDB.

4. take altitude into (get altitude of geocoordinates) account (my weather knowledge -1° degree per +100m)

TODO.

5. write api which takes geolocation and replies minimum average temperature of that location (keep general for)

TODO.

6. a plus would be a nice layered map preferably on OSM for hardiness zones (this service would be public and used to make pr for pp)

In the works; currently working on a timelapse based on the geoloop plugin for grafana. This allows real-time updating of the NOAA data and the ability to 'play' the map like a timelapse of historical data. OSM would be great but isn't really built for time-series data. The geoloop plugin uses Mapbox and open source GeoJSON files of the world's countries.
Status: 70% complete

#7 Updated by Franz Gatzke almost 2 years ago

#8 Updated by Erin Grasmick almost 2 years ago

Update:

4. take altitude into (get altitude of geocoordinates) account (my weather knowledge -1° degree per +100m)

This is done.

5. write api which takes geolocation and replies minimum average temperature of that location

Still TODO.

6. a plus would be a nice layered map preferably on OSM for hardiness zones (this service would be public and used to make pr for pp)

This has been changed to using an OpenStreetMap layer as suggested in the ticket due to limitations encountered by the performance of geoloop for Grafana when using large datasets. While this will be more difficult to animate (as OSM doesn't really support any timelapse features), I can make it work by pre-rendering layers and using a normal webpage slider to accomplish a timelapse.
Status: ??% complete, getting the correct geometry is hard to nail down.

Attached is a screenshot generating using random sample data.

Also available in: Atom PDF