Skip to content

Commit 4ef9bdd

Browse files
committed
make thor readme relevant
1 parent 2bb4d0f commit 4ef9bdd

File tree

3 files changed

+36
-66
lines changed

3 files changed

+36
-66
lines changed

README.md

+29-8
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
1010
1111

12-
Valhalla is an open source routing engine and accompanying libraries for use with Open Street Map data.
12+
Valhalla is an open source routing engine and accompanying libraries for use with Open Street Map data. This library, Thor, serves as a routing engine backed by tiled open source routing data. The name [Thor](http://en.wikipedia.org/wiki/Thor) was chosen as an acronym standing for: Tiled Hierarchical Open Routing and was the foundational idea around which the organization Valhalla and its Norse mythology theme was formed.
1313

1414
Build Status
1515
------------
@@ -19,30 +19,51 @@ Build Status
1919
Building
2020
--------
2121

22-
Valhalla uses the [GNU Build System](http://www.gnu.org/software/automake/manual/html_node/GNU-Build-System.html) to configure and build itself and has a number of useful dependencies already included for convenience such as: [Boost libraries](http://boost.org/), [Protobuf](https://github.com/google/protobuf/), [cURL](http://curl.haxx.se/), [ZeroMQ](http://zeromq.org/), [SQLite](http://sqlite.org/), and [Lua](http://www.lua.org/). To install on a Debian or Ubuntu system, please first install the prerequisites:
22+
Thor uses the [GNU Build System](http://www.gnu.org/software/automake/manual/html_node/GNU-Build-System.html) to configure and build itself. To install on a Debian or Ubuntu system you need to get its dependencies with:
2323

24-
sudo apt-get install libboost-all-dev libprotobuf-dev libcurl4-openssl-dev libzmq3-dev protobuf-compiler libsqlite3-dev lcov lua5.2 liblua5.2-dev
24+
sudo apt-get install -y autoconf automake libtool make gcc-4.8 g++-4.8 libboost1.54-dev libboost-program-options1.54-dev libboost-filesystem1.54-dev libboost-system1.54-dev protobuf-compiler libprotobuf-dev lua5.2 liblua5.2-dev
2525

2626
Then you should be able to bootstrap the build system:
2727

2828
./autogen.sh
2929

3030
And then run the standard GNU build install:
3131

32-
./configure --enable-coverage && make && make install
32+
./configure && make && make install
3333

3434
Please see `./configure --help` for more options on how to control the build process.
3535

3636
Using
3737
-----
3838

39-
For convenience valhalla has a main executable, `valhalla`, that makes use of the library it builds. The purpose of this executable to serve as a starting point for building several custom executables against the various custom libraries.
39+
For detailed information about what algorithms, data structures and executables are contained within thor, please see the more [detailed documentation](docs/index.md).
40+
41+
The build will produce both libraries and headers for use in other Valhalla organization projects, however you are free to use Thor for your own projects as well. To simplify the inclusion of the Thor library in another autotoolized project you may make use of [thor m4](m4/valhalla_thor.m4) in your own `configure.ac` file. For an exmample of this please have a look at `configure.ac` in another one of the valhalla projects. Thor, and all of the projects under the Valhalla organization use the [MIT License](COPYING).
4042

4143
Contributing
4244
------------
4345

44-
We welcome contributions to valhalla. If you would like to report an issue, please use the [valhalla issue tracker](https://github.com/mapzen/valhalla/issues) on GitHub.
46+
We welcome contributions to thor. If you would like to report an issue, or even better fix an existing one, please use the [thor issue tracker](https://github.com/valhalla/thor/issues) on GitHub.
47+
48+
If you would like to make an improvement to the code, please be aware that all valhalla projects are written mostly in C++11, in the K&R (1TBS variant) with two spaces as indentation. We generally follow this [c++ style guide](http://google-styleguide.googlecode.com/svn/trunk/cppguide.html). We welcome contributions as pull requests to the [repository](https://github.com/valhalla/thor) and highly recommend that your pull request include a test to validate the addition/change of functionality.
49+
50+
Tests
51+
-----
52+
53+
We highly encourage running and updating the tests to make sure no regressions have been made. We use the Automake test suite to run our tests by simply making the `check` target:
54+
55+
make check
56+
57+
You can also build a test coverage report. This requires that the packages `lcov`, `gcov` and `genhtml` be installed. On Ubuntu you can get these with:
58+
59+
sudo apt-get install lcov
60+
61+
To make the coverage report, configure the build for it:
62+
63+
./configure --enable-coverage
64+
65+
And generate an HTML coverage report in the `coverage/` directory:
4566

46-
If you would like to make an improvement to the code, please be aware that valhalla is written mostly in C++11, in the K&R (1TBS variant) with two spaces as indentation. We generally follow this [C++ Style Guide](http://google-styleguide.googlecode.com/svn/trunk/cppguide.html). We welcome contributions as pull requests to the [repository](https://github.com/mapzen/valhalla).
67+
make coverage-report
4768

48-
It is possible to build a test coverage report, please see [test coverage documentation](docs/test_coverage.md) for details.
69+
Note also that, because calculating the coverage requires compiler support, you will need to clean any object files from a non-coverage build by running `make clean` before `make coverage-report`.

docs/index.md

+7-49
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,15 @@
1-
# Valhalla Library #
1+
# Thor #
22

3-
## Motivation ##
4-
5-
Valhalla is a collection of libraries and binaries (named after Norse mythological figures) created with the intetion of providing a flexible opeen street map based routing infrastructure. We endeavor to do much more than this describes but we'll flesh out the docs to explain each piece as the project matures.
6-
7-
## Building ##
8-
9-
Valhalla does have several dependencies that you must have before configure will properly produce a Makefile. It is true that many of these dependencies are not actually needed to build the valhalla code however we left the dependencies in because we forsee having to use them at some point or another of the course of the projects development.
10-
11-
## Testing ##
12-
13-
Tests can be found in the `tests/` directory, and are run by autotools when you run `make check`. If you are preparing a pull request or patch, please make sure these pass before submitting it.
14-
15-
There is a test coverage tool built into the build system, but it's fairly annoying to use. Please see
16-
[the coverage docs](test_coverage.md) for more information and details on running it.
3+
The thor library is essentially a set of various data structures and alogrithms which deal with things like: A* graph traversal, edge costing, vertex costing and path construction.
174

185
## Components ##
196

20-
### Mjolnir ###
21-
22-
A command line tool for cutting route tiles directly from [OSM Pbf](http://wiki.openstreetmap.org/wiki/PBF_Format) or from an [osm2pgsql] (http://wiki.openstreetmap.org/wiki/Osm2pgsql) import (which is useful for changeset/diff application).
23-
24-
#### osm2pgsql ####
25-
26-
To import a small dataset such as that of Liechtenstein you'll first need to install osm2pgsql like so:
27-
28-
#get deps, compile, test, and install osm2pgsql. you only need to do this once
29-
sudo apt-get install postgresql-9.3-postgis-2.1 pgadmin3 postgresql-contrib libbz2-dev libgeos++-dev libproj-dev libpq-dev liblua5.2 liblua5.2-dev libprotobuf-c0-dev protobuf-c-compiler python-pip
30-
sudo pip install psycopg2
31-
git clone https://github.com/openstreetmap/osm2pgsql.git
32-
cd osm2pgsql
33-
./autogen.sh
34-
./configure
35-
sudo -u postgres createuser -s $USER
36-
sudo mkdir -p /tmp/psql-tablespace
37-
sudo chown postgres.postgres /tmp/psql-tablespace
38-
psql -c "CREATE TABLESPACE tablespacetest LOCATION '/tmp/psql-tablespace'" postgres
39-
make test
40-
sudo make install
41-
42-
After you've gotten osm2pgsql installed and ready to use you can do an import of whatever dataset by doing something like this:
43-
44-
#create sample routing database from the mjolnir top level dir
45-
createdb gis
46-
psql -d gis -c 'CREATE EXTENSION postgis; CREATE EXTENSION hstore;'
47-
cd import/osm2pgsql
48-
osm2pgsql --create --latlong --slim --style route.json --database gis --output multi ../../test/data/liechtenstein-latest.osm.pbf
7+
What follows are some notable components of the thor library.
498

50-
Note that for applying diff's you won't need `createdb`, `psql` or the `--create` bits.
9+
### PathAlgorithm ###
5110

52-
### Util ###
11+
TODO:
5312

54-
The Valhalla library comes with some examples of standard utilities that may or may not be applicable for a given project. They are mostly just intented as an example of what you might use to build a library within autotools.
13+
### AdjacencyList ###
5514

56-
## Tests ##
57-
Valhalla comes with a test suite, run with ``make check``. If you find a platform where the tests aren't passing [open an issue](https://github.com/mapzen/valhalla/issues/new).
15+
TODO:

docs/test_coverage.md

-9
This file was deleted.

0 commit comments

Comments
 (0)