The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Geo::OSM::MapFeatures - Parses and represents OpenStreetMap Map Features

VERSION

Version 0.01

SYNOPSIS

use Geo::OSM::MapFeatures;

my $mf = new Geo::OSM::MapFeatures; $mf->download(); $mf->parse();

# To print a simple ascii representation: foreach my $category ( $mf->categories() ){ print "\n\n===== $category =====\n"; foreach my $feature ( $mf->features($category) ){ print "$feature\n"; } }

# Or you can choose not to use the string overloading and get the # individual elements yourself: foreach my $category ( $mf->categories() ){ print "\n\n===== $category =====\n"; foreach my $feature ( $mf->features($category) ){ print "Key: ".$feature->key()."\n"; print "Value(s): ". join("\n ", @{$feature->values()})."\n"; print "Description: ".$feature->description()."\n\n"; } }

FUNCTIONS

new (constructor)

Create a new instance of this class.

Returns: new instance of this class.

download

Downloads Map Features from wiki.openstreetmap.org.

Throws exceptions if something goes wrong.

There is also a debug_download function that runs download then freezes the content into "mapfeatures.debug" in the current directory, so you don't have to wait so much for the wiki while developing.

Returns: undef

parse

Parses map features.

categories

Returns a list of feature categories.

features

Returns a list of features.

If given an argument it as taken as a category, and only features in that category will be returned.

Exception classes

Geo::OSM::MapFeatures::Error

Base exception class for errors thrown by this module

Geo::OSM::MapFeatures::Error::Network

Network error

Geo::OSM::MapFeatures::Error::Parse

Go find out who broke map feature this time...

AUTHOR

Knut Arne Bjørndal, <bob at cakebox.net>

BUGS

Please report any bugs or feature requests to bug-geo-osm-mapfeatures at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Geo-OSM-MapFeatures. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Geo::OSM::MapFeatures

You can also look for information at:

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

Copyright 2008 Knut Arne Bjørndal, all rights reserved.

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

1 POD Error

The following errors were encountered while parsing the POD:

Around line 296:

Non-ASCII character seen before =encoding in 'Bjørndal,'. Assuming UTF-8