OpenStreetMap logo OpenStreetMap

GSoC 2017 JOSM

Posted by Polyglot on 13 September 2017 in 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.

Discussion

Comment from Zian Choy on 30 September 2017 at 21:58

When will these improvements be available in JOSM? The latest version (12712) does not include “Download from Overpass API”.

Comment from Polyglot on 30 September 2017 at 22:16

That’s odd. It might be related to having Expert Mode switched on.

Jo

Log in to leave a comment