Hi,
in the course of a discussion over on talk-gb, I wanted to find out
which ways have the highest number of relation memberships. In case
someone is interested, here's how to do it with Osmium and Perl.
1. create this Perl script which reads "opl" ascii format
#!/usr/bin/perl
while(<>)
{
next unless /boundary/;
s/.* M//g;
foreach (split(/,/))
{
my ($a,$b)=split(/@/);
$mem{$a}++;
}
}
$i=0;
foreach (sort { $mem{$b}<=>$mem{$a} } keys(%mem))
{
printf "%d %s\n", $mem{$_}, $_;
last if ($i++>100);
}
2. feed an .osm.pbf file into it:
osmium cat some-file.osm.pbf -trelation -fopl | perl myscript.pl
I ran this for England and found a small number of ways that were
actually in over 100 different (bus route) relations ;)
If you like Python, you could of course do the whole thing in one go
using the PyOsmium library
Bye
Frederik
--
Frederik Ramm ## eMail [email protected] ## N49°00'09" E008°23'33"
_______________________________________________
dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/dev