Clip polygons in R

Clipping polygons is a common GIS task. For example, you might want to study local authorities (LADs) in the Yorkshire and the Humber region but can only obtain a shapefile with all the LADs in England. Removing all the LADs outside of the Yorkshire and the Humber can be achieved by ‘clipping’ the LADs, using the extent of the larger region as a template. First, install and load sf for loading the shapefiles, and tidyverse for manipulating the data and plotting the maps. [Read More]
R  rstats  GIS  sf  clip  polygon-clip 

Set root directory for knitr

Knitr, by default, looks in the same directory as your .Rmd file to find any files you need to draw in, like data sets or script files. If you keep your data files and scripts in separate folders (and you should) you need to configure knitr.

[Read More]

Glossary and acronyms in LaTeX

To write a glossary in LaTeX you need to use a specific packages designed for the purpose. It then allows you to define a term and its acronym in a file, then reference the item later. The first time the item is referred to the full label and acronym are displayed automatically:

United Kingdom (UK)

All subsequent times you reference the item LaTeX just the acronym is shown:

UK

[Read More]

Build large maps with OpenStreetMap

This is just a quick post to remind me to produce a full post later when I have more time. It’s surprisingly difficult to produce street maps in GIS for paper sizes bigger than about A2. Using QGIS for example, even if things look good in the print composer the resulting image often doesn’t have a background that extends to other layers. The solution is to use Atlas convergence. With OpenStreetMap as a background, create your map as normal in the print composer until it looks right. [Read More]

Automate Hyperlinks in LibreOffice Calc

I’m in the middle of obtaining articles I’ve identified as part of literature review search. I have a large LibreOffice Calc table with bibliographic details of all the articles I’ve considered (plus a marker for whether I have excluded the article manually or not). Having to copy and paste article titles or DOIs into Google is a bit of a chore, if I’m honest, as there are nearly 100 of them, so to automate the Google search somewhat I carried out the following steps: [Read More]