Hotspot heatmap for event clusters

I created a web report addon which generates a basic heatmap. It avoids new libraries by using a folium/leaflet generated html file as template.

3 Likes

I updated my pull request for the heatmap report. Users can now chose between different map tiles provider.

5 Likes

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 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 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.

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.)

@emyoulation Yes Iā€™m planing to add event and place filters for the report and also a timeline version in future.

3 Likes

Cool. Just finished tweaking your grampletā€™s wiki page.

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?

Looks great, thank you!

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?

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.

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.

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

@StoltHD: An image export of the map is unfortunatly not possible without using a new library e.g. selenium (see here) and I already did a workaround for the addon, so I can add the maps without the folium library.

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.

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.

3 Likes

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

heatmap2

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

2

3

@StoltHD yes, all settings have tooltips.

1 Like

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)