OpenStreetMap logo OpenStreetMap

SomeoneElse's Diary

Recent diary entries

Made-up names and how to avoid them

Posted by SomeoneElse on 15 August 2017 in English. Last updated on 11 August 2021.

There’s recently been a thread on the talk-gb mailing list where someone has decided that, despite previous custom and practice there, the “name” field in both English- and Welsh-speaking areas of Wales should be a compound of both the English and Welsh names. No-one says “I’m climbing up Snowdon / Yr Wyddfa today”, they’ll use one name or the other, not both together.

In the Welsh-speaking areas the Welsh names are more likely to be used; in the English-speaking areas the English names. It’s not a hard-and-fast rule; this peak in the Black Mountains is referred to about equally by both the Welsh and English names, despite it being in a predominantly English-speaking area.

Wikipedia gives an idea of Welsh-language take-up here. That’s a bit broad-brush; for example I don’t think there’s an isogloss between Carmarthenshire and Swansea where people gain/lose the ability to speak Welsh.

So how is it possible to extract data from OSM with the Welsh name in the Welsh-speaking areas and the English name in English-speaking ones, both when creating e.g. a rendering database for the first time and when updating it as people update OSM? Firstly we’ll just consider the “loading the database” part.

There are a couple of possible solutions to the problem. I used “osmosis”, which has a handy “tag transform” feature. The Welsh one is here; the English one is similar.

Very roughly, the Welsh-speaking area of Wales corresponds to this area. That’s not perfect, but it’s not a bad approximation for a rectangle. I downloaded the latest Welsh data from Geofabrik and cut that area out of it:

osmosis  --read-pbf wales-latest.osm.pbf  --bounding-box left=-4.82 bottom=52.02 right=-3.34 top=53.69 --write-pbf wales_cy_before.pbf

Convert the “Welsh-speaking” part to names based on “name:cy”:

osmosis --read-pbf wales_cy_before.pbf --tag-transform transform_cy.xml --write-pbf wales_cy_after.pbf      

Create a copy of the larger file with names based on “name:en”:

See full entry

Location: Llanigon, Powys, Wales, United Kingdom

I’ve updated the switch2osm “Manually building a tile server (16.04.2 LTS)” page to use the latest version of the osm-carto style, now that the issues underlying this problem have been fixed.

This means that it should be possible to follow these instructions to set up a tileserver from scratch that creates tiles in the same style as OpenStreetMap’s “standard” style in just a few hours (for small areas the longest period of the setup is waiting for the shapefiles used by the style to download).

What would be really useful would be if people could test that these notes do actually work for them - is there anything that should be made clearer, especially to someone who might not be familiar with Linux at all?

A Map Legend

Posted by SomeoneElse on 29 May 2017 in English.

I’ve created a map legend for the map style that I use. It’s a set of map data that can be appended to a rendering database to create a map legend in a blank bit of map (actually in the middle of Australia).

There are currently two parts - linear features and POIs. As far as the map is concerned these are “real POIs” (though they’re never added to OSM itself of course - just added to the rendering database) so you need to zoom in to see some of the POIs such as the one for vending machines, which only appears in this map style from zoom level 19. You could use it with other map styles, but some of the features are dependent on this lua script.

Here’s a preview of what the “roads” part of the legend looks like:

roads

but to use it properly follow the link and move around.

Towards Creating General Melchett's Map

Posted by SomeoneElse on 2 September 2016 in English. Last updated on 26 April 2018.

I’ve written before about the changes needed to render more zoom levels than 18 with a “Switch2Osm-style” tile server.

However, sometimes zoom level 20 isn’t enough. Here:

nott_ajt_20.png

is part of Nottingham at zoom level 20. At least one of the office names doesn’t appear (it corresponds to here in OSM). The problem is that the way that the “standard” renderd stores metatiles means that only a certain number of tiles can be stored for each zoom level (see this list post for the details). In order to store more I changed renderd slightly so that more zoom levels can be stored - see here and here for the details.

Rendering works fine at higher zoom levels (up to 28 in my example) so that all of those office names now appear. Here’s the same area at zoom level 21:

See full entry

Long Distance Footpaths

Posted by SomeoneElse on 3 July 2016 in English. Last updated on 14 July 2016.

Although plenty of maps have displayed long distance footpath information for ages, I’d always assumed that it would take a lot of extra processing to get working. Turns out I was wrong:

Brassington showing the Midshires Way, Limestone Way and High Peak Trail

Because of the way that relations are handled within osm2pgsql, converting route relations into “just another highway type” is pretty straightforward, and once created that new “highway=ldpnwn” can be added to the stylesheet.

In this case the two things to think about are the fill and the text. The “fill” is a short wide purple dot separated by a long gap from the next one. In the code (see the links above) at “line-dasharray” the “1” says “short and the “60” says “separated by a long gap” and further down the “line-width: 4” says “wide”.

