OpenStreetMap

Polyglot's diary

Recent diary entries

OSCAL 2019 in Tirana

Posted by Polyglot on 21 May 2019 in English (English)

I went to the OSCAL conference about Open Source software and OpenStreetMap in Tirana. It took me 3 years to finally decide to go ahead and do it and I had no idea what to expect when I arrived. But once I was there, I very quickly noticed that everything is perfectly fine and safe in the streets of Tirana. When I arrived at the conference I received a very warm welcome from the organisers who form a very active community in their local hackerspace. I was very happy that I could share some of my experience with OSM, OsmAND and Mapillary, and of course the PT_Assistant plugin. While walking between AirBNB and the venue, I tried to make as many pictures for Mapillary as I could, even on the bus to the airport: https://www.mapillary.com/map/im/k7CBwtE2S8quA5LUvfq19Q (They seem to need cycle highways there too, this guy is risking his life on the motorway)

I tried to get JOSM going on the computers in the classrooms, but that wasn’t a great success, as Java wasn’t installed on the Windows and the virtual machines with Ubuntu didn’t have enough memory to work very well. My plan now is to show the possibilities of JOSM and QGIS during Hangout sessions, maybe Hangout on Air. I never tried that before, but it should work quite well and it’s a great way to overcome the physical distance between us in the period between conferences :-)

Location: Njësia Bashkiake Nr. 9, Tiranë, Tirana Municipally, Tirana County, Central Albania, 1001-1028, Albania

QGIS 3 create a map of Brussels

Posted by Polyglot on 6 March 2019 in English (English)

I started by installing the QuickOSM plugin.

I clicked on the green looking glass in the new toolbar that appeared.

Query

Key: highway In Brussels

Run Query

It downloaded every highway in the zip code 1000 Brussels.

Now I want to show labels for the street names.

On the middle layer (the one with a horizontal line), I press right mouse button, then Styles / Add,

named it Streetnames.

Right Mouse Button on the layer, then Properties.

Labels

Single labels

Label with: abc name.

Size 7.0000

Color: Blue

On the nodes layer, remove all those red dots by going to Symbology and making them smaller.

Project Create Print Layout

Layout/Layout Properties

Add a new map to the layout.

Under Item Properties, it’s possible to set the scale.

I need a larger sheet of paper, if I want those street names to be readable.

Not sure where to set the paper size. All in all not very complicated, but I guess reading the manual wouldn’ t hurt.

Location: Les Marolles - Marollen, Brussels, Ville de Bruxelles - Stad Brussel, Brussels-Capital, Belgium

Ulm ÖPNV-Mapathon

Posted by Polyglot on 9 February 2019 in English (English)

On Saturday the 2nd of February 2019 I went to this event thanks to a grant from Wikimedia Belgium to get me here with 3 fast trains and a somewhat slower one. That last one had to go uphill ALL the time tough, so it had a good excuse :-)

I demoed the PT_Assistant plugin, obviously and had the opportunity to network with several OpenStreetMap contributors who are interested in mapping public transport stops, itineraries and lines like I am.

In the beginning we got an interesting talk about “sustainable transport”, i.e. our generation fulfilling our transport needs without preventing the next generation(s) from doing so as well.

ToniE demoed his Perl script which performs validation on a selection of German PT networks and publishes them as web reports.

We also got a nice presentation of OpenTripPlanner. I hadn’t realised previously how useful it is for multimodal travel.

We may not have mapped a great amount on this day, but discussing how to go about it and exchanging experiences and views on the topic is obviously a very valuable exercise.

The hackerspace in Ulm has marvellous infrastructure, it has to be said. Great idea to have this kind of event there.

Location: Fischerviertel, Weststadt, Arbeitersiedlung Untere Bleiche, Ulm, Regierungsbezirk Tübingen, Baden-Württemberg, 89073, Germany

Karlsruhe Hack Weekend

Posted by Polyglot on 1 December 2018 in English (English)

In October I went the Hack Weekend in Karlsruhe. It was great to meet with several of the developers of our beloved JOSM editor.

I was also able to demo the new features of PT_Assistant to people with a similar interest in the mapping of public transport.

I think the turn-by-turn based composing of itineraries is a big step forward. If the routing helper can find valid itineraries in other route relations, it will propose those as well. The user can then select 1,2,..,5. It is also possible to backtrack using 9, or to skip using 7.

Now I started working on validating the names, from and to tags in the route’s names. And proposing to add a route for the opposite direction of travel when converting to PT v2.

If no route_master exists yet, the plugin will propose to create one.

Location: Weststadt Mittlerer Teil, Weststadt, Karlsruhe, Regierungsbezirk Karlsruhe, Baden-Württemberg, 76133, Germany

JOSM's PT_Assistant learned a few new tricks

Posted by Polyglot on 13 August 2018 in English (English)

This summer Biswesh Mohapatra continued the work started by Darya Golovko and continued by Giacomo Servadei. The first year the main focus was on creating validator rules, that needed more advanced processing than what was possible using MapCSS. A layer for visualising the stops and itineraries of the currently selected route relation, was also a big step forward to get visual feedback about what happened when editing itineraries.

The second year Giacomo added the roundabout splitter, which takes care of all the route relations crossing it, so only those ways that are traversed remain. He also added a map mode that adds a node to terminate the itineraries, splits the ways automatically and only keeps the relevant part in all the route relations affected. Depending on the settings, this node also gets the tag public_transport=stop_position and tags for the mode of transport. Giacomo also added the ability to sort the stops in the route relations based on the order of the ways. He also added functionality to visualise bicycle and foot route relations. Especially for bicycle route relations, this helps a lot to get the ways in the right order and with the correct roles, where the path forks.

PT_Assistant visualisation layer

Biswesh started this summer by adding a map mode for ‘double splitting’ ways, which comes in handy, when you want to add bridges, tunnels, bus bays or traffic calming tables. This even works on 2 ways sharing a common node. You should try it! That functionality alone is worth installing the PT_Assistant plugin.

Then he added a wizard to help you set up the JOSM environment to make mapping of public transport more convenient. I’m afraid we got distracted by other things before it was completely finished though. Noémie asked me where those ‘specialised’ overpass queries went to. We’ll have to look into that. They will probably end up in the history pane of the download window.

He improved the roundabout splitter, which had some quirks and he added support for bicycle route relations to it. We all know those are a challenge to get right.

For the cherry on the pie, some changes were needed in JOSM core. We needed the ability to add some extra buttons to the relation editor. Thank you Michael Zangl for making the necessary changes in core to make this possible!

One of those buttons now enables you to sort stops from within the relation editor, instead of on the selected route relations.

You can find links to screencast videos on the documentation page on the wiki

Routing helper Turn-by-turn mode

The button that may completely change how we map bus lines, is what many of you will appreciate the most. We started calling it the ‘Routing Helper’, for lack of a better name. You could also call it ‘Add ways up to next intersection and then ask user where to turn to’. It will however, also look at other route relations and if it finds one with the same 2 ways in it, one were it is at that point in the itinerary and the next one in the route relation, it will present this as option 0. This will usually present suggestions covering a longer distance. It won’t suggest sequences that are not continuous, that travel against oneway traffic, or that don’t heed turn restrictions correctly.

Routing helper Fast Forward mode

Since our route relations tend to be extremely repetitious, this will mean that if a route between 2 stops is mapped once, it will then be proposed for ‘reuse’ in other route relations.

This will be a big step forward and away from:

  • select ways
  • select a node
  • split
  • deselect one part
  • add to relation editor
  • sort
  • rinse
  • repeat.

Pressing those numbers may become a bit tedious at times, but it’s at least 10 times more efficient than the list of actions above.

Cartographie du réseau de bus à Dakar

Posted by Polyglot on 1 August 2018 in French (Français)

En 2014 Odette Mendy a réalisé un travail de diplôme BTS Géomatique concernant le transport en commun à Dakar. A l’époque elle a utilisé ODK-collect pour répérer les arrêts et ARCGIS pour cartographier les lignes.

Par la suite elle a voulu partager ce travail avec le grand public. OpenStreetMap était le choix logique. Elle a trouvé la communauté OpenStreetMap Sénégal très accueillante et ils se sont organisé pour entâmer ce travail de grande envergure. L’été de 2018 le réseau du département de Dakar est maintenant complètement cartographié. La communauté souhaite élargir ce projet pour les autres localités de Dakar et pour l’ensemble du pays.

Ceux qui ont participé :

Odette MENDY avec l’aide de Ibrahim SANA et Inocent DIBLONI de la communauté OSM Burkina et les membre de la communauté OSM-Sénégal

Lamine NDIAYE Jean Marie MANCABOU Amadou NDONG Ismaïla SEYE Rokhaya SECK Alassane CISS Bougouma Lamine NDAO

Odette Mendy

Location: Plateau, Dakar, 99900, Sénégal

public_transport=stop_position nodes

Posted by Polyglot on 23 July 2018 in English (English)

It’s no secret that I’m trying to figure out how to simplify mapping of public transport to bring it within reach of all mappers. All without losing the ability to map stops, lines and itineraries in full detail without any limitations. My vision is that a stop with no discernible objects in the middle of nowhere and a stop with all possible equipment should be mapped exactly the same: as a NODE next to the highway/railway.

There are many stop_position nodes I added over time that don’t serve much of a purpose, but then there are some that PT_Assistant’s validator actually started to depend on. It’s those that ‘terminate’ itinerary variations.

Maybe we should get terminology defined first.

What I call a line, is represented as route_master relations in OSM (and confusingly found in routes.txt in GTFS). What I call an itinerary or itinerary variation is represented as route relations in OSM. And stops, well I’d say highway=bus_stop, railway=tram_stop, railway=halt to begin with and public_transport=platform + mode of transport, if you like.

Anyway, stop_position nodes as indication of where an itinerary starts/ends (and splitting the way on those nodes) does make sense.

I still wouldn’t add them for each and every stop though, I still wouldn’t add any details like name on them and I definitely wouldn’t add them to the route relations though. That’s what the nodes next to the highway/railway are used for.

