From OpenStreetMap Wiki
Jump to: navigation, search

The Geo::Parse::OSM is a perl module to read and manipulate OSM data from files.

It parses content of file and calls callback function whenever object is parsed.

Unlike [library#Geo::OSM::OsmReader|Geo::OSM::OsmReader] it uses simple regexp parsing, which is faster and allows file seek. Both compressed and uncompressed .osm files are supported.


    use Geo::Parse::OSM;

    my $osm = Geo::Parse::OSM->new( 'planet.osm.gz' );
    $osm->parse( sub{ warn $_[0]->{id}  if  $_[0]->{user} eq 'Alice' } );


module in CPAN