Comments (7)
starting here (think this link might work)
https://connectedhumber.slack.com/archives/CGAEG1G5T/p1556111115009800
from air-quality-web.
Ahhh, I see what you mean - though it took me several re-reads. That is a very awkward bug to fix - I'll have to think about it.
For reference, the bug in question is that if multiple sensors have the same location and report the same reading, the heatmap adds the readings together, instead of averaging them.
The solution here is not exactly straight-forward. We can comb through the settings that Heatmap.js provides, but it's probably that there won't be anything that does the trick. To this end, we have a few options:
- Open an issue against Heatmap.js to ask for an option
- We may end up having to completely re-implement this ourselves, which will require some serious effort. If this is the case, I'll probably derive the solution from my Masters project, which I'll be doing soon. The timescale for a fix here would be in ~September time.
Either way, I'd like to ponder over this for a while.
Also, just a note: When reporting issues, please report them on here first instead of mentioning them in the Slack chat. This serves as a point of reference where it won't get lost and I can easily refer back to it.
from air-quality-web.
from air-quality-web.
I've been having a little think about this. I think the solution is going to be very awkward and messy.
One solution I'm toying with at the moment is to pre-render the map on the server-side. I'll (probably) be doing this for my summer project, so I can port the code for that once I'm done.
Another would be to write a custom overlay, but that sounds like a lot of work, and I don't really know how to start that. I'd have to research it some more.
Either way, I think my summer project will shed some light on this, so I'll keep this project in mind as I work on that.
from air-quality-web.
Suddenly, an idea! We could use a voronoi diagram + https://dynmeth.github.io/RaphaelLayer/
from air-quality-web.
I need help to understand enough to comment....maybe you can explain at the meeting this evening?
from air-quality-web.
Hey, @robinharris! Sorry I didn't see this before the meeting.
Basically, with the current heatmap, when more than 1 device is located in the same place on the map, the heatmap adds the 2 values together to get the final value that's used to render the heatmap on your screen.
What we actually want is an average, as more than 1 device in the same location should serve to improve the accuracy of the existing reading, instead of add to existing readings.
Under the current system, if you've got enough devices in the same place, PM2.5 will always show as purple - even if each device individually is reporting a low value.
In addition, the heatmap tails off at the edges as it gets further and further away from the device marker itself. This is also incorrect, as if we don't have a sensor somewhere it doesn't mean that there isn't any pollution there - it simply means we have no data for that location. In reality, we want it to interpolate between 2 device markers to determine the correct colour to show on the heatmap.
Currently, I'm considering using a library called Raphael.js to render arbitrary shapes onto an overlay on to of the map. Ive got multiple ways I could use this to generate the kind of map overlay we're after.
- We could generate a voronoi diagram as I've talked about in #31.
- We could render squares and interpolate the value based on the value of the closest 3 devices.
We'll have to measure the performance of these approaches carefully to avoid issues.
For either approach, a quadtree would probably go a long way to improving lookup times - and many high-performance implementations exist already that we can take advantage of.
For approach 1, we'll need a relatively optimised implementation of fortune's algorithm.
Currently, I'm undecided which approach to take. Thoughts?
from air-quality-web.
Related Issues (20)
- Display the currently selected reading type on the heatmap when loading the device graph HOT 1
- Migration: Slow HTTP API calls HOT 9
- When clicking sensors on the AQ Map (sometimes) the map just zooms HOT 5
- Sensor filter HOT 12
- Mosquitto stuck Address in use (1883) HOT 3
- FTW says 6 hours ago but last reading was 12:00 (now 16:00) HOT 13
- Issue with web site on some devices HOT 22
- Repeated measurement types above chart HOT 5
- Can the charts be made to open with data rather than just say error: no data recorded HOT 1
- Slow charts HOT 5
- POST request : Error 500 Internal Server Error HOT 7
- API action list-devices-near is not quite working - it returns only the same sensor HOT 8
- device.visible has no effect on the map HOT 7
- API and documents not working HOT 3
- Circles, on Opening the Map, don't disappear HOT 2
- Sensor not showing up correctly on current (0.14-dev) beta site HOT 5
- Last seen on chart is wrong HOT 6
- Wrong base URL in the API docs HOT 1
- graph not showing data for device bonus-a-abp HOT 5
- Integration with custom sensors and visual optimizations ? HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from air-quality-web.