Aleksey Korabelshchikov > Geo-Openstreetmap-Parser-0.02 > Geo::Openstreetmap::Parser

Download:
Geo-Openstreetmap-Parser-0.02.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.02   Source  

NAME ^

Geo::Openstreetmap::Parser - Openstreetmap XML dump parser

VERSION ^

version 0.02

METHODS ^

new

Creates a parser object

    my $parser = Geo::Openstreetmap::Parser->new( node => \&process_node, ... );

    sub process_node {
        my ($obj) = @_;
        ...
    }

Callbacks are possible for any tag, but useful for osm primitives: node way relation

Callback function receives hash with params: attr - hash with xml attributes tag - hash with osm tags nd - array of node_ids (for ways) member - array of hashes like { type => 'way', role => 'from', ref => '-1' } (for relations)

parse

Parses XML input, executing defined callback functions for OSM objects

    $parser->parse( *STDIN );

AUTHOR ^

liosha <liosha@cpan.org>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2012 by liosha.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: