OpenStreetMap logo OpenStreetMap

SomeoneElse's Diary

Recent diary entries

Yet another diary entry about vector tiles

Posted by SomeoneElse on 29 May 2024 in English. Last updated on 11 November 2024.

A simple "shortbread" / "VersaTiles Colorful" maplibre-gl vector map

Lots of people have written diary entries and there have been other announcements and demos. You might wonder why we need another?

The idea of this is to provide a “soup to nuts” guide in a similar style to the existing “Switch2osm” Serving Tiles guides for raster tile servers.

Introduction

There are two major pieces to this. The first piece creates a set of vector tiles that can be served by a web server. The second provides a way for clients to access that data - and clients also decide how to display it.

The code in this example is for web clients, but it’s also possible to create other sorts of clients too (for example, Android or iOS apps).

See full entry

Location: Larganhugh, Melvin Electoral Division, Manorhamilton Municipal District, County Leitrim, Connacht, Ireland

Example of different map styles

Let’s imagine that you’re a pizza delivery company, and you’ve got an app that shows where you are, where your customers are and where a delivery person is between the two. Obviously you need some sort of map that shows the three in context. You can’t use Google Maps for cost or other reasons, and whatever framework your using will accept raster tiles in the almost universal format https://server/Z/X/Y.png, so why not use OpenStreetMap’s standard layer? After all, it’s free!

Well:

See full entry

Location: Pizza, Uvu Uda, Askira-Uba, Borno State, Nigeria

Bus Stops

Posted by SomeoneElse on 18 March 2024 in English.

There’s lots of data stored in OSM about bus stops, but often maps and apps created with OSM data don’t make much use of it (with OsmAnd being the notable exception). For here’s a bus stop as shown by OSM Carto:

Bus stop in York in OSM Carto

You can see that it’s a bus stop, and you’d be able to see the name if you could zoom in a bit more. However, in OSM there’s actually lots more information. For the map styles that I look after (both web-based raster maps and for Garmin devices) I tried to add a bit more detail. Here’s the result:

See full entry

Location: Ouse Acres, Acomb, York, York and North Yorkshire, England, YO26 5SJ, United Kingdom

Showing things at higher zoom levels

Posted by SomeoneElse on 6 February 2024 in English.

Signpost near Husthwaite

Although the raster maps at maps.atownsend.org.uk support zoom levels up to 24, until recently I’ve not made much use of that for showing extra data. However, there is a lot of room at these high zoom levels - as the picture above shows, enough for all the directions on this signpost here.

The name is shown as normal at lower zoom levels, then as you zoom in the directions are shown too, as you can see here.

Location: Acaster Mill, Husthwaite, North Yorkshire, York and North Yorkshire, England, YO61 4PG, United Kingdom

What's new on the maps at map.atownsend.org.uk

Posted by SomeoneElse on 28 December 2023 in English. Last updated on 6 February 2024.

Norfolk coast near Cley

Tidal and non-tidal wetland

A major rewrite here takes into account tags such as natural, reef, wetland, surface and tidal before deciding how to show wetland areas. See the picture above, which is here, and here in OSM.

The beach between high and low tide can be clearly seen here (in OSM, here). There are blue dots in the sand rather than black. A deliberate decision was taken to show more detail for areas above low tide. See e.g. here between Wales and the Wirral (see here in OSM).

Island and islet names

See full entry

Location: Reask, Marhin ED, Kenmare Municipal District, County Kerry, Munster, V92 P681, Ireland

ChangesetMD

Posted by SomeoneElse on 6 August 2023 in English.

There’s lots of software around to work with OpenStreetMap data - querying it, creating maps from it, using it for navigation. One area that there has historically been less support is analysing OSM changeset data. As an example, here is one of mine.

However, many years ago Toby Murray wrote ChangesetMD. That can be used to maintain a database of changeset information (tags, discussions, etc.). Martijn van Exel updated that to a recent version of Python and I made a couple more changes to support very recent Python versions and made the replication more scriptable.

Downloading changeset data

