OpenStreetMap

richlv's Diary

Recent diary entries

Comparing GoPro Hero11 and Max360

Posted by richlv on 13 April 2024 in English.

Having both GoPro Hero11 and Max360, I was curious whether there would be any use from running both cameras at the same time. While Max 360 captures all around, would Hero 11 possibly have better resolution, which could be useful for streetview platforms like Mapillary and Panoramax, thus also providing additional detail for OSM mapping?

Here’s the same object - a surveillance camera - from both action cameras. Hero11 is even a little bit further away.

Max360: Max360

Hero11: Hero11

As can be seen, Hero11 does offer notably better resolution, which could be crucial with signs and other objects - thus it does make sense to collect imagery with two cameras like that at the same time.

A wonderful way to learn Overpass

Posted by richlv on 14 July 2023 in English.

There’s this absolutely marvelous tool that offers Overpass tutorial with a storytelling approach. You get hints at how queries should be modified, and can try them out against real data, progressing as you find new bits of information from OSM data.

Learn Overpass

Unfortunately, it’s a bit out of date compared to the current live data in the OSM database, and breaks somewhere around step 6.

Still, even if you haven’t used Overpass before, the first five steps can be useful - and maybe the project gets revived :)

Extracting GPX from Mapillary sequences

Posted by richlv on 27 December 2022 in English.

In the past, Mapillary offered a feature to grab a GPX from image sequences. That feature disappeared at some point, but it would still be useful to get a GPX - to use for OSM, upload to Strava or anything else.

Introducing a quick script to do so - mapillary_to_gpx.pl at https://github.com/richlv/perlscripts .

Example usage:

token='MLY|YOUR|TOKEN'; perl mapillary_to_gpx.pl --image 5652368314832935,5496261470483015,567554981851978,1352688202152043,817276516001059,893732341631081,1833835560326099,670881348042382 --token $token --tzoffset 2 --debug > reezekne2.gpx

Cleaning up large, untagged ways

Posted by richlv on 22 February 2022 in English. Last updated on 23 February 2022.

Sometimes one might want to clean up some features in OSM - for example, untagged ways that are not members of any relations. Such ways sometimes are left behind by wide-sweeping but perhaps less careful changes to forests and other areas. If such ways are short, it’s easy - but if they are very large, downloading a huge area in JOSM is not the best approach.

As I tend to forget the process to do this, documenting it here.

Knowing the object (way) ID, we can use the “File -> Download object…” functionality (Ctrl/Cmd+shift+o):

That opens the object download dialogue, where the way ID is pasted and “Object type” is set to “way”:

After downloading the object, we could delete it and upload our changes… but with long ways it will likely fail, as some nodes from this way are used by other ways. Even though the object download dialog has a “Download referers” option, that only handles parent relations. There’s even an explicit note about this in the “Download object” documentation page.

So how could we also get all the ways that include any of the nodes in our way to be deleted?

  1. Select the way and choose “Selection -> Adjacent nodes” (e).
  2. Select “File -> Download parent ways and relations” (Ctrl+alt/opt+d).

Another option would be to use object downloading dialog in step two again - with nodes selected, it attempts to auto-populate the “Object ID” field (big thanks to kaptaptuka from #osm for this tip). Unfortunately, that fails with many nodes.

Retrieving notes with a Perl script

Posted by richlv on 25 September 2015 in English.

OSM notes

OpenStreetMap website allows users to add notes. Adding a note They are supposed to be used when there’s something to be improved on the map, but the person can not do that for some reason - maybe no time to survey it right now, or maybe it’s an external visitor who does not have the knowledge to contribute the fix directly.

Existing notes can be commented on and eventually resolved by contributors. A note with comments Often a contributor might want to place notes on their GPS device or phone to go and survey the reported fix/change, but the OSM Notes API returns a GPX file that is not very suitable for that - it has a CDATA section, some tags and ends up being very hard to use - or on some devices, the actual note text ends up being trimmed.

Getting notes that way isn’t very easy either, because one has to construct a URL, and, in the case of bounding box… ugh. Which field goes where, that’s something I always have trouble with. There’s a feature request to allow exporting note GPX from the main OSM site, but that requires some effort and has not happened yet.

Existing tools to retrieve them

Let’s turn to external tools. There was a great tool by SomeoneElse Notes01, but it was written in Java. While Java is the king for enterprise systems, it seemed a bit of an overkill for OSM note downloading and compiling it (following latest-latest is important in open source :) ) did not seem that appealing either.

Well, all that, plus a small interest in playing with Perl - I have no coding skills, but expanding past shell scripting has been on my todo list for a while.

Introducing osmnotes

So enter “osmnotes”. My first thing from the scratch in Perl, so probably awful - feedback highly, highly welcome.

It allows to:

  • retrieve notes by note ID (just copy it from osm.org)
  • retrieve notes by bounding box (ugh, lat/lon/what…)
  • retrieve notes by specifying corners as osm.org URLs
  • retrieve notes for a pre-defined region

The first two are probably self-explanatory. Getting by note ID:

perl osmnotes.pl --noteid 13,14
perl osmnotes.pl --noteid 13 --noteid 14

Getting by bbox:

perl osmnotes.pl --bbox 23.9131,56.8792,24.3938,57.0995

What’s more interesting and maybe easier to use - getting by corners and regions. “Corners” means top left and bottom right - and you can just go to osm.org, position the map and copy the URL for both. For more precise positioning use the sharing with a marker. An example invocation:

perl osmnotes.pl --topleft "http://www.openstreetmap.org/#map=11/57.2038/24.7838&layers=N" \
--bottomright "http://www.openstreetmap.org/?mlat=57.1219&mlon=24.9424#map=11/57.1219/24.9424&layers=N"

And what if there’s a region you would like to reuse? That can be saved in a JSON file. Once done so, it can be reused like this:

perl osmnotes.pl --region latvia:riga
perl osmnotes.pl --region latvia

You can combine node IDs, bboxes, regions, corners… it will just go and download it all. You should still take care of overlapping bboxes, duplicate notes are not handled in any way for now.

So, um, here’s the github project and you are welcome to try it out and provide any and all feedback :)