sensebox / openSenseMap-API

API for opensensemap.org
https://docs.opensensemap.org/
MIT License
48 stars 42 forks source link

opensensemap interpolation: color setting and setable measuring range #203

Open johannesmutter95 opened 4 years ago

johannesmutter95 commented 4 years ago

silvestermessung2019

  1. How can I change the displayed colours in the interpolation?

I would like to be able to have stronger colours for the air quality measurements above In my interpolatin of silvester night in Munich values with 400 microgramm per m^3 are still green which is already a health concerning value (breathed for longer period of time)

  1. How is it possible to set the measuring range in the interpolation?

As the range of my measurement is from 7 microgramm to 1400 microgramm but 1400 is just a outlier measurement which needs to be taken account of but, not relevant to set the measurement range of the Interpolation.
measurement range from 0 to 900 would be perfect and be a much better visualization.

Java script code of interpolation is found here: https://github.com/sensebox/openSenseMap-API/blob/master/packages/api/lib/transformers/idwTransformer.js

ubergesundheit commented 4 years ago

The visualization of the interpolation is happening in the front end (could be here: https://github.com/sensebox/openSenseMap/blob/master/app/scripts/controllers/sidebar.interpolation.js Check Line 78. It defines the colors used)

Excluding stations is not supported right now. Check out the statisticsController. The descriptive statistics endpoint has the boxId parameter. It should be possible to implement the same for the idw (interpolation) endpoint.

Feel free to try to implement this in a pull request :)