public_transport tags don't add any information

Posted by Polyglot on 19 July 2018 in English (English)

In 2012, the ‘new’ public_transport scheme was voted. What seemed like a good idea at first, has not led to unification though. I was not smart enough at the time to see how this would develop, but today with the benefit of 20/20 hindsight it it’s apparent that we are on the wrong track.

The way the wiki formulates it at present, even though I have tried over the years to keep it in check, we should supposedly map 2 objects for each and every stop and then add both of these to the route relations.

I’m sorry, but that is unacceptable! For one thing, I need a SINGLE object, preferably a node where all the details of the stop go. That has always been the way we do things in OpenStreetMap. The node that gets the stop_position tag is NOT suitable for that purpose, as it is not immediately apparent on what side of the street the stop is.

So, over the years I have tried to work with public_transport=platform and stop_position tags on the stop nodes I’ve been mapping. The idea was that, in time, highway=bus_stop would be replaced by those tags. Only that is not possible, for one thing, those nodes we’re mapping to represent the stops, were not supposed to have a mode of transport on them. So it is utterly impossible to drop highway=bus_stop from those nodes.

OK, let’s step back for a moment: highway=bus_stop is here to stay, wait for it… it’s coming… the conclusion: public_transport=platform tags are NOT ADDING any information. highway=bus_stop says it all. Sorry that it took me a few years to figure that out!

Of course, now the epiphany dawned on me, I decided to revisit all 70000 bus stops around Belgium. So since yesterday I started to remove public_transport=platform/bus=yes tags from all those stops, in packages of about 100-150. Obviously that’s not all I’m doing, some stops have moved, we have better imagery now than we did 5 years ago, there is a new bus_bay tag since last summer. It will take 6 to 12 months to complete this mission, but soon those tags that don’t add actual information will disappear from sight.

It’s time we came up with a scheme to map public transport that is: * easy to work with * easy to maintain * easy to visualise and that: * does not duplicate information * does not force mappers to add 2 objects to route relations

I have a clear vision of how we can accomplish that.

I changed my vote for the PT "v2" scheme to no

Posted by Polyglot on 8 July 2018 in English (English)

It seemed like a good idea on the face of it. Stops on the highway became public_transport=stop_position, stops next to it public_transport=platform.

But then it was suddenly necessary to add both these objects to the route relations. Already the fact that more than one object became necessary to describe a single bus stop, should have raised alarm bells.

There are, of course, some positive things to say about to say about the new scheme. A route_master relation for a whole line. route relations to describe the various itineraries and stops.

But the stops, that’s where it goes seriously wrong. Why on earth is it necessary to add 2 objects to those route relations? As they describe all the variations, there are a lot of them. Lots of work to maintain them. And they break easily.

After the scheme was voted, I was trying my best to map stops according to it. I had my highway=bus_stop nodes which were all nicely positioned next to the highways, so it’s clear on which side of the road they are located.

So I asked on the mailing list: hey what public_transport to use for them? The answer was public_transport=platform. So far, so good.

Since I had 40000 stops to add for half of a small country, I was not going to bother with adding stop_position nodes as well. So I trudged along for a few years.

In the mean time in Germany and France they had a different idea, let’s convert those nodes next to the highway to platform ways (regardless of whether there was an actual platform present in some cases), oh and those stop_position nodes, let’s duplicate all the details for the stops.

So, for the sake of simplicity, I would like us all to come back to our senses. Map each bus stop, exactly once on a node next to the highways and only add these nodes to the route relations. That’s how I will continue to do it in Belgium, although unfortunately in Brussels somebody already started adding stop_position nodes everywhere and adding them to the route relations. Oh well.

So I’m not sure if it will ever happen that we all move to a more sensible scheme, but in case it doesn’t, I promise to continue moaning and bitching about this overly complex way of mapping public transport.

Polyglot

QGIS 3 on Linux Mint

Posted by Polyglot on 10 March 2018 in English (English)

I finally managed to install QGIS 3 on my favourite linux distro. The magic incantation was found here:

sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-key 073D307A618E5811

echo “deb http://qgis.org/ubuntugis xenial main” > /etc/apt/sources.list.d/qgis.list

echo “deb-src http://qgis.org/ubuntugis xenial main” » /etc/apt/sources.list.d/qgis.list

echo “deb http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu xenial main” > /etc/apt/sources.list.d/ubuntugis-unstable.list

echo “deb-src http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu xenial main” » /etc/apt/sources.list.d/ubuntugis-unstable.list

sudo apt-get update

sudo apt-get install qgis python-qgis qgis-plugin-grass

for some plugins QtWebKit is needed:

sudo apt-get install libqtwebkit-dev python3-pip python3-setuptools

pip install jupyter==1.0.0 qtconsole


To be able to develop Python scripts I did the following:

