OpenStreetMap logo OpenStreetMap

Anton Khorev's Diary

Recent diary entries

OSM link previews

Posted by Anton Khorev on 30 July 2025 in English. Last updated on 4 August 2025.

Some websites allow users to post content with links to other sites and have previews for these links displayed alongside with the posts. Those are typically social media sites, and we’ll refer to them as “social media” in this diary entry. Examples of such sites include: - forums based on Discourse, particularly OpenStreetMap Community Forum - microblogging platforms based on Mastodon, particularly en.osm.town

There are many more of course, with some more widely known examples, such as Facebook and Twitter. We’re primarily interested in the listed above because they are directly related to OpenStreetMap.

A preview usually includes a page title followed by a longer description and an image. Typically when a submitter makes a post with a link, the social media site runs a bot to download the linked web page and scan it for metadata. The metadata usually includes textual attributes and links to preview images. The bot then downloads the images and assembles the final preview to be shown to other users.

Metadata

Here we’re interested in previews of pages on the OpenStreetMap website. Usually the links someone posts are to pages of map locations, editable osm elements (nodes, ways and relations), changesets and diary entries. All of those pages include metadata in one of the formats suitable to generate previews, The Open Graph protocol. The Open Graph metadata consists of several <meta> html elements inside the web page <head>.

The degree to which metadata on OpenStreetMap website pages allows generation of a useful previews however varies. Metadata on diary pages is usually sufficient to build reasonable previews. As an example, we can look at the html source of this diary entry:

See full entry

iD on a phone

Posted by Anton Khorev on 20 April 2023 in English.

Normally the edit button on the osm website is hidden on phones. That’s because you probably don’t have any remote-control-capable editor installed and iD is unusable on small screens. What you’re supposed to do instead is open the Share tool and tap the Geo URI link. This will let you launch any app that understands Geo URIs such as Vespucci.

But to my surprise I was able to use iD on a phone. My note viewer has a tool to open iD on the current map location. It should work similarly to the Edit button except it won’t disappear if the screen is too small. Actually it is hidden by default because too many tools would clutter small screens. But you can always add it back by pressing the ⚙️ button.

When I opened the link, I noticed that iD looks differently compared to what you usually get on a phone. I expected to get that oversized sidebar covering most of the screen. Instead I got everything scaled down to fit on the screen. That happened not because of any changes in iD but because note-viewer opens iD differently.

See full entry

In case you wanted to use my note viewer with another openstreetmap-website-based project - now you can. Although most likely you didn’t because there aren’t many of them and they don’t use notes actively. Additional projects that note-viewer is already configured to work with are:

It’s not a surprise that notes aren’t heavily used in these projects. Often you place a note where the map diverges from reality and you can’t edit the map at the moment. But neither OpenHistoricalMap nor OpenGeofiction represent something that is currently real. Right now OpenGeofiction has less than 100 notes, and it’s not obvious if that project even needs notes. Maybe they might use notes to coordinate editing of their collaborative territories?

Now you can also edit the loaded and selected notes by commenting, closing or reopening them. This might be useful to deal with several notes at once. Actually it was one of the original plans for note-viewer. The situations where it’s helpful include someone modifying a lot of notes without a good reason. For example, users sometimes close existing notes without making any map modifications or providing reasons why the notes are irrelevant. They may do this because open notes look wrong (red with x marks) and closed notes look right (green with ticks). Closing a note may look like confirming it. Probably that’s why users sometimes close even their own notes without making any edits. Now it’s possible to quickly deal with such note modifications by searching for a given username, followed by filtering for user’s close actions, selecting all filtered notes and reopening them.

See full entry

In my last diary entry I wrote about putting the requested note ids into url. I said that it’s likely not going to be a problem because ids are stored in the url part that’s not sent over HTTP therefore it doesn’t matter how long is this part, how many ids it contains. That was said about a typical output of neis-one.org note feeds for countries that contain updates dating back up to a week. For a busy country that’s usually a few hundred notes. Concatenated with single-character separators they result in a few thousand character string appended to a url.

Feeds are not the only way to get note ids from neis-one.org. In fact you may no even want to get notes from the feeds because of their one week age limit. There are regular html pages for each country too, one for all notes, another for open notes. They likely contain more notes than the feeds do. The open notes pages, which are of interest to someone who wants to resolve notes in a given country, can have up to ten thousand notes. I added options to open those with note-viewer, along with arbitrary html files. The last two options in the neis-one.org Get … notes for this country dropdown of the XML tab set up the selector (cells in second columns of tables from neis-one.org webpages) and open the webpage that you have to save to a file and then open that file with note-viewer. Unlike the xml feeds, even Firefox won’t start the download automatically.

See full entry