See full entry

Creating a Garmin map using "mkgmap" - a very simple example

Posted by SomeoneElse on 14 May 2016 in English. Last updated on 30 November 2019.

On many occasions in the past I’ve said “it’s really easy to create your own Garmin maps” but I don’t think I’ve ever documented the procedure. This is an attempt to do that.

Assumptions:

You’ve got some sort of Garmin device with an SD card in it with some maps that you’ve downloaded from somewhere on it.

You want to replace those with a map you’ve created yourself.

You’ve got a PC with “enough” memory in it. The one I used for the examples below had 4Gb; it’s possible that less may be needed for a small file such as the one used in the examples below.

All the path examples below for for Windows (actually tested on Windows 7), but it should be relatively straightforward to adapt them to work on other operating systems.

What you need to do

The easiest way to create Garmin maps from OSM data is to use “mkgmap”. That’s available from:

http://www.mkgmap.org.uk/

The download page for the latest mkgmap is http://www.mkgmap.org.uk/download/mkgmap.html and the current version is “3676”.

Unzip the zip file and move the folders intact to a known location. In my case I moved it so that “mkgmap.jar” file was in: C:\Utils\mkgmap-r3676

I didn’t use a path with a space in it or a path that Windows recognises as “special” to avoid any possible confusion later.

“Splitter” is a separate program used to split a large OSM data file into portions small enough for mkgmap to work with (the resultant Garmin map can still route between portions).

The latest Splitter is here: http://www.mkgmap.org.uk/download/splitter.html and the current version is “437”.

Unzip the zip file and move the folders intact to a known location. In my case I moved it so that splitter.jar was in: C:\Utils\splitter-r437

Next, we need to download an OSM extract to use to create maps from. As an example I’ll use Romania, and extract for which can be downloaded from here:

http://download.geofabrik.de/europe/romania.html

That page currently says:

See full entry

Trees (again)

Posted by SomeoneElse on 26 April 2016 in English.

A while back I described how I was showing tree types in woodland. The “unfinished business” there was “what about forest areas where the trees have been cleared?”. Mapping of that is a bit hit and miss. “Forestry” has been suggested, but doesn’t have many takers, and “forest” is actually often used for “the entire forestry area” (at least where I’m interested in rendering tiles for - I suspect it varies considerably worldwide). The wiki page and the standard style rendering discussion don’t distinguish, but I thought it was worth trying to separate out “natural=wood” and “landuse=forest” where the latter is used for “the entire forestry area, including where there are currently no trees”.

Here’s the result:

Trees east of Bolsover

See full entry

Sidewalks!

Posted by SomeoneElse on 13 March 2016 in English.

(or if you’re English, “Pavements!”)

I finally got this working for tertiary and secondary roads:

Sidewalk rendering example

That location corresponds to here in OSM.

There were three bits to it:

1) Determining which roads should have a sidewalk rendered. This is done in lua, and creates e.g. a road type “tertiary_sidewalk” to go with “tertiary” and “tertiary_link”:

https://github.com/SomeoneElseOSM/SomeoneElse-style/blob/sidewalk/style.lua#L230

2) Handle “tertiary_link” the same as “tertiary” in the style’s MML, e.g.:

https://github.com/SomeoneElseOSM/openstreetmap-carto-AJT/blob/sidewalk/project.mml#L403

3) Handle “tertiary_link” the same as “tertiary” in the style’s roads.mss, e.g.:

https://github.com/SomeoneElseOSM/openstreetmap-carto-AJT/blob/sidewalk/roads.mss#L2363

… except where we want to do something different:

https://github.com/SomeoneElseOSM/openstreetmap-carto-AJT/blob/sidewalk/roads.mss#L1114

“sidewalk_width-z13” etc. are declared at the top:

See full entry

Trees!

Posted by SomeoneElse on 14 June 2015 in English.

As you may be aware, mapping of areas of trees in OSM is complicated. It’s not possible to tell just by looking at the data which of the four(!) approaches described on that page someone is using “natural=wood” and/or “landuse=forest” to mean. It therefore didn’t make a lot of sense to me to display them differently on a map created from OSM data.

See full entry

Notes and Fixmes

Posted by SomeoneElse on 22 December 2014 in English.

A while back I wrote https://github.com/SomeoneElseOSM/Notes01 to enable OSM notes to be converted to a useful Garmin format so that you can actually check them when out and about.

A week ago I added support for extracting “fixme” tags from Overpass. There are about 20 notes within 9km of my house, so I was interested to see how many fixmes there were. It turned out that there were 430! As someone said on IRC, “that’ll keep you busy over Christmas”.

Best Regards,

Andy