# Hotspot heatmap for event clusters

**URL:** <https://gramps.discourse.group/t/hotspot-heatmap-for-event-clusters/776>\
**Category:** Ideas\
**Created:** [October 2, 2020, 11:12am UTC](https://gramps.discourse.group/t/hotspot-heatmap-for-event-clusters/776 "2020-10-02T11:12:10Z")\
**Posts on this page:** 17\
**Page:** 2

<div class="post-metadata">

**Author:** ![Mattkmmr](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/mattkmmr/32/410_2.png) [@Mattkmmr](https://gramps.discourse.group/u/Mattkmmr)\
**Post date:** [October 27, 2020, 11:28am UTC](https://gramps.discourse.group/t/hotspot-heatmap-for-event-clusters/776/25 "2020-10-27T11:28:06Z")

</div>

I created a [web report](https://github.com/gramps-project/addons-source/pull/470) addon which generates a basic heatmap. It avoids new libraries by using a folium/leaflet generated html file as template.

---

<div class="post-metadata">

**Author:** ![Mattkmmr](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/mattkmmr/32/410_2.png) [@Mattkmmr](https://gramps.discourse.group/u/Mattkmmr)\
**Post date:** [November 1, 2020, 3:01pm UTC](https://gramps.discourse.group/t/hotspot-heatmap-for-event-clusters/776/26 "2020-11-01T15:01:49Z")

</div>

I updated my [pull request](https://github.com/gramps-project/addons-source/pull/470) for the heatmap report. Users can now chose between different map tiles provider.

 ![Screenshot_2020-11-01 Screenshot(3)](https://global.discourse-cdn.com/free1/uploads/gramps/original/1X/25347caa7886af0cf83e4d3b604d7d5324a221b2.jpeg)

 ![Screenshot_2020-11-01 Screenshot](https://global.discourse-cdn.com/free1/uploads/gramps/original/1X/55e0a205a3f4cfe03dba71dcd4fe0a4cb2aeb862.jpeg)

 ![Screenshot_2020-11-01 Screenshot(2)](https://global.discourse-cdn.com/free1/uploads/gramps/original/1X/ef5b338f2d8aa9f1fbe826802566dcad62bcd29c.jpeg)

 ![Screenshot_2020-11-01 Screenshot(1)](https://global.discourse-cdn.com/free1/uploads/gramps/original/1X/11276896bd8e2bd1c5b60cc9741e344a3a7a9136.jpeg)

---

<div class="post-metadata">

**Author:** ![prculley](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/prculley/32/41_2.png) [@prculley](https://gramps.discourse.group/u/prculley)\
**Post date:** [November 2, 2020, 3:11pm UTC](https://gramps.discourse.group/t/hotspot-heatmap-for-event-clusters/776/28 "2020-11-02T15:11:36Z")

</div>

Sounds like the beginnings of a wiki article…

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [November 2, 2020, 4:01pm UTC](https://gramps.discourse.group/t/hotspot-heatmap-for-event-clusters/776/30 "2020-11-02T16:01:00Z")

</div>

> [@prculley](#):
>
> Sounds like the beginnings of a wiki article…

I’m not touching this one! _nuh-uh…_ not gonna do it!

Maybe someone wants to try using the [Write a How Do I… Article](https://www.gramps-project.org/wiki/index.php/Write_a_%22How_Do_I...%22_Article) template? I added that template (& the article on how to use it) a while back. It helps because exploring & explaining a Gramps feature for the wiki is hard enough without trying to find all the esoteric MediaWiki formatting tricks.

The Template gives examples of all the typography and hotlinking markup we typically use in our wiki. That saves you from having to search for how to link a [Gramps Glossary](https://gramps-project.org/wiki/index.php/Gramps_Glossary) item (rather than writing _yet another_ redundant feature intro), insert a screen capture/icon, or flag a menu command, and more…

When the article is finished, you just delete the example section.

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [November 20, 2020, 7:34pm UTC](https://gramps.discourse.group/t/hotspot-heatmap-for-event-clusters/776/31 "2020-11-20T19:34:55Z")

</div>

Matt,

Have you considered having it map all Events with a particular Tag or Filter?

A Tag would probably be easier. People could apply People & Event filters and tag whatever they want to show up on the map.

And by applying the same filter to Places, they could troubleshoot spots that showed up unexpectedly - such as items marked Private or were mis-located because the Event was using a generic national place rather than something more local. By adding a Rule to look for filtered Places without Lat/Long, they could troubleshoot items that did not show up. (I had spots in Lebanon, Kansas and the Atlantic that confused me. Then I realized they were the Geographic center of the US & a shipboard birth.)

---

<div class="post-metadata">

**Author:** ![Mattkmmr](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/mattkmmr/32/410_2.png) [@Mattkmmr](https://gramps.discourse.group/u/Mattkmmr)\
**Post date:** [November 20, 2020, 9:47pm UTC](https://gramps.discourse.group/t/hotspot-heatmap-for-event-clusters/776/32 "2020-11-20T21:47:43Z")

</div>

@emyoulation Yes I’m planing to add event and place filters for the report and also a [timeline](https://nbviewer.jupyter.org/github/python-visualization/folium/blob/master/examples/HeatMapWithTime.ipynb) version in future.

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [November 21, 2020, 3:54am UTC](https://gramps.discourse.group/t/hotspot-heatmap-for-event-clusters/776/33 "2020-11-21T03:54:37Z")

</div>

Cool. Just finished tweaking your [gramplet’s wiki page](https://www.gramps-project.org/wiki/index.php/Addon:HeatmapWebReport#The_.7B.7Bman_label.7COptions.7D.7D_tab).

I wasn’t at comfortable (at all!) with documenting Heatmaps from scratch. I didn’t have the bandwidth to explore it fully. But harmonizing and hotlinking didn’t entail as much work.

Are you planning to implement the CLI and Books interface options?

---

<div class="post-metadata">

**Author:** ![Mattkmmr](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/mattkmmr/32/410_2.png) [@Mattkmmr](https://gramps.discourse.group/u/Mattkmmr)\
**Post date:** [November 21, 2020, 12:17pm UTC](https://gramps.discourse.group/t/hotspot-heatmap-for-event-clusters/776/34 "2020-11-21T12:17:24Z")

</div>

> [@emyoulation](#):
>
> Cool. Just finished tweaking your [gramplet’s wiki page](https://www.gramps-project.org/wiki/index.php/Addon:HeatmapWebReport#The_.7B.7Bman_label.7COptions.7D.7D_tab)

Looks great, thank you!

> [@emyoulation](#):
>
> Are you planning to implement the CLI and Books interface options?

CLI should be easy to add, but I don’t think that you can add a webreport/interactive map to a book.

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [November 21, 2020, 1:12pm UTC](https://gramps.discourse.group/t/hotspot-heatmap-for-event-clusters/776/35 "2020-11-21T13:12:37Z")

</div>

> [@Mattkmmr](#):
>
> CLI should be easy to add, but I don’t think that you can add a webreport/interactive map to a book.

Will have to check that. It may be that it it doesn’t fit logically, but it looks like Books might just be a batch file interface. In which case, it could be made to work. (A use: You might create a Book that runs each of your 8 great-grandparents. And would want to re-run that annually to upload the webpages to a website as your research progresses.)

An undocumented interface item…  
What are the Style opportunities? Is there CSS in the generated webpage that can be manipulated? Or can you affect the colors, fuzziness, size, (… et cetera) of the heatmap overlay dots?

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [November 21, 2020, 2:45pm UTC](https://gramps.discourse.group/t/hotspot-heatmap-for-event-clusters/776/37 "2020-11-21T14:45:50Z")

</div>

> [@StoltHD](#):
>
> Could it be added as a PNG or SVG image to a graphical diagram to a book report as a page with an sizeable image with an image description/text?

This report isn’t rendering the data. That is being done by the Map Service. This is a mechanism of feeding the overlay data to the Map Service with from a static html.

So output to a static image format isn’t a good match. Besides, even if it could render an image instead of and overly, that would mean also specifying centering, zoom scale and destination image size.

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [November 21, 2020, 3:21pm UTC](https://gramps.discourse.group/t/hotspot-heatmap-for-event-clusters/776/39 "2020-11-21T15:21:48Z")

</div>

That does bring up a complex issue.

If your intent is to publish, you need map tiles that are at least 300dpi instead of the web’s 72dpi. But if you were to zoom in to get tiles that will print well; the map labels, markers & heatmap dots are too small for print purposes.

This problem would take some more thinking.

---

<div class="post-metadata">

**Author:** ![StoltHD](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@StoltHD](https://gramps.discourse.group/u/StoltHD)\
**Post date:** [November 21, 2020, 3:58pm UTC](https://gramps.discourse.group/t/hotspot-heatmap-for-event-clusters/776/40 "2020-11-21T15:58:20Z")

</div>

Just forget it!

it was a tip of how it might be possible, not another discussion point .

I’m so tired of always getting that " No that is not possible, because this is open source, so … bla bla"  
Do you really think I don’t research things BEFORE I post a comment?

I deleted the comment

---

<div class="post-metadata">

**Author:** ![Mattkmmr](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/mattkmmr/32/410_2.png) [@Mattkmmr](https://gramps.discourse.group/u/Mattkmmr)\
**Post date:** [November 21, 2020, 7:31pm UTC](https://gramps.discourse.group/t/hotspot-heatmap-for-event-clusters/776/41 "2020-11-21T19:31:17Z")

</div>

> [@StoltHD](#):
>
> Could it be added as a PNG or SVG image to a graphical diagram to a book report as a page with an sizeable image with an image description/text?

@StoltHD: An image export of the map is unfortunatly not possible without using a new library e.g. `selenium` ([see here](https://github.com/python-visualization/folium/issues/833)) and I already did a workaround for the addon, so I can add the maps without the `folium` library.

---

<div class="post-metadata">

**Author:** ![Mattkmmr](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/mattkmmr/32/410_2.png) [@Mattkmmr](https://gramps.discourse.group/u/Mattkmmr)\
**Post date:** [December 16, 2020, 10:51pm UTC](https://gramps.discourse.group/t/hotspot-heatmap-for-event-clusters/776/43 "2020-12-16T22:51:45Z")

</div>

> [@StoltHD](#):
>
> Could it be added as a PNG or SVG image to a graphical diagram to a book report as a page with an sizeable image with an image description/text?

I found a way to allow an image export of the map. You can use the image and add it to the book/report.

One major reason for not automating heatmap report is that I don’t know which part of the map interests the user e.g. some maps have places only in one small area where you have to zoom in and others have places sprad over continents where you have to zoom out.  
So the easiest way is either that users have an interactive map or that they pick their area of interest and export this area as image.

> [@StoltHD](#):
>
> I don’t think you should be so afraid of using 3rd party libraries for gramplet… As long as you create useable and feature rich add-ons, most users don’t care if they need to install extra libraries or a software package…

I don’t think that size is the problem, but rather the difficulty for users to install and set up extra libraries. Gramps needs a way for addons to auto-install the extra dependencies, so everything is working.

* * *

@emyoulation: I removed the menu selection for event types, because I think most users are just interested into getting the distribution of all event places for ancestors of a person or decendants of a person. I think adding event filters and place filters makes the report too complex.

I also think for troubleshoot places a new text report might be easier. It could just list places of events where the place is too high up in the place hierarchy e.g. countries, states instead of villages, cities, etc.

Right now you can also use the `all known places view` in geography and filter them if you want to check for misplaces places on a map. The markers also link to the places if you find an error in contrast to the heatmap where it might be difficult to find out which place is misplaced.

---

<div class="post-metadata">

**Author:** ![Mattkmmr](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/mattkmmr/32/410_2.png) [@Mattkmmr](https://gramps.discourse.group/u/Mattkmmr)\
**Post date:** [January 21, 2021, 7:17pm UTC](https://gramps.discourse.group/t/hotspot-heatmap-for-event-clusters/776/44 "2021-01-21T19:17:32Z")

</div>

I added more menu options to the Heatmap report which allow more control of map settings:

- `Latitude`: Value for the map starting point
- `Longitude`: Value for the map starting point
- `Start zoom`: Value for the map starting point
- `Min. zoom`: Minimum value for zoom
- `Max. zoom`: Maximum value for zoom
- `Radius`: Value for the heatmap point size

![heatmap1](https://global.discourse-cdn.com/free1/uploads/gramps/original/1X/80a960724e2c5697d169aed857d2a8d267111ff5.png)

![heatmap2](https://global.discourse-cdn.com/free1/uploads/gramps/original/1X/a00c68fd3bb4318b43cf029e87437a0a6e1c3cb3.png)

---

<div class="post-metadata">

**Author:** ![Mattkmmr](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/mattkmmr/32/410_2.png) [@Mattkmmr](https://gramps.discourse.group/u/Mattkmmr)\
**Post date:** [January 24, 2021, 5:53pm UTC](https://gramps.discourse.group/t/hotspot-heatmap-for-event-clusters/776/46 "2021-01-24T17:53:37Z")

</div>

More menu options updates:

- `Options` tab was renamed to `General` tab
- **Radius** option was renamed to **Point size** and added to the `General` tab
- `Advanced options` tab was renamed to `Advanced`
- `Advanced` tab has now only options for setting a custom starting position and zoom
- **Max. zoom** and **Min. zoom** were moved from `Advanced` tab to new tab `Limits`
- `Limits` tab has options to set custom map limits (upper left and lower right lat and lon)
- `Limits` tab also has an option to render the custom map border (helps setting up the position and zoom limits)

![1](https://global.discourse-cdn.com/free1/uploads/gramps/original/1X/4872fdf47a3af42357b53912e51891b73a0b64a0.jpeg)

![2](https://global.discourse-cdn.com/free1/uploads/gramps/original/1X/c9e2e8edde8e559c4e4b10f50bfe5ede7b686e14.jpeg)

![3](https://global.discourse-cdn.com/free1/uploads/gramps/original/1X/cd7f1664395d2a8b7b46c0b8e1f283267bee6bc6.jpeg)

 ![4](https://global.discourse-cdn.com/free1/uploads/gramps/original/1X/faf1ada9a3bfc8d3dafc427a34aa0d4fab584103.jpeg)

> [@StoltHD](#):
>
> do you have tooltips on hover to explain the different settings?

@StoltHD yes, all settings have tooltips.

---

<div class="post-metadata">

**Author:** ![StoltHD](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@StoltHD](https://gramps.discourse.group/u/StoltHD)\
**Post date:** [August 11, 2021, 1:11am UTC](https://gramps.discourse.group/t/hotspot-heatmap-for-event-clusters/776/47 "2021-08-11T01:11:03Z")

</div>

You can use Visual Studio Community for free for any Open Source Free Project, and Microsoft provide free open source python tools:  
[microsoft/PTVS: Python Tools for Visual Studio (github.com)](https://github.com/Microsoft/PTVS/)

[Previous page](https://gramps.discourse.group/t/hotspot-heatmap-for-event-clusters/776.md?page=1)
