NAME
Map::Metro::Cmd - The command line interface
SYNOPSIS
#* General form
$ map-metro.pl <command> [ <city> ] [ <arguments> ]
#* Does the same as $graph->routes_for('Sundbybergs centrum', 'T-Centralen')->to_text
$ map-metro.pl map 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.
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
. If you are going to search for many routes using map-metro.pl
this can be a significantly faster way to do it than route
, since it is much faster to read a hash from file than constructing the graph from scratch on every execution. dump
and hoist
can also serve as a base on how to construct a custom dump/hoist solution.
map-metro.pl lines $city
Lists all lines in the Map::Metro::Plugin::Map::$city
map.
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
.
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 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.