python-visualization / python-visualization/folium

Heatmap scalability

Open
#1,430 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
7.4k
Forks
2.3k
Avg merge
17h 22m
Merged PRs (30d)
11

Description

The heatmap plugin is not very scalable at the moment. For millions few data points, the map is "laggy" when moving the maps around (at a reasonable zoom level, when most of the data points are hidden).

From what I've investigated, it comes from the fact the, when the _redraw function is called, the code iterates over all data points to check if it is or not in the bounds of the map being shown.
It seems very inefficient since there exists data structure such as R-Tree that can efficiently retrieve the data points inside a box.

Now it seems that the Leaftlet.heat plugin is not maintained anymore (as noted in #1282 ). As far as I can tell, there is only the .min.js file on this repository, what are the plans for this plugin?
Host it completely on this organization so it can be modified and maintained?

For the problem of the performances, I wrote a quick POC using rbush and it improves the performance when we zoom on a specific area (and fewer points are actually shown on the map). I can contribute to this issue if necessary.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the heatmap plugin's minified JavaScript and its _redraw path, then review the reported rbush proof of concept and the maintenance concern around Leaflet.heat. Done would require an agreed scope for maintaining the plugin and evidence that the heatmap performs better when rendering millions of points.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.