apt autoremove echo “deb http://qgis.org/ubuntugis xenial main” > /etc/apt/sources.list.d/qgis.list echo “deb-src http://qgis.org/ubuntugis xenial main” » /etc/apt/sources.list.d/qgis.list echo “deb http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu xenial main” > /etc/apt/sources.list.d/ubuntugis-unstable.list echo “deb-src http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu xenial main” » /etc/apt/sources.list.d/ubuntugis-unstable.list sudo apt-get update sudo apt-get install aptitude aptitude install qgis python-qgis javascript-common liblwgeom-dev python3-tk apt-get install Qt5-Support apt-get install qt5-designer sudo apt-get install qttools5-dev-tools sudo apt-get install python3-pyqt5.qtsql sudo apt-get install postgresql-client libpq-dev pgadmin3 sudo apt install libqt5sql5-psql sudo apt install pyqt5-dev-tools

PT v3 some thoughts

Posted by Polyglot on 21 December 2017 in English (English)

There is some talk about a new scheme for mapping public transport on the German forum.

I’ll try to list some requirements such a scheme should have:

STOPS

  • It should be easier to map than the mess v2 has become.
  • Simple for simple cases
  • Scalable to more complex cases, without the need to convert nodes to ways or relations.
  • Details like ref, route_ref, operator, network, zone should only appear on a single object.
  • By looking at this object it is immediately clear on which side of the road the stop is located.

ROUTES

  • The object that represents a stop for a single direction of travel only appears once in the route relations.
  • easy to understand, for anybody who bothers to look inside the relation
  • straightforward to process for map rendering
  • This means that a scheme with ‘hints’ about the routes, using reference points along the way, is not suitable.
  • one route relation per variation of the itinerary

It doesn’t really matter that highway=bus_stop, railway=*, highway/railway=platform are used in combination with public_transport tags. Rendering doesn’t seem to be able to go without the ‘deprecated’ tags. Mapping (using JOSM) is more convenient when using public_transport style tags (roles are set automatically for example).

From the above requirements the only logical solution is to use a node to represent the bus stops. highway=bus_stop / railway=tram_stop bus=yes / tram=yes public_transport=platform

If an actual platform is present where passengers can wait, it can be mapped as a way/area using highway=platform and/or railway=platform. No need for public_transport=platform on these areas, lest someone might say we’re mapping platforms twice. And no need for adding these objects to the route relations. They can be added to stop_area relations. My personal preference would be one such stop_area relation per direction of travel, or per platform in bus stations.

I’m preparing a proposal here: https://wiki.openstreetmap.org/wiki/User:Polyglot/Bus_stops_and_routes

Frustration about iD editor's inability to easily draw rectangular buildings

Posted by Polyglot on 15 December 2017 in English (English)

This tweet inspired me to write a new diary entry.

BHousel does not like the criticism he’s been getting for several years now.

Drawing rectangular buildings using the iD editor is a lot harder than it ought to be.

My opinion is that if you create a tool that is going to be used by thousands of mappers, you owe it to your users to make sure that they can produce quality work with ease. Especially if the effort to do so would outweigh by an enormous ratio the frustration shoddy work creates for HOT’s validators (and (re)mappers using that other mapping tool), who need to put more time into fixing the mess, than they would have actually mapping those buildings themselves in the first place. It’s not like the science of creating a rectangle based on adding 3 points using 3 clicks still needs to be invented.

This is an ongoing problem for many years. So either it gets fixed one day, or frustrated messages will happen to escape, every once in a while. Or they will get muffled and HOT validators will continue to silently give up on trying to fix the deluge of poorly mapped buildings. Or you can simply unsubscribe from HOT’s Twitter feed. Whatever works for you.

A more constructive solution would be to invite other programmers into the project. I can’t imagine there wouldn’t be candidates.

Here’s hoping that something good can come out of this.

Polyglot

diary spam

Posted by Polyglot on 25 September 2017 in English (English)

I’m looking at the diary entries once a day now. All too often there is spam content. What can we do about this? Maybe a vote button and if 3 people mark an entry as spam, it is removed from view and verified by an admin?

Jo

GSoC 2017 PT_Assistant plugin for JOSM

Posted by Polyglot on 17 September 2017 in English (English)

Giacomo Servadei continued to work on the PT_Assistant plugin for JOSM

Hiking, bicycle and equestrian routes

The plugin is not just about public transport anymore, it can also highlight hiking and bicycle routes and report problems with their continuity. It now also visualizes forward/backward roles, which makes editing them a lot more convenient.

One of the problems I noticed over the past year, was that while fixing public transport route relations, sometimes foot and bicycle routes were broken and the validator didn’t warn about this. The other problem is that when bicycle routes fork, forward and backward roles are needed, but they depend on the direction of the way and those little arrows are very hard to see.

Now one leg is coloured in blue, the other in red, which makes it immediately obvious whether the route is mapped correctly and it’s easier to know if forward needs to become backward or vice versa.

forked bicycle route relation

Public transport improvements

## Tools

  • The plugin can now sort stops according to the sequence of the ways in the route relations.

  • It can help with splitting roundabouts, while keeping the route relations that pass over them correct

  • There is a new map mode to add stop_position nodes. If such nodes are added to the first or last ways of the itinerary, the way is split and only the pertinent part is kept.

  • And there is a new map mode to help with ways selection. It will select all ways in between 2 forks, which are suitable for the mode of transport worked on. At the moment this defaults to bus.