Over on the planet.osm.org site, there’s a download for all the changeets generated at the same time as the weekly “planet” file is created, and also one for all the changeets and discussions as well. The changesets-only one is just over 6GB (bzipped), and the one with discussions as well is only about 250MB more, because most changesets don’t have discussions.

If you’re not interested in changeset data dating back to 2012 you don’t need to download this file; you can just start replicating from whatever point in the past you are intereted in starting from.

Installing the software

If you’re on Debian or Ubuntu, you’ll likely want to follow these instructions from a non-root user account of your choice (substitute that account for “youruseraccount” in the instructions).

Running it for the first time

From the virtual account created by the installation, which you can reenter by running

cd /home/${youruseraccount}/src/ChangesetMD
source .venv/bin/activate

Run something like this

python changesetmd.py -d changesets -c -g

The “-g” is optional and initialises the database to story geometric data. “changesets” in the line above is just the database name.

Loading a changeset dump file

To load the database with changesets and discussions:

python changesetmd.py -d changesets -g  -f ~/data/discussions-latest.osm.bz2

See full entry

Location: Charlesworth, Higher Chisworth, High Peak, Derbyshire, East Midlands, England, United Kingdom

For many years I’ve used Garmin devices for both for navigation and for collecting data for OSM. As well as lots of premade maps in different styles it’s actually pretty easy to tinker with the map style yourself, although the OSM wiki makes it seem much more complicated than it actually is. It’s also pretty easy to see what OSM keys map to what values - there’s a file for points, one for lines and one for polygons that shows what OSM key and value corresponds to what Garmin feature.

I also maintain a web map style that tries to be much more inclusive than other web maps in terms of what it shows (have a look around the map legend for that), and thought that it’d be great to do the same for Garmin maps too. The web map style uses a lua script to preprocess OSM data before the CartoCSS code deals with it, which makes the latter much, much simpler. It turns out that exactly the same approach works when creating Garmin maps too, as described on this page.

See full entry

Location: Bootham, Bishophill, York, York and North Yorkshire, England, YO30 7XZ, United Kingdom

Screenshot of switch2osm page

I’ve added a new page to the switch2osm guide: “Manually building a tile server (Debian 12)”.

Mostly it’s minor changes only from Debian 11 and Ubuntu 22.04 - new versions of software, that sort of thing. Where new manual steps have to be carried out, the guide describes them. Debian 12 itself does have some differences - “syslog” is no longer created by default, so debugging changes slightly.

I’ve also updated a couple of other pages such as the replication ones to reflect that Debian 12 is now a supported operating system.

Separately to that, I’ve moved map.atownsend.org.uk (which uses a related may style) from an Ubuntu 22.04 server to a Debian 12 one. There was nothing wrong with the old one, but the hosting provider I use was offering higher spec ARM servers for essentially the same price as the old AMD one I was using, so it made sense to move.

See full entry

Location: Thurles Townparks, Thurles Urban, The Municipal District of Thurles, County Tipperary, Munster, Ireland

As there have been lots of updates recently, I’ve made a new release of all of the code behind map.atownsend.org.uk

There are releases for four repositories - the lua code that does all the hard work, the map style that determines what it looks like, the map legend, and the website for the map itself.

Here’s a summary of what’s new:

Natural features

Rocky features are now shown in more detail:

See full entry

Location: Seamer, North Yorkshire, York and North Yorkshire, England, United Kingdom

Community.osm.org - how's it going?

Posted by SomeoneElse on 25 March 2023 in English. Last updated on 28 March 2023.

The new forum “community.osm.org” has been going for a while now, so maybe it’s useful to have a look at how things are going.

There’s obviously lots that goes into creating that forum as a site where people can share ideas - there’s the forum software itself, and the people looking after the technical administration of the site, the migration of the old forum (which has just happened) and the help site (planned for later), the various implementation decisions that got us to here, and also the people looking after content moderation (which is more actively managed than before). Of all of these, this diary entry is really only about the Discourse software itself.

I’ll not comment here about the future migration of https://help.openstreetmap.org/ to Discourse and the work required within Discourse to support that, since it would be unfair to judge something that has not happened yet.

Full disclosure - I’m one of the moderators of a couple of categories in the forum, but this is very much a personal view.

