Week Beginning 20th April 2026

I spent much of Monday and Tuesday this week working on the DOST Auld Laws project, which I’d begun work on last week.  I set up a test instance of the Cantaloupe IIIF image server on my laptop and began experimenting with the OpenSeadragon IIIF image viewer.  It was pretty straightforward to set this up and to create a test page where the viewer connected to an image stored in the IIIF server and enables the user to zoom and pan around the image.  The trickier issue was setting up the infrastructure so as to allow lines of text in the image to be clicked on and highlighted, and for IDs associated with each of these line regions to be accessible by JavaScript code (to eventually enable the corresponding line in the text view to also be highlighted).

Luca is currently working on a digital edition that allows regions of an image to be highlighted when buttons are pressed on and he very helpfully gave me access to the test site he’s working on so I could see how things work.  I had been expecting that the region data would need to be somehow stored in the IIIF manifests for each image and that the IIIF server would be a lot of the processing to enable the display of and interaction with regions in the image, but both Luca’s site and another one I was referencing stored the region data as coordinates pulled into the front-end from a separate source, such as a JSON file.  I was very happy to go with this approach, as firstly it meant I didn’t need to spend ages investigating IIIF manifests and how to update them and secondly it means the region data is not tied into a specific server technology, meaning it will be easier to repurpose it in future if that technology changes.

The line data exported from Transkribus consisted of detailed coordinates such as:

1309,2018 1469,2068 1716,2037 1876,2123 2092,2037 2234,2111 2389,2062 2555,2123 2734,2062 2796,2111 2975,2068 3555,2130 3629,2080 3808,2111 4062,2037 4457,2043 4524,2080 4599,2018 5055,2099 5142,2049 5321,2099 5438,2043 5586,2086 5845,2043 5901,2080 6271,2062 6271,1901 6129,1944 5802,1839 5710,1920 5284,1889 5234,1938 5166,1883 4771,1907 4481,1796 4333,1907 4222,1870 4043,1957 3950,1907 3808,1920 3753,1864 3574,1913 3506,1852 3426,1907 3006,1839 2895,1895 2438,1870 2265,1913 2055,1815 1975,1852 1759,1839 1660,1920 1506,1920 1309,184

But for the most part these refer to simple rectangles and with our data this level of detail isn’t really needed.  Thankfully there is a script available to simplify the coordinates (https://github.com/dariok/page2tei/blob/master/simplify-coordinates.xsl) and I was able to adapt this to export the pixel coordinates of each corner of the line rectangle, such as (for the above polygon):

1309,1796 6271, 1796 6271, 2130 1309, 2130

OpenSeadragon doesn’t work directly with pixel dimensions, but has a function to convert these into its required format (see https://openseadragon.github.io/docs/OpenSeadragon.Viewport.html#imageToViewportRectangle) and I could therefore plug in the rectangle data and make the viewer display a region overlay on the image.  I made a test that displayed all lines at once, as you can see below:

There is quite a lot of overlap between the lines here, but this isn’t a big issue.  These areas will not be displayed all at once – only one will be displayed when the user clicks on the image.  If the highlighted line isn’t the one the user wants due to there being an overlap it’s very easy for the user to just click again in a slightly different location to highlight the required line.

Having managed to get the regions displayed on the image, the next step was to process click events.  Despite the overlays appearing as HTML elements, each sharing the same class, it was not possible to simply use jQuery to process clicks on this class.  Instead, OpenSeadragon’s clickHandler needed to be used.  With this in place it was then possible to process the click, to add a new highlighting class and to grab the ID of the element, which will eventually be used to find and highlight the line in the text view.

With all of this in place I then wrote a script to export line data (IDs, coordinates) from the TEI XML and store all of this in JSON files (one per document) that can then be loaded in whenever a page is displayed.  I then moved on to setting up an initial version of the website for the digital edition, setting up an initial interface, menus, pages and such things.  It’s all still running on my laptop for now, but I’ve made really good progress this week and will continue with it next week.

For the remainder of the week I worked on a variety of other projects.  I made some further changes to the user survey popup for the Dictionaries of the Scots Language and I added some text to Sara Pons-Sanz’s AHRC proposal document.  I set up the mapping metaphor site at the new URL we will be using for the site, meaning everything is ready for the major updates that I’ll hopefully be working on in the coming weeks.

I also wrote a document outlining the ‘facts and figures’ popup for the Burns Supper map.  This took some time to research, but gives a handy overview of what the popup will contain in terms of summary data and visualisations.

Finally, I returned to the Place-names of Armagh project.  The existing data for this project specified location data as Eastings and Northings and I need this as latitude and longitude.  When I’d previously imported the data into QGIS the markers were all in the wrong place and I didn’t know why.  Thankfully Frances Kane, who is working on the project suggested that this might be because I hadn’t set the coordinate reference system to Irish Grid, and this proved to be the answer.

After making the update the data all loaded at the correct locations and with this in place I was then able to follow this answer: https://gis.stackexchange.com/a/64700 to generate latitude and longitude fields for the data and then export this from QGIS as a CSV.  After that I imported the data into the CMS and all records now have latitude and longitude.  There’s still more I need to do, though.  At the moment the map in the ‘edit place’ page in the CMS is generated based on the supplied grid reference or ITM coordinates, which the records still don’t have, so no map displays.  I think I have a script that generates this data from latitude and longitude and I’ll look into this next week.  I’ll also run the data through my script that grabs the altitude for places from Google Maps by sending latitude and longitude to the service.  The front-end map uses latitude and longitude directly (no messing about with grid references or ITM) so I should be all set to start deploying the front-end map soon.