DijkstraMap

0. Basic Information
  This application is written in Rails 3.0.7 on Ruby 1.9.2 using TextMate (*.tmproj is included).
  Dijkstra (search engine) was written in C++ and compiled on Intel-based 64-bit Mac OS X using Xcode 4 (g++) - you can find in my repository:
  https://github.com/aenain/Dijkstra and compile on your own.

  Application and search engine use exported map (as *.osm and *.svg) from www.openstreetmap.org

1. Requirements
  This application requires also four other things to run properly (except gems listed in Bundler):
    a. Dijkstra binary file - program which finds the shortest path between given nodes and exports results to xml file (it's included but maybe you will have to compile it on your own)
    b. map.osm - exported map from www.openstreetmap.org (downloading it with crawler is forbidden by license)
    c. map.svg - exported map from www.openstreetmap.org (downloading it with crawler is forbidden by license) (notice that when downloading map.osm and map.svg files in Google Chrome download status bar on bottom changed bounds of map!)
    d. MySQL Server (on Mac OS X it can be easily installed with ports: sudo port install mysql5)

2. Installation
  After copying all files please make sure that you made symbolic link to map.svg:
    a. Open terminal
    b. Go to directory: public/images in application directory
    c. Create symbolic link to map.svg:
      ln -s path_to_original_file map.svg
      You can also move original map.svg to this directory, but symbolic link is more convenient, especially when you would like to change your map more than once :P
  In config/app_config.yml.sample you can find my configuration of application. Please copy it to config/app_config.yml:
    cp config/app_config.yml.sample config/app_config.yml
  and customize it to your needs.
  Do the same thing with config/database.yml.sample.

2. Configuration
  All configuration settings are in config/app_config.yml file.
  Set up connection to your database in config/database.yml file.

  After installation you have to set up absolute path to directory where Dijkstra binary file can be found (dijkstra -> search -> dir) and then name of this file (dijkstra -> search -> file)

  Second thing to set up is location where result of Dijkstra binary file should be stored (path to this file will be passed to Dijkstra as parameter) (dijkstra -> result -> path)

  Last thing to set up is location of map.osm (exported map from www.openstreetmap.org).

3. Updating
  Please remember that map.osm and map.svg files are strictly related. Exported area for both files should be the same. Otherwise path on the map is going to be missplaced.
  After changing those files, remember to run rake:
    rake osm:update
  which repairs map.osm file for Dijkstra binary (some problems with xml parsing library in C++),
  updates config file (some magic happens here :D) and updates database.