Validation

There are also some new categories of problems the plugin reports and proposes fixes for.

  • gaps of a single (suitable) way + automatic fix

  • a bug with the detection of relations that could be fixed by simply sorting the ways was fixed.

  • a new category will tell the mapper about relations that end up with less gaps when the ways are sorted. This can help detect routes tagged with public_transport:version=2, which aren’t composed of a simple sorted sequence of ways for each variation, but instead still have ways for both/all directions of travel in them.

  • There is a new category for routes that don’t start or end neatly on a stop_position node near to a corresponding platform node.

  • The names of the first and last stops are compared to from and to tags in the route relations.

  • A warning is given if the first or last way don’t correspond to the first or last stop in the route relation.

GSoC 2017 JOSM

Posted by Polyglot on 13 September 2017 in English (English)

Bogdans Afonins made several improvements to JOSM’s search and to the download dialog:

Search dialog

JOSM search dialog now includes search based on presets

Search is incredibly powerful in JOSM. It’s possible to add buttons to the toolbar for searches you need over and over again. Some examples:

Select all ways of a roundabout or a closed oneway way, which is in view plus all the nodes of that roundabout that have more than 1 one way connecting to it:

R inview ((junction=roundabout OR closed  oneway=yes) OR ways:2- child (junction=roundabout OR closed oneway=yes))

I use this to make them round and distribute the nodes or to conveniently select all the ways of a roundabout after it was split.

Find all routes that are already public_transport:version=2, which have members in view and which were modified:

R "public_transport:version"=2 route=bus inview modified

Download dialog

JOSM new download dialog with Overpass API wizard

The wizard works like in Overpass Turbo, but of course the output will be set to meta, so JOSM can digest it.

Some examples:

[out:xml][timeout:325][bbox:{{bbox}}];
(
  (
    node["highway"="bus_stop"];
    node["public_transport"="platform"]["train"!="yes"]["ferry"!="yes"];
    node["public_transport"="stop_position"]["train"!="yes"]["ferry"!="yes"];
  );
  ._;<;
  way["highway"="platform"];
  way["amenity"="shelter"];
  node["amenity"="shelter"];
  relation["route"="bus"];
);
(._;>;);
out meta;

This will download a skeleton of all bus routes in a the selected region. It’s a bit complicated, but sometimes it’s easier to go from complex to simple, by removing what is not needed for your use case.

Another one (now that I’m on a roll):

[out:xml][timeout:325][bbox:{{bbox}}];
    node["highway"="bus_stop"]["public_transport"!="platform"]->.allbusstopnodes;
    way["highway"];>;._->.allhighwaynodes;
    (.allbusstopnodes - .allhighwaynodes;);
out meta;

This stores all highway=bus_stop nodes in the selected bbox, which don’t have public_transport tags yet in a named container. Then it puts all highway nodes in another. Then it subtracts these, resulting in all highway=bus_stop nodes, which are not part of highway ways.

bus stops

Posted by Polyglot on 17 August 2017 in English (English)

Over the past few years, I’ve been mapping a lot of bus stops and routes. Over the past few months I’ve been looking around how it’s done in other places around the world.

What I find (this may of course be influenced by what I wanted to find) is that most bus stops start out as a node next to the way, tagged highway=bus_stop, usually with a name on it.

Then somebody comes along, who glues it to the way. Then somebody else comes along who maps a platform next to the way, using a way, copying all the tags over. They do this regardless of the whether a platform actually exists. They think they need this to add 2 objects per stop to the route relations. Somehow the wiki convinces them of the need for this.

Mapping platforms as ways where there aren’t actual platforms feels wrong to me. Adding a set of details to more than one object also doesn’t feel like the most sensible thing to do. Adding 2 objects to each route relation for 1 real life object makes working with these route relations harder to do.

I’d like to see that a casual mapper can start out mapping a bus stop as a node next to the way, as highway=bus_stop.

Possibly they add public_transport=platform to this node. It seems odd to do so, even if no platform is there, but that’s how things evolved. Tagging it as public_transport=platform means that a role platform will be assigned to it in the route relation. (if the route relation has public_transpot:version=2). It’s the answer I got when I asked the question a few years back on the mailing list. I usually put that node more or less where the pole is. But the exact position is not all that important, as long as it’s more or less where passengers will be waiting.

As far as I’m concerned this node is what represents the bus stop at this side of the street, so it seems obvious that this is the node that should be added to the route relations. The nice thing about doing it that way, is that there is no need to transfer details or relation membership from one object to another. This node is there for the lifetime of the stop. One object to work with, containing all the details, including directly available coordinates.

Now the stop_position nodes. First off, I don’t see a need to map all of them and since where I map bus lines they are not all present, I don’t see why we would add any of them to the route relations. No need to repeat the stop’s details on them either.

Then the platform ways. If there are actual platforms, I would tag them highway=platform/public_transport=platform. Nothing more, nothing less. No need to add them to the route relations.

