-
Install prerequisites.
- Docker Engine (version 1.6 or higher, see https://docs.docker.com/installation/ubuntulinux/)
- osmosis
- java
-
Download the map data and extract the city data
git clone https://github.com/boathit/barefoot cd barefoot/map/osm/ curl http://download.geofabrik.de/asia/china-latest.osm.pbf -o barefoot/map/osm/china.osm.pbf osmosis --read-pbf file=china-latest.osm.pbf --bounding-box left=126.506130 right=126.771862 bottom=45.657920 top=45.830905 --write-pbf file=harbin.osm.pbf
If you want to change the city, remember to modify the input in this line in import.sh.
-
Build Docker image.
cd barefoot docker build -t imap ./map
-
Create Docker container.
docker run -it -p 5432:5432 --name="harbin-map" -v ${PWD}/map/:/mnt/map imap
-
Import OSM extract (in the container).
root@acef54deeedb# bash /mnt/map/osm/import.sh
To detach the interactive shell from a running container without stopping it, use the escape sequence Ctrl-p + Ctrl-q.
If we want to attach it again, we can do
docker attach <container id>
-
Make sure the container is running ("up").
docker ps -a ...
We can restart the created container (if it is stopped)
docker start --interactive harbin-map
-
Install prerequisites.
- Maven (e.g. with
sudo apt-get install maven
) - Java JDK (Java version 7 or higher, e.g. with
sudo apt-get install openjdk-1.7-jdk
)
- Maven (e.g. with
-
Package Barefoot JAR. (Includes dependencies and executable main class.)
mvn package -DskipTests
-
Start server with standard configuration for map server and map matching, and option for GeoJSON output format.
java -jar target/barefoot-0.1.5-matcher-jar-with-dependencies.jar --geojson config/server.properties config/harbin.properties
Note: Stop server with Ctrl-c.
Note: In case of 'parse errors', use the following Java options:
-Duser.language=en -Duser.country=US
P. Newson and J. Krumm. Hidden Markov Map Matching Through Noise and Sparseness. In Proceedings of International Conference on Advances in Geographic Information Systems, 2009.