Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add relation between raw GPS sample and the matched candidate #78

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
sudo: required
language: java
jdk:
# Build and test Barefoot library using JDK 7, 8, 9
- openjdk7
- oraclejdk8
- oraclejdk9
matrix:
include:
# Add a separate test for Python code
- env: NAME="Python Map Tools"
install: true
before_script:
# Ensure PostgreSQL server is ready
- until docker exec barefoot-database sudo --user=postgres -- psql --command='select 1;'; do sleep 1; done
script: docker exec barefoot-database /bin/bash /mnt/map/tools/test/run.sh
services:
- docker
before_install:
- docker build -t barefoot-map ./map
# Stop existing PostgreSQL - https://github.com/travis-ci/travis-ci/issues/4842#issuecomment-311527059
- sudo service postgresql stop
- docker run -t -d -p 5432:5432 --name="barefoot-database" -v ${PWD}/map/:/mnt/map barefoot-map
before_script:
- curl http://download.geofabrik.de/europe/germany/bayern/oberbayern-latest.osm.pbf --output map/osm/oberbayern.osm.pbf
# Ensure PostgreSQL server is ready
- until docker exec barefoot-database sudo --user=postgres -- psql --command='select 1;'; do sleep 1; done
# Osmosis takes about 10 minutes to process the Oberbayern map used for testing, which coincides with
# Travis' timeout for output updates. Use `travis_wait` to extend the timeout.
# Use interactive option to force bash to read .bashrc and add path to Osmosis.
- travis_wait docker exec barefoot-database /bin/bash -i /mnt/map/osm/import.sh
14 changes: 8 additions & 6 deletions map/osm/import.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# language governing permissions and limitations under the License.
#

set -o errexit -o nounset -x

if [ "$#" -eq "6" ] && ( [ "$6" = "slim" ] || [ "$6" = "normal" ] )
then
input=$1
Expand All @@ -35,16 +37,16 @@ else
fi

echo "Start creation and initialization of database '${database}' ..."
sudo -u postgres createdb ${database}
sudo -u postgres psql -d ${database} -c "CREATE EXTENSION hstore;"
sudo -u postgres psql -d ${database} -c "CREATE EXTENSION postgis;"
sudo -u postgres createdb ${database} || true
sudo -u postgres psql -d ${database} -c "CREATE EXTENSION hstore;" || true
sudo -u postgres psql -d ${database} -c "CREATE EXTENSION postgis;" || true
echo "Done."

echo "Start creation of user and initialization of credentials ..."
sudo -u postgres psql -c "CREATE USER \"${user}\" PASSWORD '${password}';"
sudo -u postgres psql -c "CREATE USER \"${user}\" PASSWORD '${password}';" || true
sudo -u postgres psql -c "GRANT ALL ON DATABASE \"${database}\" TO \"${user}\";"
passphrase="localhost:5432:${database}:${user}:${password}"
if [ ! -e ~/.pgpass ] || [ `less ~/.pgpass | grep -c "$passphrase"` -eq 0 ]
if [ ! -e ~/.pgpass ] || [ `cat ~/.pgpass | grep -c "$passphrase"` -eq 0 ]
then
echo "$passphrase" >> ~/.pgpass
chmod 0600 ~/.pgpass
Expand All @@ -55,7 +57,7 @@ echo "Start population of OSM data (osmosis) ..."
psql -h localhost -d ${database} -U ${user} -f /mnt/map/osm/pgsnapshot_schema_0.6.sql
rm -rf /mnt/map/osm/tmp
mkdir /mnt/map/osm/tmp
if [ -z "$JAVACMD_OPTIONS" ]; then
if [ -z "${JAVACMD_OPTIONS+x}" ]; then
JAVACMD_OPTIONS="-Djava.io.tmpdir=/mnt/map/osm/tmp"
else
JAVACMD_OPTIONS="$JAVACMD_OPTIONS -Djava.io.tmpdir=/mnt/map/osm/tmp"
Expand Down
2 changes: 1 addition & 1 deletion map/pgsql/pg_hba.conf.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
#local replication postgres peer
#host replication postgres 127.0.0.1/32 md5
#host replication postgres ::1/128 md5
+host all all 172.17.0.0/16 md5
+host all all samenet md5

14 changes: 9 additions & 5 deletions map/tools/test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,21 @@
# language governing permissions and limitations under the License.
#

set -o errexit -o nounset

. /mnt/map/tools/test/test.properties
export PYTHONPATH=/mnt/map/tools/
cd /mnt/map/tools/test

echo "Create ${database} database ..."
sudo -u postgres psql -q -c "CREATE DATABASE ${database};"
function cleanup {
echo "Delete ${database} database ..."
sudo -u postgres psql -q -c "DROP DATABASE ${database};"
sudo -u postgres psql -q -c "DROP USER IF EXISTS ${user};"
echo "Done."
}
trap cleanup EXIT
sudo -u postgres psql -q -d ${database} -c "CREATE EXTENSION hstore;"
sudo -u postgres psql -q -d ${database} -c "CREATE EXTENSION postgis;"
sudo -u postgres psql -q -c "CREATE USER ${user} PASSWORD '${password}';"
Expand All @@ -28,8 +37,3 @@ echo "Run bfmap test ..."
sudo -u postgres psql -q -d ${database} -f /mnt/map/tools/test/${bfmap_table}
sudo -u postgres psql -q -d ${database} -c "GRANT ALL ON TABLE temp_ways TO ${user};"
python -m unittest test_bfmap

echo "Delete ${database} database ..."
sudo -u postgres psql -q -c "DROP DATABASE ${database};"
sudo -u postgres psql -q -c "DROP USER IF EXISTS ${user};"
echo "Done."
Binary file added misc/tudd/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions misc/tudd/1_decoded.geojson

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions misc/tudd/1_orginal.geojson

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions misc/tudd/1_result.json

Large diffs are not rendered by default.

Loading