Then the stop_area relations. This is where we get the chance to indicate which platform node(s) belongs to which stop_position node(s) (if mapped) and which platform way (if present). Doing it this way means to have such relations for each group, where a group is the ones on one side of the road or the ones belonging to 1 platform in a bus station. They can then be grouped in a hierarchy of stop_area_group relations, although this is only needed for the more complex ones and for bus stations.

Sometimes I wonder if I should create a proposal for this. Usually I give up before even getting started, as I know how hard it is to convince anyone in the OpenStreetMap universe, once they are set in their ways. Little by little I’m starting to build the courage to go ahead with it after all. Writing these diary entries is a small first step, also to see if there would be support for such a simpler way of mapping public transport.

Also don’t get me wrong, it’s still possible to fill in all the detail of the accomodation surrounding the bus stops, but in a way that builds further on what was mapped previously, instead of converting from one object type to another or needing to add details more than once.

Public Transport Mapping, why do we add the stop details several times over?

Posted by Polyglot on 27 July 2017 in English (English)

When we started mapping public transport stops, some people insisted on mapping them on nodes next to the way, others thought the right way to do it, was to add them as nodes being part of the highway, thereby losing the information on which side of the road the bus stop was.

Then somebody came by with the idea to unite both ways of mapping. In itself that sounds great. But where do we add the details then? On both? That doesn’t really make sense. It’s a maintenance nightmare.

So we still have some people adding the stops as stop_position nodes on the highways and others mapping them as isolated nodes next the ways as public_transport=platform. But of course a node is not a platform, so others map those as ways and areas. Nothing wrong with that, but why do we need to add all the details to these ways?

For some reason it was decided that both these stop_postion nodes and the platform ways/nodes need to be added over and over again to the route relations. These route relations represent each and every variation of the public transport lines, so there are thousands of them. Another maintenance nightmare.

Why can’t we have a node next to the way, with all the relevant details and add those nodes to the route relations, then followed by a continuous string of ways? The node gets tagged public_transport=platform/highway=bus_stop.

The node isn’t always representing an actual platform. If there is a platform, nothing wrong with representing it as a way or an area. But there is no real need to duplicate all the details like name/ref/route_ref/zone to these ways. And there isn’t really a need to add them to the route relations.

For the simplest bus stops a node next to the way public_transport=platform/highway=bus_stop is all that is needed. It contains all the relevant information and it has coordinates, which makes it convenient to compare it to data from operators.

For more completely mapped bus stops, benches and waste_baskets can be added.

If you want to make explcit where the vehicle stops, a public_transport=stop_position can be added on the highway. For the first and last stops, the way should be split there, as it’s the beginning or end of the route.

But these stop_position nodes are not all that important, so no real need to map them for every stop. Also no reason why the stop details should be repeated on them and no real need to add them to the route relations. It’s enough to add them to stop_area relations.

Public Transport Plugin

Posted by Polyglot on 1 July 2016 in English (English)

Mapping public transport routes on OpenStreetMap can be a challenge, keeping them correct and up-to-date even more so. Last year I mentored the Mapillary plugin for GSoC. Before that, I had been working on public transport a lot, and to add the stops precisely where the poles are, horizontal imagery is a big help, when it’s available. The idea to propose a GSoC project for public transport this year was a logical consequence of some Python scripting I had started on. It’s possible to run Python in JOSM, but it involves too much setup for it to be practical for general use by other mappers.

Still, automation is key. Without it, it’s next to impossible to even find all the problems with the route relations, let alone fix them.

Also the way we’re mapping public transport, at the moment (who knows one day route segments become the thing), is very repetitive and fixing all those routes for all variations of the lines gets tedious fast. This in turn results in very few people interested in doing it. And the ones that do burn out sooner or later.

I’m sure the new plugin will be a big help to solve that problem.

At the moment the plugin is very good at detecting problems with the routes:

  • going against oneway traffic
  • gaps that are caused by wrongly ordered ways (automatic fix available)
  • routes that don’t start/end on a stop_position node
  • ways that still need to be split on those terminal nodes
  • buses or trams that travel over ways unsuitable for that mode of transport

The latest addition is a dedicated extra layer. This layer highlights the route for which a relation editor window is open. You can have several relation editor windows open, but only the last one that had focus, will be shown highlighted. One thing that I was never able to achieve with plain MapCSS is to show sequence numbers for the stops and the platforms. The other was showing the refs of all the route relations serving those stops. All that becomes trivial (compared to MapCSS) if one can code it in JAVA, and Darya is doing a great job there.

So, what’s next?

The initial idea was to be able to start from a route relation containing just stops in the correct order and have the code figure out which ways to add to the relations. That will still happen, but fixing existing route relations and helping all mappers to keep the route relations ‘coherent’, when they make changes to the underlying highway/railway infrastructure is a higher priority, so we started by integrating the plugin in the validator. Thus making it very accessible for anybody who installs the plugin. It’s amazing how many problems have already been able to solved - both in the routes and in the ways they followm, as in the platforms and stop_positions -during beta testing of the code.

