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

Pocosrm #82

Closed
wants to merge 4 commits into from
Closed
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
66 changes: 0 additions & 66 deletions docker/config/bdtopo2osrm.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,72 +81,6 @@
}
}
},
{
"id": "bdtopo-car-shortest",
"type": "osrm",
"description": "Graphe BDuni au format OSRM France entière",
"projection": "EPSG:4326",
"bbox": "-180,-90,180,90",
"mapping": {
"source": {
"baseId": "base_bduni"
},
"conversion": {
"file": "/home/docker/sql/bduni_convert.sql"
}
},
"storage": {
"file": "/home/docker/data/bdtopo-car-shortest/bdtopo-car-shortest.osrm"
},
"cost": {
"profile": "car",
"optimization": "shortest",
"compute": {
"storage": {
"file": "/home/docker/config/bdtopo-car-shortest.lua"
},
"configuration": {
"name": "cost_m_car",
"storage": {
"file": "/home/docker/config/costs_calculation.json"
}
}
}
}
},
{
"id": "bdtopo-pedestrian-fastest",
"type": "osrm",
"description": "Graphe BDuni au format OSRM France entière",
"projection": "EPSG:4326",
"bbox": "-180,-90,180,90",
"mapping": {
"source": {
"baseId": "base_bduni"
},
"conversion": {
"file": "/home/docker/sql/bduni_convert.sql"
}
},
"storage": {
"file": "/home/docker/data/bdtopo-pedestrian-fastest/bdtopo-pedestrian-fastest.osrm"
},
"cost": {
"profile": "pedestrian",
"optimization": "fastest",
"compute": {
"storage": {
"file": "/home/docker/config/bdtopo-pedestrian-fastest.lua"
},
"configuration": {
"name": "cost_s_pedestrian",
"storage": {
"file": "/home/docker/config/costs_calculation.json"
}
}
}
}
},
{
"id": "bdtopo-pedestrian-shortest",
"type": "osrm",
Expand Down
47 changes: 8 additions & 39 deletions docker/scripts/r2gg_pipeline.sh
Original file line number Diff line number Diff line change
@@ -1,41 +1,10 @@
#!/usr/bin/env sh


## S'il n'y a rien, on fait une génération à partir de données OSM sur la Corse en utilisant un fichier de configuration déjà présent dans l'image docker
if [ ! $R2GG_ARG ]
then

mkdir -v /home/docker/data/data-osm-latest
cd /home/docker/data/data-osm-latest
wget -O data-osm-latest.osm.pbf download.geofabrik.de/europe/france/corse-latest.osm.pbf
osrm-extract data-osm-latest.osm.pbf -p /usr/share/osrm/profiles/car.lua
osrm-contract data-osm-latest.osrm
mkdir -p /home/docker/data/resources/
mkdir -p /home/docker/data/sources/
cp -v /home/docker/config/data-osm.resource /home/docker/data/resources/
cp -v /home/docker/config/data-osm.source /home/docker/data/sources/

## S'il y a une configuration, alors on donne cette configuration à r2gg qui se chargera de l'analyser et d'agir en conséquence
else

# On lance une génération à partir du fichier de configuration
r2gg-sql2pivot $R2GG_ARG

if [ $GENERATION_TYPE = "osrm" ]
then
r2gg-pivot2osm $R2GG_ARG
r2gg-osm2osrm $R2GG_ARG
elif [ $GENERATION_TYPE = "pgr" ] || [ $GENERATION_TYPE = "smartpgr" ]
then
r2gg-pivot2pgrouting $R2GG_ARG
elif [ $GENERATION_TYPE = "valhalla" ]
then
r2gg-pivot2osm $R2GG_ARG
r2gg-osm2valhalla $R2GG_ARG
fi

r2gg-road2config $R2GG_ARG

fi


echo "debut"
date +%Y-%m-%dT%H:%M:%S
r2gg-pivot2osm /home/docker/config/bdtopo2osrm.json
echo "fin pivot2osm"
date +%Y-%m-%dT%H:%M:%S
r2gg-osm2osrm /home/docker/config/bdtopo2osrm.json
echo "fin"
date +%Y-%m-%dT%H:%M:%S
2 changes: 1 addition & 1 deletion r2gg/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def osrm_convert(config, resource, logger, build_lua_from_cost_config = True):

# Définition des commandes shell à exécuter
mkdir_args = ["mkdir", "-p", cost_dir]
copy_args = ["cp", ".".join(osm_file.split(".")[:-1]) + extension, tmp_osm_file]
copy_args = ["ln", "-s", ".".join(osm_file.split(".")[:-1]) + extension, tmp_osm_file]
osrm_extract_args = ["osrm-extract", tmp_osm_file, "-p", lua_file, "-t", cpu_count]
osrm_contract_args = ["osrm-contract", osrm_file, "-t", cpu_count]
rm_args = ["rm", tmp_osm_file]
Expand Down
Loading