Thursday, July 2, 2015

Migrated from OpenLayers to Leaflet in Nomisma, Implemented Heatmaps

I have spent a few days finding solutions to scalability problems loading a lot of points in OpenLayers, and migrated to Leaflet and implemented heatmaps, which reveal context in a more useful way when there are a lot of points. I wrote the following email to the Nomisma list:

---

We had run into scalability issues with rendering maps of findspots driven by SPARQL for mints in the Nomisma interface. It was not a triplestore issue, but a browser issue. OpenLayers did not handle 1000 points for findspots related to Rome gracefully, so I had to change directions.

First, it should be noted that the the points now reflect unique findspots and not objects (because we can't reasonably map 10,000 coins found in the same hoard, therefore the same findspot).

I switched OpenLayers to Leaflet. I replaced the default KML rendering of points into a heatmap, which is more indicative of distribution overall. See http://nomisma.org/id/rome for example, but you can also see http://nomisma.org/id/sicily for the distribution of (mostly Republican) coins using Sicily as the nmo:hasMint. The IGCH findspots are in the system, so a number of Greek mints have hits as well (http://nomisma.org/id/syracuse).

There are four available base layers. The default is the ancient terrain produced by the Ancient World Mapping Center at the University of North Carolina and hosted by mapbox.com. Also available are modern terrain, OpenStreetMap, and the Roman Empire map.

You can toggle the main point/polygon for the mint/region on or off, as well as the heatmap. You can also turn on the KML layer (which is still available for individual download as well). Leaflet seems to handle a large number of points more efficiently than OpenLayers.

This migration to Leaflet is the beginning of really sophisticated geographic analysis tools that I would like to implement into Nomisma. There are a lot of ways we can make Nomisma data more useful to researchers.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.