This project is a simple navigation tool that loads maps from various formats, performs specific actions on the data, and exports the results. The tool supports various input and output formats and provides multiple functionalities, including graph visualization, node marking, shortest path calculations, and more.
Created and maintained by Jakub Bröckl.
ruby osm_simple_nav.rb <load_command> <input.IN> <action_command> <output.OUT>
The tool supports the following commands for loading map data from a file (<input.IN>
can be DOT
or OSM
):
--load-undir
: Load an undirected map.--load-dir
: Load a directed map.--load-undir-comp
: Load an undirected map with additional compression.--load-dir-comp
: Load a directed map with additional compression.
The tool provides the following commands to perform actions on the loaded map:
--export
: Export the graph to a file (<output.OUT>
can bePDF
,PNG
, orDOT
).--show-nodes
: Mark nodes and export the graph. Output formats arePDF
,PNG
, orDOT
.
Additional options for marking nodes:
[<geo lat1 long1> <geo lat2 long2>]
: Mark nodes within the specified geographic coordinates.[<node_from_id> <node_to_id>]
: Mark specific nodes by their IDs.
Other action commands:
--midist-len
: Find the shortest path (by distance) between two points and export the result (PDF
orPNG
).--midist-time
: Find the fastest path (by time) between two points and export the result (PDF
orPNG
).--center
: Find the center of an undirected graph and export the result (PDF
orPNG
).
bash
Copy code
ruby osm_simple_nav.rb --load-undir map.osm --export graph.pdf
bash
Copy code
ruby osm_simple_nav.rb --load-dir map.dot --show-nodes geo 50.0 14.0 50.1 14.1 graph.png
bash
Copy code
ruby osm_simple_nav.rb --load-undir-comp map.osm --midist-len node_1 node_2 graph.pdf
DOT
: Graph description format.OSM
: OpenStreetMap data format.
PDF
: Portable Document Format for visualizing graphs.PNG
: Portable Network Graphics for visualizing graphs.DOT
: Graph description format for further processing.
- Ruby (compatible with version
x.y.z
or higher) - Libraries required for graph manipulation and visualization (e.g.,
Graphviz
).
$ gem install ruby-graphviz
This project is licensed under the MIT License.