Author image René Nyffenegger

Geo::OSM::Primitive::Way - Abstract base class for the Open Street Map data primitive way.

SYNOPSIS

OVERVIEW

The idea is to encapsulte methods that use OpenStreetMap data (that is possibly stored in Geo::OSM::DBI.

METHODS

new

    my $way = Geo::OSM::Primitive::Way->new($osm_way_id);

nodes

    my @nodes = $way -> nodes();

Returns the nodes, stored in the cache via "_set_cache_nodes", that the way conisist of.

start_end_coordinates

    my ($lat_start, $lon_start, $lat_end, $lon_end) = $way -> start_end_coordinates();

Returns the way's start and end coordinates.

_set_cache_nodes

    $way->_set_cache_nodes($node_1, $node_2, $node_3, … $node_n);

Copyright Copyright © 2017 René Nyffenegger, Switzerland. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at: http://www.perlfoundation.org/artistic_license_2_0

Source Code

The source code is on github. Meaningful pull requests are welcome.