What’s good:

The software is actively maintained, unlike the old FluxBB forum software, or OSQA, which is used for the help site.

It’s working! Some communities that might have been a bit quiet or spread over private forums are now able to talk together much easier than before.

Searching works, with some caveats around the UI (see below for that). This may sound obvious, but mailing lists search at for example talk-gb can be a bit of a pain to use - a page such as this only shows the subject and the name of the poster, not the date of the message.

You can avoid “me too” answers (but see “reaction icons” below).

There’s a translate button on every post that supports the most common languages. This reduces the “echo chamber” effect that some forums had previously (and some other OSM channels still do now).

See full entry

Location: Lunyo Estate, Katabi, Virus, Entebbe City, Central Region, Uganda

Windows Subsystem for Linux

Posted by SomeoneElse on 25 January 2023 in English. Last updated on 30 March 2023.

This isn’t directly related to OSM, but many times in “software” or “development” OSM channels someone has asked “how do I do X … on Windows 10?”.

The reason that’s often a question is that, for historical reasons, much of the OSM software used to do things has been developed on Linux. That’s great for people working on Linux themselves, and the Apple Macintosh users can normally jury-rig something to run that software too.

Windows users can do the same too, by installing “Windows Subsystem for Linux”. Within Windows, search for “Windows Features”:

In Windows Features, tick the box for WSL and click OK:

See full entry

When is a path not a path?

Posted by SomeoneElse on 16 January 2023 in English.

Just after the New Year, there were a few reports of people getting stuck and having to be rescued while hiking in the English Lake District.

There are writeups of this in “The Great Outdoors” magazine here and on Alex Roddie’s blog here. They really are worth reading - the consensus on IRC, Mastodon etc. was that the quality of the article was streets ahead of what you might expect to see in the generalist national press.

Lots has been written about how map and app developers can try and convey information to a user beyond “this is a way of getting from A to B” (including an OSM diary entry that I wrote in December 2022), so I won’t go over that again.

However, one particular quote from the Great Outdoors article did stand out for me, and it’s this:

A spokesperson for Keswick Mountain Rescue Team, which carried out the rescues, said: “There is no path via this route – only a scramble of loose scree which also requires the walker to negotiate the rocky outcrop of Slape Crag. It’s the scene of previous callouts.”

The reason why that stood out is that “path” can mean different things to different people:

  • an actual signed path suggesting that people on foot are encouraged to go via a particular route. In England and Wales there’s the concept of “public footpaths” (and public bridleways), which is a legal right of foot (and horse) access across what might be otherwise private land.

  • some indication on the ground that people often go via a particular route

Often the two coincide, and “where you’re supposed to go” matches “where people do actually go” correspond. Sometimes, however they don’t.

See full entry

Location: Old Kiln, Helmsley, North Yorkshire, York and North Yorkshire, England, YO62 5HL, United Kingdom

How to show paths on a map?

Posted by SomeoneElse on 11 December 2022 in English.

(or, what’s wrong with the general purpose map on my phone that just seems designed just to show me adverts?)

I decided to write this after reading some of the comments on the wiki here and in the community forum here.

People tend to view “things that appear on a map” as “somewhere that they can go”. For example here:

A stroll up Everest

someone who didn’t do their research properly might think that they can just wander along that path to the top of Everest from the south, despite the underlying data suggesting “difficult alpine hiking”. This diary entry is an attempt to try and avoid such misunderstandings.

What options does a map have to different things?

The map at map.atownsend.org.uk shows linear paths and tracks as a single line, It shows legal rights of way (some special categories in England and Wales) and also tries to give some indication of what a walker might expect on that path.

See full entry

Location: Isle of Wight Donkey Sanctuary, Ventnor, Isle of Wight, England, PO38 3AA, United Kingdom

Permalinks at map.atownsend.org.uk

Posted by SomeoneElse on 4 December 2022 in English.

The problem

