NAME
Map::Metro::Cmd - The command line interface
SYNOPSIS
#* General form
$ map-metro.pl <command> [ <city> ] [ <arguments> ]
#* Prints the route using the PrettyPrinter hook plugin
$ map-metro.pl route Stockholm 'Sundbybergs centrum' T-Centralen
DESCRIPTION
This collection of commands exposes several parts of the Map::Metro api.
COMMANDS
If a command takes $city
, it is mandatory. Normally it should be a module name in the Map::Metro::Plugin::Map
namespace (but only the significant part is necessary). If, however, it contains att least one dot it is assumed to be a file path to a map file. The map file is parsed via Map::Metro::Shim.
map-metro.pl all_routes $city
Does route for all stations in the Map::Metro::Plugin::Map::$city
map.
map-metro.pl available
Lists all installed maps on the system.
map-metro.pl dump $city
Converts the graph into a hash structure, and Data::Dump::Streamer dumps it into a textfile. See hoist
for how to retrieve it.
Consider using serealize
/deserealize
instead.
map-metro.pl graphviz $city --into=$file
Creates a png via GraphViz2.
If into=$file is given the png is saved with that filename, otherwise a timestamped file will be saved in the current directory.
map-metro.pl hoist $filename $from $to
$from
Mandatory. The starting station, can be either a station id (integer), or a station name (string). Use single quotes if the name contains spaces.
$to
Mandatory. The finishing station, can be either a station id (integer), or a station name (string). Use single quotes if the name contains spaces.
Reads a file dumped by dump
and searches for routes between the two stations, just like route
.
map-metro.pl lines $city
Lists all lines in the Map::Metro::Plugin::Map::$city
map.
map-metro.pl metro_to_tube $city
Converts Map::Metro::Plugin::Map::$city
into a Map::Tube ready xml-file. The file is saved in the current working directory with a timestamped filename.
map-metro.pl route $city $from $to
$from
Mandatory. The starting station, can be either a station id (integer), or a station name (string). Must be of the same type as $to
. Use single quotes if the name contains spaces.
$to
Mandatory. The finishing station, can be either a station id (integer), or a station name (string). Must be of the same type as $from
. Use single quotes if the name contains spaces.
Searches for routes in the Map::Metro::Plugin::Map::$city
between $from
and $to
.
Consider using serealize
/deserealize
.
map-metro.pl serealize $city
Uses Sereal to serialize a map. Use deserealize
to use that file to search for routes. This is generally much faster than route
.
map-metro.pl deserealize $city $from $to
Reads a file created with serealize
and searches for routes.
map-metro.pl stations $city
Lists all stations in the Map::Metro::Plugin::Map::$city
map. This displays station ids for easy search with route.
map-metro.pl help
It's there if you need it...
AUTHOR
Erik Carlsson <info@code301.com>
COPYRIGHT
Copyright 2014 - Erik Carlsson
LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.