Difference between revisions of "OpenStreetMap"

From HoerupWiki
Jump to: navigation, search
(Routing)
(Routing)
Line 4: Line 4:
 
* [https://github.com/Project-OSRM/osrm-backend osrm github]
 
* [https://github.com/Project-OSRM/osrm-backend osrm github]
  
<code>
+
 
 
  #!/bin/bash
 
  #!/bin/bash
 
   
 
   
Line 10: Line 10:
 
  DATADIR=/mnt/qnap/openstreetmap
 
  DATADIR=/mnt/qnap/openstreetmap
  
if [ ! -f /usr/local/bin/osrm-extract ] ; then
+
if [ ! -f /usr/local/bin/osrm-extract ] ; then
 
   apt-get install build-essential git cmake pkg-config libprotoc-dev  protobuf-compiler libprotobuf-dev libosmpbf-dev libpng12-dev libbz2-dev libstxxl-dev libstxxl-doc libstxxl1  
 
   apt-get install build-essential git cmake pkg-config libprotoc-dev  protobuf-compiler libprotobuf-dev libosmpbf-dev libpng12-dev libbz2-dev libstxxl-dev libstxxl-doc libstxxl1  
 
   apt-get install libxml2-dev libzip-dev libboost-all-dev lua5.1 liblua5.1-0-dev libluabind-dev  libtbb-dev
 
   apt-get install libxml2-dev libzip-dev libboost-all-dev lua5.1 liblua5.1-0-dev libluabind-dev  libtbb-dev
 
+
 
+
 
   cd /root
 
   cd /root
 
+
 
   git clone https://github.com/Project-OSRM/osrm-backend.git
 
   git clone https://github.com/Project-OSRM/osrm-backend.git
 
   cd osrm-backend
 
   cd osrm-backend
 
   mkdir -p build
 
   mkdir -p build
 
   cd build
 
   cd build
 
+
 
   cmake ..
 
   cmake ..
 
   make -j 2
 
   make -j 2
 
   make install
 
   make install
fi
+
fi
 
+
 
+
##########################################
+
##########################################
 
+
 
+
cd $DATADIR
+
cd $DATADIR
 
+
if [ ! -f denmark-latest.osm ] ; then
+
if [ ! -f denmark-latest.osm ] ; then
wget http://download.geofabrik.de/europe/denmark-latest.osm.bz2
+
  wget http://download.geofabrik.de/europe/denmark-latest.osm.bz2
bunzip2 denmark-latest.osm.bz2
+
  bunzip2 denmark-latest.osm.bz2
fi
+
fi
 
+
 
+
cd /root/osrm-backend
cd /root/osrm-backend
+
 
+
if [ ! -f $DATADIR/denmark-latest.osrm ] ; then
if [ ! -f $DATADIR/denmark-latest.osrm ] ; then
+
  osrm-extract $DATADIR/denmark-latest.osm
osrm-extract $DATADIR/denmark-latest.osm
+
fi
fi
+
 
+
if [ ! -f $DATADIR/denmark-latest.osrm.edges ] ; then
if [ ! -f $DATADIR/denmark-latest.osrm.edges ] ; then
+
  osrm-prepare $DATADIR/denmark-latest.osrm
osrm-prepare $DATADIR/denmark-latest.osrm
+
fi
fi
+
 
+
cd $DATADIR
cd $DATADIR
+
 
+
osrm-routed denmark-latest.osrm
osrm-routed denmark-latest.osrm
 
</code>
 

Revision as of 22:56, 18 November 2014

Routing


#!/bin/bash


DATADIR=/mnt/qnap/openstreetmap
if [ ! -f /usr/local/bin/osrm-extract ] ; then
 apt-get install build-essential git cmake pkg-config libprotoc-dev  protobuf-compiler libprotobuf-dev libosmpbf-dev libpng12-dev libbz2-dev libstxxl-dev libstxxl-doc libstxxl1 
 apt-get install libxml2-dev libzip-dev libboost-all-dev lua5.1 liblua5.1-0-dev libluabind-dev  libtbb-dev


 cd /root

 git clone https://github.com/Project-OSRM/osrm-backend.git
 cd osrm-backend
 mkdir -p build
 cd build

 cmake ..
 make -j 2
 make install
fi


##########################################


cd $DATADIR

if [ ! -f denmark-latest.osm ] ; then
  wget http://download.geofabrik.de/europe/denmark-latest.osm.bz2
  bunzip2 denmark-latest.osm.bz2
fi

cd /root/osrm-backend

if [ ! -f $DATADIR/denmark-latest.osrm ] ; then
  osrm-extract $DATADIR/denmark-latest.osm
fi

if [ ! -f $DATADIR/denmark-latest.osrm.edges ] ; then
  osrm-prepare $DATADIR/denmark-latest.osrm
fi

cd $DATADIR

osrm-routed denmark-latest.osrm