Want to try it yourself?

You can easily install the PT_assistant plugin in JOSM and help with testing.

User documentation can be found here

What I usually do, is File / Download from Overpass API (expert mode needs to be on for it to show that option in the menu, don’t ask me why) Then use the following query:

[out:xml][timeout:125];
(
 relation["public_transport:version"="2"]["route"="bus"];
);
(._;>;);
out meta; You can select routes for other modes of transport, of course. After downloading, I make sure nothing is selected, then press the validate button. ![Screenshot of dialog](https://lh3.googleusercontent.com/yd6MMLxRUkks0BmnRSPXxnS-9XRip9POjcMrsjzM39U34PEMnKKUQRM0YVOf-dJ42T7IEVm1lW2wVHcOqZucc5cFvLbGY2gHUYKdo3OMlooT_K6eHmKsOyGJ2BBwbB38xDcATg_1Tng2McxYTuCis0WTEoTzIrTUw6i9Gzll_t27M0Gr8PoRFoIeVLIv7gfhGcJC3oIH29Wo8IVD-TzQGxCY1HAuW-FBnOKnIcQ45JPHZM4D-JmQjc_7JgGAyTq6EP5gSjtoiAExRYBm8rOZT6h-9VCMNj_Z_CH_MIuRxXxssAmJo52RyAQgFdM4IWhE_-roCUYMl5rHJlKKm3HVYZHGMLlSwRiNVnyJ8tGRg5AzcTVZpgu44v7tClFUutXk0hd2dIwFqAJHElic5IsoelxSkhmM6OUSUSWqdCVIXgVjXsDKopnIZpF5la5askVLaKaBm763lLQB01DTEnSrEvjEmbJHq5WSh8WeD_qkwuCdMrm-L4n-SrT1IVBYUYVXfWU-8VDkqEzIiYleO_Q_irSFq2dHGWTsfP1E8PguQ1Eky1hqbb3yp30Ghcq5KiMrMWZ8T7ABH9VStjsxnzXBlvS9BOLS2Z4=w872-h631-no) I usually use the last option, as I don't want all the fixes applied automatically for the time being. Implementing automatic fixes with user intervention where there is doubt, is in the pipeline. If you have the plugin installed, you'll find several categories that start with PT_ ![Screenshot of validator pane](https://lh3.googleusercontent.com/LmT6yLOVqyKLCkWdPsQyp5nW56UHcZJ6ineYwxjzFXeGyYRx-WKDH8wr1vzhJHycRP8Y8WA8qUqVS48y6rWjY5BlunavBAbhoqw3nYnds3YaZf96rxYsq9l_NYKPRptEfu75wJa6QeDgxlrdtjJmaBIefseVALiyKjq8OHr9nINee9u8D-4FMzLEl_gEd7vvxKnZQFiO_Sleo7IcQwu-ZBQEfrvTtWkTNVvJUcILvc8yRwksZK5A0vhwOY8YXNxtfKknLl-ctg7NUmHX1lxqrCN6wgh1zobCZMEcMlMyomjUtDIltFwLqisVnXo09PiPYnzU6FPD-lW0t4jHZ4SDnJ6enzsYY28wJG26HXNOK-B5CIZuXhEwUiZ-lhMozN7NVYgnrV8Kp2N8upWRaE-yJ7tLFp7stiqRA4Ni_Mn-OFBUyPGPkfotCo_HpBA_5n6kOsciw-T7_82OPXYGiaIh36fe8BrJW6YRD2qp-S0g9ir_rKcTcpC1KrjLE3PV8xN35dVoolCS-D8UlJMOQpXXrJmD8xlSb2Icg4WYNSgQ4lZ8N8GuCe_tTZpjyvtpIJP2O038fFGcx7E5p5PVVS9oK4daJdGRfI0=w620-h234-no)

The easiest ones to tackle are: * Route contains a gap that can be fixed by sorting

For those you can simply press the fix button. Don’t select more than, say 5, at a time.

If your stops where not at the beginning of the route, now they will be. The order should be preserved. If they don’t have roles, select all of them, make them selected in the editor window, remove them from the Relation Editor and readd them. Now go visit the ones that still don’t have roles and fix their tagging.

Now press the upload button, which will result in a new validation Usually you’ll find there are more problems to solve at this point. For the routes that have ways going against oneway traffic, pressing the fix button will result in removal of that way. It’s better to press right mouse button Zoom to problem, select the way(s) that have a yellow casing around them, then press right mouse button edit. The relation editor will open with those ways selected in blue. Now it’s possible to remove them, or to add oneway:bus=no, if that is the proper solution. If you remove them, you probably want to readd ways from the other side of the dual carriageway or roundabout. If you notice that there are several variations, which are likely to need the same fix, keep the ‘problem ways’ selected and open all of them in relation editor windows. After all are openedm select the ways to replace them with, and do this in each editor window.

Be careful not to split ways for which you have relation editor windows open.
You'll get 'conflicted with yourself', which is something to avoid at all cost :-)
Have a look in the comments to learn how to avoid conflicts while keeping RE windows opened.

All this may seem like it’s still a lot of manual work and you’re right, it is. The intention is to automate all this further. I’ll probably write a new diary entry in a few weeks about that.

If you’re interested in a hangout about the mapping of public transport and the use of the plugin, get in touch and we’ll set one up.

Setting up JOSM

Posted by Polyglot on 13 January 2016 in English (English)

I recently configured OBS (Open Broadcast Software) to conveniently make screencasts toward Twitch.tv.

Usually I use this to show HOT contributors what I did while validating their tasks/tiles. I get some nice response to this. People like the feedback and the tips. I think it works as a motivator to keep going as well.

For the past few weeks I had this plan to create more to the point video material to show how to map with JOSM and why I think it’s so much more convenient and efficient to do so.

I had a problem with Bing imagery that was solved, by dumping my profile, so I seized the opportunity to show to get started with JOSM. While doing this I noticed there was imagery for Svalbard available and WOW, that is great imagery! So went on to improve my mapping of the Global Seed Vault. The video shows how to improve way accuracy, how to make nice bends in the roads, how to draw buildings very accurately, how to link to Wikipedia and Wikidata. How to jump to these articles in your web browser from withing JOSM and so much more. As usual I went a bit overboard, sorry about that.

I did it once more, this time with sound: Setting up JOSM for HOT mapping

These have no sound:

Setting up JOSM (part 1)

Setting up JOSM (part 2)

Setting up JOSM (part 3)

Setting up JOSM (part 4)

Location: Longyearbyen, Svalbard, 9171, Norway

Cooperation between free content projects: how to link from Wikipedia to OSM

Posted by Polyglot on 14 August 2015 in English (English)

This blog entry describes how and why the following module was developed:

https://en.wikipedia.org/wiki/Module:OSM

In the mean time I added extensive documentation to it, which might be more interesting than what I wrote here… so go and have a look!

https://en.wikipedia.org/wiki/Module:OSM/doc

With the advent of Wikidata my interest in Wikipedia flared uponce more. I’m a mapper for Openstreetmap in the first place, but last year I already made a little sidestep to Wikivoyage. That’s a project which is closer in many ways to Openstreetmap than Wikipedia.

Recently I started adding wikidata tags to streets and other objects in Openstreetmap. Which in itself doesn’t do all that much. So a way is needed to make this available to the rest of the world. Wikipedia seems like the way to accomplish this.

I had already experimented a bit with links to saved queries on Overpass Turbo. But creating these queries from scratch over and over again and creating such links to them, isn’t the most straightforward way to get things done.

When it became clear to me that sometimes an additional query of wikidata may be necessary, before invoking Overpass, I knew I had to tackle the problem in another way.

This made me look into Lua, the scripting language which was chosen to automate the plethora of MediaWiki projects. After one day I came up with a working script (in the mean time it’s been developed quite a bit further):

On the Dutch Wikipedia reception was luke warm. I’m afraid, I hadn’t been able to carry across what I was trying to achieve. On the English Wikipedia a Lua developer saw the potential and he helped me to improve the code and explained me how to go about adding test cases. This helps a lot to not introduce bugs while attempting to add new features. For the case of querying several Q-numbers at once using a regex query, help came from a specialist in Overpass.

So this saved query:

[http://overpass-turbo.eu/s/aFt]

now looks like this in the article:

{{#invoke:OSM etym display=Streets named after Leuven timeout=50 query=[highway] coord=50.879;4.701;9}}

which results in the following query:

[timeout:50][out:json]; ( node[“name:etymology:wikidata”=”Q118958”]highway; // remove the ({{bbox}}) if you want the query to be executed globally way[“name:etymology:wikidata”=”Q118958”]highway; relation[“name:etymology:wikidata”=”Q118958”]highway; ); out geom;

The difference with the stored query is that only streets closer to Leuven are fetched. If the user wishes to do so they can either remove the ({{bbox}}) statements or they can move the map to another region and press Run. In case the user also wants to see other objects named after Leuven, they can remove the [highway] part.

Now, let’s hope the Wikipedia contributors at large see value in this. I deployed it on the French Wikipedia as well and will probably continue with Spanish, German and Esperanto. Feel free to deploy it on other language versions as well. I will keep all the modules in sync. I’m only going to develop test cases on the English Wikipedia, so that will be the primary place to continue development. One test is failing because of lack of arbitrary access, but that should be resolved shortly.

Actually there is a whole plethora of possibilities:

  • objects named after the subject of the Wikipedia article (on condition they got name:etymology:wikidata tags on the OSM side)
  • the object of the article itself (on condition they got wikidata tags on the OSM side)
  • other objects related to the article (this is probably not OK with Wikipedia policies)
  • objects of which the subject of the article is the architect or the artist who created them (architect and artist.wikidata)
  • objects related directly to the subject (subject.wikidata), this can be tombstones as well
  • objects carrying brand:wikidata or operator:wikidata tags
  • relations representing public transport lines. The names of the stops are emphasized with help of MapCSS styles
Location: Hertogensite, Leuven, Flemish Brabant, Flanders, 3000, Belgium