Boundaries.pl/windows

From OpenStreetMap Wiki
Jump to: navigation, search

I'm trying to get boundaries.pl working on a GB extract on a Windows 7 machine with ActivePerl. I couldn't get the required .bz2 libraries to install, so commented lines out as suggested in the code. This ran, but found no relations. After some debugging I found that the seek_to_way_section and seek_to_relation_section code seemed to be seeking to a position some bytes short of the actual location, but couldn't work out why as the logic looked to be correct. So to workaround this issue I amended the skipWays and skipNodes code a bit like follows (adding the while loop in the not Bz2 section):

sub skipWays {
        
        if ($isBz2) {
                while ( ! (grep /<relation/, $line) ) {
                        nextLine() ;            
                }
        }
        else {
                seek_to_relation_section() ;
                nextLine() ;
                while ( ! (grep /<relation/, $line) ) {
                        nextLine() ;            
                }
        }
}