| 1 | package Map::Tube::Athens; | ||
| 2 | |||
| 3 | our $VERSION = '0.01'; | ||
| 4 | |||
| 5 | =head1 NAME | ||
| 6 | |||
| 7 | Map::Tube::Athens - Map::Tube interface to the Athens Metro | ||
| 8 | |||
| 9 | =head1 SYNOPSIS | ||
| 10 | |||
| 11 | my $tube = Map::Tube::Athens->new; | ||
| 12 | |||
| 13 | my $name = $tube->name; | ||
| 14 | open(my $MAP_IMAGE, ">$name.png"); | ||
| 15 | binmode($MAP_IMAGE); | ||
| 16 | print $MAP_IMAGE decode_base64($tube->as_image); | ||
| 17 | close($MAP_IMAGE); | ||
| 18 | |||
| 19 | my $line = $tube->get_line_by_name('M1'); | ||
| 20 | print $tube->to_string($line), "\n\n"; | ||
| 21 | |||
| 22 | my $route = $tube->get_shortest_route('Piraeus', 'Syntagma'); | ||
| 23 | print $tube->to_string($route); | ||
| 24 | |||
| 25 | =head1 AUTHOR | ||
| 26 | |||
| 27 | Errietta Kostala <errietta@errietta.me> | ||
| 28 | |||
| 29 | =head1 DESCRIPTION | ||
| 30 | |||
| 31 | It currently provides functionality to find the shortest route between the two given nodes. It covers the following metro lines: | ||
| 32 | |||
| 33 | =over | ||
| 34 | |||
| 35 | =item Metro Line M1 | ||
| 36 | |||
| 37 | =item Metro Line M2 | ||
| 38 | |||
| 39 | =item Metro Line M3 | ||
| 40 | |||
| 41 | =back | ||
| 42 | |||
| 43 | =head1 INFORMATION | ||
| 44 | |||
| 45 | What I found out was that it's surprisingly difficult to find an up-to-date, accurate map of the Athens Metro. It seemed that the best source was actually a volunteer-made map from Wikipedia: L<https://upload.wikimedia.org/wikipedia/commons/d/da/Athens_Metro_Map_%28December_2013%2C_English%29.svg>. | ||
| 46 | |||
| 47 | If you can read Greek, there's also L<http://www.ypodomes.com/media/k2/items/cache/12a344790c511a0cdcacaded32f8a413_XL.jpg>. | ||
| 48 | |||
| 49 | =head1 SEE ALSO | ||
| 50 | |||
| 51 | L<Map::Tube> | ||
| 52 | |||
| 53 | |||
| 54 | =cut | ||
| 55 | |||
| 56 | |||
| 57 | use Moo; | ||
| 58 | use namespace::clean; | ||
| 59 | |||
| 60 | use File::Share ':all'; | ||
| 61 | |||
| 62 | has json => (is => 'ro', default => sub { return dist_file('Map-Tube-Athens', 'athens-map.json') }); | ||
| 63 | |||
| 64 | |||
| 65 | with 'Map::Tube'; | ||
| 66 | |||
| 67 | 1; |