Historically, the map at map.atownsend.org.uk didn’t change the URL as you moved around, and you had to press a “permalink” button to save the current location. This wasn’t ideal, so I had a look around for alternatives. Helpfully, the Leaflet site has a list of suitable plugins. Of those, leaflet-hash was suggested elsewhere. That seems to be still in use, although it hasn’t been updated for a while. It is spectaculary easy to use, and “does what it does” with no problems.

The challenge is that it stores the current location (for example “https://map.atownsend.org.uk/maps/map/map.html#11/54.4900/-3.1098”) but doesn’t store the current layer. That map currently has a choice of 5 base maps (test instances have 6) and 5 overlays:

Layer selector

How to solve this

See full entry

Location: LCPs of Fylingdales and Hawsker-cum-Stainsacre, North Yorkshire, York and North Yorkshire, England, YO22 4QB, United Kingdom

Garmin GPSMap64S screenshot

The OSM wiki contains links to various downloads for Garmin maps, as well as some information about creating your own from OSM data.

For many years now I’ve used maps on Garmin devices that I’ve created myself. I’ve done this so that I show things like England and Wales public footpaths and bridleways that I’m not aware that other maps can show. Until now, I’ve never quite got around to making the mechanism publicly available, or indeed the maps themselves. I’ve finally got around to fixing that.

The “readme” here explains how to run the script yourself, if you want to do that. If you don’t, you can download the latest files for Great Britain. New maps should appear there about weekly.

Differences between these maps and other maps for Garmin devices include:

See full entry

Location: Whenby Lodge South, Sheriff Hutton, North Yorkshire, York and North Yorkshire, England, YO60 6QN, United Kingdom

Switch2OSM.org Serving Tiles - Updating your database as people edit

Posted by SomeoneElse on 26 July 2022 in English. Last updated on 27 July 2022.

Munin

Since the release of Ubuntu 22.04 LTS, it’s now much easier to keep a tile-serving database updated. This version of Ubuntu ships with much more recent versions of osm2pgsql and osmium, so it’s easier to set up updates using those.

First things first, the new “setting up a rendering server” instructions for Ubuntu 22.04 are here. These are much shorter than they used to be because most of the software setup is done automatically as it is installed.

osm2pgsql-replication

See full entry

Location: Crossmoyle, Clones Urban ED, Ballybay-Clones Municipal District, County Monaghan, Ulster, Ireland

It’s been a while since I wrote about updates here.

Map.atownsend.org.uk is a map style that started out as a fork of OSM Carto in 2014, when it was obvious that the direction of travel for that style was towards “a map that was nice to look at” rather than “a map that was useful”.

For example, here’s the area that I linked to then in OSM Carto now: Kelstedge on OSM Carto

See full entry

Location: Opportunity, Holt County, Nebraska, United States

Zero-waste Shops

Posted by SomeoneElse on 13 February 2022 in English. Last updated on 1 June 2022.

Food shop icons with 3 zero-waste versions

Over at map.atownsend.org.uk I use a wider variety of icons for different sorts of objects within OSM. I previously explained here how simple changes to a basic icon make it still recognisable as the basic object (“this is a pub”) but also convey more information (“this particular pub is wheelchair accessible, and has a beer garden”).

The same principle can be used with “shop” icons - a selection of different types of shops can be shown differently if they have one of the tags commonly used in OSM to indicate “zero waste” or “eco” shops. This is done here in the lua file that processes all OSM data before loading into the rendering database. In the case of “zero waste supermarkets”, the code looks like this:

See full entry

Location: Woodhouse Cliff, Hyde Park, Leeds, West Yorkshire, England, LS6 2EZ, United Kingdom

Flood-prone footpaths

Posted by SomeoneElse on 2 January 2022 in English.

One example footpath, shown in blue as flooded

In England, the Environment Agency has an extensive network of river level monitors that are used to provide flood warnings such as (at the time of writing) this one.

However, these alerts tend to be only issued when land or property is likely to flood, and there are many paths that flood much earlier. An example is here, where if the downstream station reads just over 1m, you’ll get your feet wet. The Environment Agency doesn’t issue a warning at that level because it’s well within the normal range, and the river’s still well within the levees that have been provided for it for the last 50 years.

See full entry

Location: Huntington, York, York and North Yorkshire, England, United Kingdom