JOSM/Plugins/Routes

From OpenStreetMap Wiki
< JOSM‎ | Plugins
Jump to navigation Jump to search
Screenshot of the JOSM routing plugin

Routes

Provides an easy possibility to visualize all kinds of relations. Especially handy for route relations. It allows general highlighting of features based on the pattern used in SearchAction.

Usage

After the plugin is installed and enabled you will see two new example layers "Czech hiking trails" and "Cycle routes".

If you want to add custom highlighting you have to add a new file "routes.xml" in a sub-directory "routes" within your JOSM-Plugins folder.

Examples

  • German Public transport routes example highlights bus, tram, light train and cycle routes:
 <?xml version="1.0" encoding="UTF-8"?>
 <routes xmlns="http://www.example.org/routes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.org/routes routes.xsd ">
 <!-- pattern is the same pattern as used in SearchAction -->
 	<layer name="Busrouten">
 		<route color="#FF0000">
 			<pattern>
 			(type:relation line=bus) | (type:relation type=route route=bus) | child(child(type:relation line=bus))
 			</pattern>			
 		</route>
 	</layer>
 	<layer name="Tramrouten">
 		<route color="#0000FF">
 			<pattern>
 			(type:relation line=tram) | (type:relation type=route route=tram) | child(child(type:relation line=tram))
 			</pattern>			
 		</route>
 	</layer>
 	<layer name="S-Bahn-Routen">
 		<route color="#00FF00">
 			<pattern>
 			(type:relation line=light_rail) | (type:relation type=route route=light_rail) | child(child(type:relation line=light_rail))
 			</pattern>			
 		</route>
 	</layer>
  	<layer name="Radwege">
  		<route color="#FF00FF">
  			<pattern>
  			(type:way (ncn=* | (lcn=* | rcn=* ))) | (type:relation type=route route=bicycle)
  			</pattern>
  		</route>
 	</layer>
 </routes>


  • Lane count coloring. To color ways depending on the number of lanes:
	<layer name="lanes">
		<route color="#FF00FF">
			<pattern>
			(((lanes=10 | lanes=9 | lanes=8 | lanes=7) -oneway=yes) | ((lanes=6 | lanes=5 | lanes=4) oneway=yes))
			</pattern>
		</route>
		<route color="#FF0000">
			<pattern>
			((lanes=6 -oneway=yes) | (lanes=3 oneway=yes))
			</pattern>
		</route>
		<route color="#FF3F00">
			<pattern>
			(lanes=5 -oneway=yes)
			</pattern>
		</route>
		<route color="#FF7F00">
			<pattern>
			((lanes=4 -oneway=yes) | (lanes=2 oneway=yes))
			</pattern>
		</route>
		<route color="#FFBF00">
			<pattern>
			(lanes=3 -oneway=yes)
			</pattern>
		</route>
		<route color="#FFFF00">
			<pattern>
			(((lanes=2 | lanes=1) -oneway=yes) | (lanes=1 oneway=yes))
			</pattern>
		</route>
	</layer>

Source code

Source code is available through the openstreetmap repository where plugin sources are hosted.

http://svn.openstreetmap.org/applications/editors/josm/plugins/