Geo::Parse::OSM

From OpenStreetMap Wiki
Jump to navigation Jump to 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.


Usage

    use Geo::Parse::OSM;

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


Links

module in CPAN