OpenStreetMap

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

and here it is at map.atownsend.org.uk: Kelstedge showing more information

A key difference is the ability to see a walking route from one side of that map to the other.

The map style is in github - see the links at the top of the changelog. It’s designed to be a pedestrian-focused style, in particular showing England and Wales’ “public rights of way”.

From a design point of view, one of the key choices was to try and overload basic features with more detail. An example of that was described previously here. With the pubs that that diary entry describes, 8 different attributes are considered (“does it serve food”, “can I get a wheelchair in there”, etc.). There are now about 300 different combinations, but they’re all recognisably variations of the same basic icon. It’s a similar story with footpaths and paths - there are about 50 variations of those.

Technically, the approach taken was to lean heavily on lua tag transforms - invoked when the database is reloaded and also when data is loaded into it on the fly (the site applies updates every minute). Changes to the style that involve lua (and most do) do need a database reload. This is normally done once a month or so, and takes a few hours overnight - if 24*7 uptime was needed it’d be easy to switch between a pair of databases or servers (people with very long memories might remember the A/B approach of system like IBM’s System/38), but that hasn’t been a priority so far.

Making extensive use of lua has huge advantages - it makes the styling code much easier to write, since there need to be fewer complicated and brittle selection statements in the styling code. As an example, look at the code added to render parcel lockers in 2017. At the time, before “amenity=parcel_locker” was widely used, variations on vending machine tended to be used. The corresponding rendering code change is then really simple - just the reference to an icon and a name. It would also be possible to refactor the main two parts of the style to make far more use of this and vastly simplify much of the selection logic from the original style, but that hasn’t been a priority.

Another thing that lua processing makes easy is the ability to show walking, cycling and horse riding routes - the lua code adds tags so that the rendering code can render them a a dotted line. For my money (used as I am to other familiar UK map styles) these are absolutely a key part of a general purpose map.

With that in mind, it’s worth looking at some of the changes since the changes made to show zero-waste shops using a small “E” as a modifier to existing shop icons, described in a previous diary entry.

Many former phoneboxes now contain defibrillators, mini-libraries. tourist information points, etc. These are shown using a unique, but phonebox-derived, icon. Phone boxes that aren’t red are shown with an appropriate colour:

Green phone box

Stations on preserved and miniature railways are shown with the name in “tourist” colour. Grosmont has two stations, one on the national rail network, one on the preserved North Yorkshire Moors Railway:

Two stations in Grosmont

If a walking route has no name but does have a colour, the colour is used as the name:

red and brown walking routes

The style already used the trail_visibility tag to render some paths and tracks less overtly; this has been extended to also include various informal and overgrown paths. In this example an informal north-south link path is shown; as is a section of razed railway, with slightly different dots:

informal north-south link path

Some mappers have been mapping closed shops etc. with “opening_hours=closed

closed pub

Locked gates are shown with a “locked” variation on the gate icon:

locked gate

Footpaths and cycleways alongside a road are often tagged with the name of the road. This map style supresses this names, and “is_sidepath” has been added to the list of tags that forces this removal. For example, the tags here:

way 901462422 via overpass

show like this:

way 901462422 at map.atownsend.org.uk

The context of this diary entry is of course lots of discussions about OSM’s “standard” style, “OSM Carto”, particularly this bin fire of a pull request. One of the maintainers has written in detail about the process of changing the style here and especially here. As an aside, I disagree with a couple of the points there, in particular “we outgrew the possibilities of the technical framework we were using” - two of the three pinned issues here are essentially “as yet unexploited technical possibilities”. I’d also suggest that more widespread lua use, which I’ve tried to suggest the benefits of above, would be hugely beneficial if it was to be made use of.

That said, the triangle in imagico’s blogpost explains the conflicting pulls on the project, and I actually believe that the maintainers of OSM Carto have an impossible job, because the cartography guide contains these as the first two goals:

  • It’s an important feedback mechanism for mappers to validate their edits and helps to prevent unfavorable fragmentation of tag use.
  • It’s a major part of the public face of OpenStreetMap, for many people the map on osm.org rendered with this style is OpenStreetMap.

I believe that these have been in conflict for a long time (it’s essentially the problem I commented on in 2014). Both requirements are important but (as I’ve said elsewhere) I don’t believe that one style can meet both. We used to have a “show everything” style (Osmarender) that prioritised detail over cartography. Right now we have the data layer:

OSM data layer

but that relies on individual objects rendered by the browser client and simply isn’t practical at anything other than the highest zoom levels. At osm.org we currently have 6 map layers - “OSM Carto”, two cycle maps, two public transport layers, and the “Humanitarian” layer. Arguably none of them satisfy OSM Carto’s “important feedback mechanism” goal.

For completeness, it’s also worth mentioning the OWG’s “New Tile Layer” policy here - interestingly, complementing the existing osm.org map styles isn’t one of the hard criteria set out there, although soft criteria are that it should be “unique” and “interesting”.

Location: Opportunity, Holt County, Nebraska, United States

Discussion

Comment from Rovastar on 6 June 2022 at 12:03

It is impossible to get one style to do everything.

I’ve had no skin in the game for any style for many years but overall I think the OSMCarto does a good job. Probably need to move from tiles to vector based before anything more useful comes along. There we can have thousands of styles easily and ones just for what you want. change the size of walking paths s they look as thick as motorways for veiwing long high level country walks you are can do that, etc

Regarding your style, I am struggling to see some of the differences.

Below we have an unpaved footpath joining onto a paved footpath.

https://map.atownsend.org.uk/maps/map/map.html#zoom=22&lat=52.9321016&lon=-1.5001884

Are these just too similiar to my eyes as I cannot see any difference?

Comment from SomeoneElse on 10 June 2022 at 12:57

Below we have an unpaved footpath joining onto a paved footpath.

For completeness, the paved one is here and the unpaved one is here. There’s actually no difference in the style between paved or unpaved footpaths and paths - if one of them had a lower trail_visibility, or had informal=yes then they would appear like the “informal” example above.

Roads are slightly different - unpaved ones such as this do appear as tracks that everyone can access.

Log in to leave a comment