Relation Analyzer/Bookmarklet

From OpenStreetMap Wiki
Jump to navigation Jump to search


An unofficial bookmarklet (see this page's history for authors) tested only with Firefox (edit this if you tested in another browser).

Run this on a page (/history page works too) of a relationexample page. The bookmarklet opens the RA in a new tab.

javascript:var urlParts=document.location.href.split('/'); if(urlParts[2]==='') { if (urlParts[3]==="relation") { var idMatch = urlParts[4].match(/\d+/); var objId = idMatch[0];'' + objId); } else { alert('Only relations can be analysed.'); } } else { alert('This is not a supported page.'); } void(0);

Version without spaces:


From Waymarked Trails

Note the analyzer does not support nested relations ie. it cannot analyze a superroute or route containing other relations.

javascript:(function(){id=location.href.match(/waymarkedtrails\.org\/\#route\?id=(\d+)/);if(id!=null){''+id[1]);}else{alert('This is not a valid Waymarked Trails relation page.')}})()