Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: filter on v2 24h average #137

Open
AirK57 opened this issue Apr 19, 2020 · 3 comments
Open

API: filter on v2 24h average #137

AirK57 opened this issue Apr 19, 2020 · 3 comments

Comments

@AirK57
Copy link

AirK57 commented Apr 19, 2020

Hi,

I'm looking for a way to get the AQI values via your API for one or for a group of sensors.
I think it's not possible so I'm wondering if I can filter on v2 24h average values? on a particular sensor or all sensors in a 'box'? Because it's a huge file to handle.

Thanks for your help.

@ricki-z
Copy link
Member

ricki-z commented Apr 20, 2020

At the moment there is no filter for the 1h and 24h data files. For each request we have to filter exactly this huge files. And this is creating an huge work load on our servers.

@tommasosansone91
Copy link

@AirK57 I am building an app in Django that is selecting sensors of interest with a custom radius-based filter. I am using the real-time data. You can find the code in this script: https://github.com/tommasosansone91/aqi_luftdaten/blob/master/pm_lookup/processing_2.py

@ricki-z
Copy link
Member

ricki-z commented May 1, 2020

We have done this filtering nearly the same way than you did in your application (the area filter).
But look at all the arithmetic functions needed to calculate the distance and that are executed for every sensor. Its better to calculate the square around the circle and filter by lat, lon first and do all these operations on a much smaller amount of sensors after that.
This may not be much faster for single executions. But with hundreds of requests per minute you can save much compute time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants