Subversion Repositories eFlore/Projets.eflore-projets

Compare Revisions

No changes between revisions

Ignore whitespace Rev 1053 → Rev 1054

/trunk/scripts/modules/osm/shell/carto-osm-service
File deleted
/trunk/scripts/modules/osm/shell/carto-osm-cron
File deleted
/trunk/scripts/modules/osm/shell/carto-osm-maj
File deleted
\ No newline at end of file
/trunk/scripts/modules/osm/shell/extract-poly
File deleted
\ No newline at end of file
/trunk/scripts/modules/osm/shell/extract-communes
File deleted
\ No newline at end of file
/trunk/scripts/modules/osm/shell/pbf2mysql-boundary.defaut.cfg
New file
0,0 → 1,29
# Binaires
BIN_JAVA="/usr/java/latest/bin/java"
BIN_OSMOSIS="$HOME/Applications/osmosis-0.43.1/bin/osmosis"
BIN_OGR="$HOME/Applications/gdal_1.10.1/bin/ogr2ogr"
 
# Dossiers, fichiers & urls
DOSSIER_BASE="/home/jpm/web/eflore/eflore-projets/donnees/osm"
DOSSIER_OSM="${DOSSIER_BASE}/tests"
 
# Osmosis config
OSMOSIS_DOSSIER_TMP="${DOSSIER_BASE}/tmp"
OSMOSIS_MAX_MEMORY="4G"
 
# Ogr2Ogr config
OSM_CONF_INI="pbf2mysql-boundary.ini"
OSM_MAX_TMPFILE_SIZE=8000
 
# Mysql config
MYSQL_UNIX_PORT="/opt/lampp/var/mysql/mysql.sock"
MYSQL_DATABASE="osm"
MYSQL_USER=""
MYSQL_PASSWORD=""
MYSQL_HOST="localhost"
MYSQL_PORT="3306"
 
# Logs
DATE=`date +"%F"`
DOSSIER_LOG="$DOSSIER_BASE/logs"
FICHIER_LOG="$DOSSIER_LOG/analyse_${DATE}.log"
/trunk/scripts/modules/osm/shell/extract-communes.sh
New file
0,0 → 1,34
#!/bin/bash
# Utilisation : ./extract-communes fr-14
# Paramètres : .
# - 1 : nom du fichier .pbf dont on veut extraire les communes (sans extenssion)
# Sortie : nom du fichier .pbf suffixé par "_new" et avec l'extenssion .osm
#
ageEnSeconde(){ expr `date +%s` - `stat -c %Y $1`; };
 
if [ -f config.cfg ] ; then
source config.cfg
echo $DATE;
else
echo "Veuillez paramétrer le script en renommant le fichier 'config.defaut.cfg' en 'config.cfg'."
exit;
fi
 
FICHIER=$1
 
echo "Export de l'emplacement du binaire Java dans la variable d'environnement JAVACMD";
export JAVACMD="$CHEMIN_JAVA"
 
echo "Export de l'emplacement du dossier tmp pour Osmosis"
export JAVACMD_OPTIONS="-Djava.io.tmpdir=$OSMOSIS_DOSSIER_TMP -Xmx4G"
 
echo "Filtrage du fichier en cours ...";
$CHEMIN_OSMOSIS \
-v \
--read-pbf-fast "$DOSSIER_OSM/$FICHIER.pbf" workers=6 \
--tf accept-relations admin_level=8 \
--tf accept-relations type=boundary \
--tf accept-relations ref:INSEE=* \
--used-way \
--used-node \
--wx "$DOSSIER_OSM/${FICHIER}_new.osm"
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/trunk/scripts/modules/osm/shell/pbf2mysql-boundary.sh
New file
0,0 → 1,69
#!/bin/bash
# Utilisation : ./pbf2mysql-boundary
# Paramètres : .
# - 1 : nom du fichier .pbf dont on veut extraire les relations boundary (sans extenssion)
 
ageEnSeconde(){ expr `date +%s` - `stat -c %Y $1`; };
 
if [ -f pbf2mysql-boundary.cfg ] ; then
source pbf2mysql-boundary.cfg
echo $DATE;
else
echo "Veuillez paramétrer le script en renommant le fichier 'pbf2mysql-boundary.defaut.cfg' en 'pbf2mysql-boundary.cfg'."
exit;
fi
 
# Récupération du fichier OSM dont on veut extraire les relations de type boundary vers Mysql
FICHIER=$1
URL_DOWNLOAD=$2
 
echo "Export de l'emplacement du binaire Java dans la variable d'environnement JAVACMD";
export JAVACMD="$BIN_JAVA"
 
echo "Export de l'emplacement du dossier tmp pour Osmosis"
export JAVACMD_OPTIONS="-Djava.io.tmpdir=${OSMOSIS_DOSSIER_TMP} -Xmx${OSMOSIS_MAX_MEMORY} -server"
 
#if [ ! -f "${DOSSIER_OSM}/${FICHIER}.osm.pbf" ] || [ `ageEnSeconde "${DOSSIER_OSM}/${FICHIER}.osm.pbf"` -gt 86000 ] ; then
# echo "Téléchargement du nouveau fichier PBF ...";
# wget $URL_DOWNLOAD -O "${DOSSIER_OSM}/${FICHIER}.osm.pbf"
#else
# echo "Fichier ${FICHIER}.osm.pbf existant depuis moins d'un jour.";
#fi
 
if [ ! -f "${DOSSIER_OSM}/${FICHIER}_boundary.osm.pbf" ] || [ `ageEnSeconde "${DOSSIER_OSM}/${FICHIER}_boundary.osm.pbf"` -gt 86000 ] ; then
echo "Filtrage du fichier en cours ...";
$BIN_OSMOSIS \
-v \
--read-pbf-fast "${DOSSIER_OSM}/${FICHIER}.osm.pbf" workers=6 \
--tf accept-relations admin_level=* \
--tf accept-relations type=boundary \
--used-way \
--used-node \
--buffer --write-pbf "${DOSSIER_OSM}/${FICHIER}_boundary.osm.pbf"
 
# Test avec communauté de communes du Haut-Allier
# --tf accept-relations admin_level=8 \
# --tf accept-relations type=boundary \
# --tf accept-relations ref:INSEE=48010,48041,48048,48062,48080,48086,48105,48129,48150 \
else
echo "Fichier filtré ${FICHIER}_boundary.osm.pbf existant depuis moins d'un jour.";
fi
 
#------------------------------------------------------------------------------------------------------------
# ATTENTION : nécessite ici de reconstruire les relations incomplètes avant d'utiliser ogr2ogr
#------------------------------------------------------------------------------------------------------------
 
if [ ! -f "${DOSSIER_OSM}/${FICHIER}_boundary.osm.pbf" ] ; then
echo "Impossible de trouver ${FICHIER}_boundary.osm.pbf existant depuis moins d'un jour.";
else
echo "Importation dans MySQL en cours ...";
$BIN_OGR \
--config OSM_CONFIG_FILE $OSM_CONF_INI \
--config MYSQL_UNIX_PORT $MYSQL_UNIX_PORT \
-overwrite \
-progress \
-f "MySQL" MYSQL:${MYSQL_DATABASE},user=${MYSQL_USER},password=${MYSQL_PASSWORD},host=${MYSQL_HOST},port=${MYSQL_PORT} \
-lco engine=MYISAM \
-lco spatial_index=no \
"${DOSSIER_OSM}/${FICHIER}_boundary.osm.pbf" multipolygons points
fi
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:eol-style
+native
\ No newline at end of property
/trunk/scripts/modules/osm/shell/carto-osm-service.sh
New file
0,0 → 1,41
#!/bin/sh
#/etc/rc.d/init.d/
#
# Jean-Pascal MILCENT & Mohcen BENMOUNAH [19 juillet 2011]
# Service de lancement des scripts d'integration des donnees OSM pour le service de Geocadage Inverse
#
case "$1" in
 
start)
 
echo "Demarrage de carto-osm-cron :"
nohup /usr/local/sbin/carto-osm-cron 1>/dev/null 2>/dev/null &
 
;;
 
stop)
 
echo "Arret de carto-osm-cron"
PID=`ps -eaf | grep carto-osm-cron | grep -v grep | tr -s ' ' | cut -d' ' -f2 | head -n1`
kill -9 ${PID}
 
;;
 
status)
 
echo -n "Voici les PID du processus carto-osm-cron :"
PID=`ps -eaf | grep carto-osm-cron | grep -v grep | tr -s ' ' | cut -d' ' -f2 | head -n1`
echo ${PID}
 
;;
 
 
*)
 
echo "Usage: {start|stop|status}"
 
exit 1
 
;;
 
esac
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/trunk/scripts/modules/osm/shell/carto-osm-cron.sh
New file
0,0 → 1,30
#!/bin/bash
#
# Mohcen BENMOUNAH & Jean-Pascal MILCENT [19 juillet 2011]
# /etc/init.d/carto-osm : demarage/arrete/etat du cron de l'integration des donnees OSM pour le Geocodage Inverse (carto-osm)
# Lancement toutes les semaines le samedi matin après 3h00
 
while true
do
JOUR=$(date "+%u")
# Si nous sommes samedi (=6)
if [ $JOUR -eq 6 ] ; then
HEURE=$(date "+%H")
# Si nous sommes à 3 heures du matin
if [ $HEURE -eq 3 ] ; then
logger "carto-osm-maj : lancement script"
sudo -u telabotap /usr/local/sbin/carto-osm-maj
logger "carto-osm-maj : arret script"
# Nous retenterons de vérifier jour et heure dans 6 jours
sleep 6d
else
# Tentative toutes les heures
logger "carto-osm-maj : tentative heure $HEURE"
sleep 1h
fi
else
# Tentative tous les jours
logger "carto-osm-maj : tentative jour $JOUR"
sleep 1d
fi
done
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/trunk/scripts/modules/osm/shell/gdal-1.10.sh
New file
0,0 → 1,66
#!/bin/bash
# Encodage : UTF-8
# Compilation de Gdal 1.10
# Copyright Jean-Pascal Milcent 2014
# Licence de ce script : GPL v3 & CeCILL v2
#
# Log des modifications de ce script :
# 2014-04-08 [Jean-Pascal MILCENT] : Creation du script Gdal v 1.10
 
# Indiquer la version de Gdal à compiler
VERSION="svn-trunk-2014.04.07"
URL_DOWNLOAD="http://www.gdal.org/daily/gdal-${VERSION}.tar.gz"
BUILD_DIR="${HOME}/bin"
INSTALL_DIR="${HOME}/Applications"
MYSQL_CONFIG="/opt/lampp/bin/mysql_config"
 
echo "Installation des paquets pour les librairies standards :"
sudo urpmi lib64xml2-devel lib64expat1-devel lib64sqlite3-devel lib64pcre-devel
 
echo "Récupération des sources à compiler :"
cd ${BUILD_DIR}/src/targz
 
if [ ! -f gdal-${VERSION}.tar.gz ] ; then
wget $URL_DOWNLOAD -O gdal-${VERSION}.tar.gz
fi
 
echo "Décompression des sources :"
# Effacement du dossier source pré-existant au cas ou
cd ${BUILD_DIR}/src
rm -rf gdal-${VERSION}
# Décompression des sources
tar xvfz targz/gdal-${VERSION}.tar.gz
# Déplacement dans le dossier des sources pour compiler
cd gdal-${VERSION}
 
echo "Configuration, compilation et installation :"
./configure \
--prefix=${INSTALL_DIR}/gdal-${VERSION} \
--with-threads \
--with-ogr \
--with-geos \
--with-libz=internal \
--with-libtiff=internal \
--with-geotiff=internal \
--with-png=internal \
--with-libtiff=internal \
--with-geotiff=internal \
--with-jpeg=internal \
--with-hide-internal-symbols \
--with-expat \
--with-xml2 \
--with-sqlite3=yes \
--with-pcre \
--with-mysql=$MYSQL_CONFIG \
--with-fgdb=${INSTALL_DIR}/lib/FileGDB_API
 
make
make install
 
echo "Création des liens symboliques vers les lib FileGDB dans le dossier lib de gdal :"
cd ${INSTALL_DIR}/gdal-${VERSION}/lib
ln -s ${INSTALL_DIR}/lib/FileGDB_API/lib/libFileGDBAPI.so libFileGDBAPI.so
ln -s ${INSTALL_DIR}/lib/FileGDB_API/lib/libfgdbunixrtl.so libfgdbunixrtl.so
 
echo "Création des liens pour les autres lib manquante... :"
ln -s /usr/lib64/libpng15.so.15 libpng15.so.15
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:eol-style
+native
\ No newline at end of property
/trunk/scripts/modules/osm/shell/pbf2mysql-boundary.ini
New file
0,0 → 1,100
#
# Configuration file for OSM import
#
 
# put here the name of keys for ways that are assumed to be polygons if they are closed
# see http://wiki.openstreetmap.org/wiki/Map_Features
closed_ways_are_polygons=aeroway,amenity,boundary,building,craft,geological,historic,landuse,leisure,military,natural,office,place,shop,sport,tourism
 
# comment to avoid laundering of keys ( ':' turned into '_' )
attribute_name_laundering=yes
 
# uncomment to report all nodes, including the ones without any (significant) tag
#report_all_nodes=yes
 
# uncomment to report all ways, including the ones without any (significant) tag
#report_all_ways=yes
 
[points]
# common attributes
osm_id=yes
osm_version=no
osm_timestamp=no
osm_uid=no
osm_user=no
osm_changeset=no
 
# keys to report as OGR fields
attributes=name,place,addr:postcode,ref:INSEE,ref:SIREN,population,source:population,wikipedia
# keys that, alone, are not significant enough to report a node as a OGR point
unsignificant=created_by,converted_by,source,time,ele
# keys that should NOT be reported in the "other_tags" field
ignore=created_by,converted_by,source,time,ele,note,openGeoDB:,fixme,FIXME
# uncomment to avoid creation of "other_tags" field
#other_tags=no
 
[lines]
# common attributes
osm_id=yes
osm_version=no
osm_timestamp=no
osm_uid=no
osm_user=no
osm_changeset=no
 
# keys to report as OGR fields
attributes=name,highway,waterway,aerialway,barrier,man_made
# keys that should NOT be reported in the "other_tags" field
ignore=created_by,converted_by,source,time,ele,note,openGeoDB:,fixme,FIXME
# uncomment to avoid creation of "other_tags" field
#other_tags=no
 
[multipolygons]
# common attributes
# note: for multipolygons, osm_id=yes instanciates a osm_id field for the id of relations
# and a osm_way_id field for the id of closed ways. Both fields are exclusively set.
osm_id=yes
osm_version=no
osm_timestamp=no
osm_uid=no
osm_user=no
osm_changeset=no
 
# keys to report as OGR fields
attributes=name,type,admin_level,boundary,ISO3166-2,ref:NUTS,ref,ref:INSEE,addr:postcode,population,source:population,wikipedia,name:fr,name:en,name:es
# keys that should NOT be reported in the "other_tags" field
ignore=area,created_by,converted_by,source,time,ele,note,openGeoDB:,fixme,FIXME
# uncomment to avoid creation of "other_tags" field
#other_tags=no
 
[multilinestrings]
# common attributes
osm_id=yes
osm_version=no
osm_timestamp=no
osm_uid=no
osm_user=no
osm_changeset=no
 
# keys to report as OGR fields
attributes=name,type
# keys that should NOT be reported in the "other_tags" field
ignore=area,created_by,converted_by,source,time,ele,note,openGeoDB:,fixme,FIXME
# uncomment to avoid creation of "other_tags" field
#other_tags=no
 
[other_relations]
# common attributes
osm_id=yes
osm_version=no
osm_timestamp=no
osm_uid=no
osm_user=no
osm_changeset=no
 
# keys to report as OGR fields
attributes=name,type
# keys that should NOT be reported in the "other_tags" field
ignore=area,created_by,converted_by,source,time,ele,note,openGeoDB:,fixme,FIXME
# uncomment to avoid creation of "other_tags" field
#other_tags=no
/trunk/scripts/modules/osm/shell/extract-communes-ccha.defaut.cfg
New file
0,0 → 1,10
# Binaires
BIN_JAVA="/usr/java/latest/bin/java"
BIN_OSMOSIS="$HOME/Applications/osmosis-0.43.1/bin/osmosis"
 
# Dossiers, fichiers & urls
DOSSIER_BASE="/home/jpm/web/eflore/eflore-projets/donnees/osm"
DOSSIER_OSM="${DOSSIER_BASE}/tests"
 
# Osmosis config
OSMOSIS_DOSSIER_TMP="${DOSSIER_BASE}/tmp"
/trunk/scripts/modules/osm/shell/carto-osm-maj.sh
New file
0,0 → 1,91
#!/bin/bash
#
# Script de lancement de l'integration des donnees OSM pour le geocodage inverse
# Mohcen BENMOUNAH & Jean-Pascal MILCENT [19 juillet 2011]
#
ageEnSeconde(){ expr `date +%s` - `stat -c %Y $1`; };
 
if [ -f config.cfg ] ; then
source config.cfg
echo $DATE;
else
echo "Veuillez paramétrer le script en renommant le fichier 'config.defaut.cfg' en 'config.cfg'."
exit;
fi
 
echo "Export de l'emplacement du binaire Java dans la variable d'environnement JAVACMD";
export JAVACMD="$CHEMIN_JAVA"
 
echo "Export de l'emplacement du dossier tmp pour Osmosis"
export JAVACMD_OPTIONS="-Djava.io.tmpdir=$OSMOSIS_DOSSIER_TMP -Xmx4G"
 
if [ ! -f "$DOSSIER_OSM/$FICHIER_OSM" ] || [ `ageEnSeconde "$DOSSIER_OSM/$FICHIER_OSM"` -gt 86000 ] ; then
echo "Téléchargement du nouveau fichier PBF ...";
wget $URL_FICHIER_OSM -O "$DOSSIER_OSM/$FICHIER_OSM"
else
echo "Fichier $FICHIER_OSM existant à moins d'un jour.";
fi
 
if [ ! -f "$DOSSIER_OSM/$FICHIER_ZG_NEW" ] || [ `ageEnSeconde "$DOSSIER_OSM/$FICHIER_ZG_NEW"` -gt 86000 ] ; then
echo "Filtrage du fichier en cours ...";
$CHEMIN_OSMOSIS \
-v \
--read-pbf-fast "$DOSSIER_OSM/$FICHIER_OSM" workers=6 \
--tf accept-relations admin_level=8 \
--tf accept-relations type=boundary \
--tf accept-relations ref:INSEE=* \
--used-way \
--used-node \
--wx "$DOSSIER_OSM/$FICHIER_ZG_NEW"
fi
 
HEURE_DEBUT=`date +"%F %X"`;
echo "Début éxecution scripts php : $HEURE_DEBUT";
 
if [ ! -f "$DOSSIER_OSM/$FICHIER_ZG_OLD" ] ; then
echo "Création des tables osm en cours ...";
$CHEMIN_PHP -d memory_limit=$MEMORY_LIMIT_PHP $CHEMIN_SCRIPT/cli.php osm -a chargerStructureSql -v $VERBOSITE > $FICHIER_LOG
 
echo "Analyse du fichier osm en cours ...";
$CHEMIN_PHP -d memory_limit=$MEMORY_LIMIT_PHP $CHEMIN_SCRIPT/cli.php osm -a analyser -v $VERBOSITE -f "$DOSSIER_OSM/$FICHIER_ZG_NEW" >> $FICHIER_LOG
else
echo "Suppression du fichier DIFF existant en cours ...";
rm -f "$DOSSIER_OSM/$FICHIER_ZG_DIFF"
 
echo "Déduction de la différence en cours ...";
$CHEMIN_OSMOSIS\
--read-xml file="$DOSSIER_OSM/$FICHIER_ZG_NEW" \
--read-xml file="$DOSSIER_OSM/$FICHIER_ZG_OLD" \
--derive-change \
--write-xml-change file="$DOSSIER_OSM/$FICHIER_ZG_DIFF"
 
echo "Début de la mise à jour de base ...";
$CHEMIN_PHP -d memory_limit=$MEMORY_LIMIT_PHP $CHEMIN_SCRIPT/cli.php mise_a_jour -a MAJ -f "$DOSSIER_OSM/$FICHIER_ZG_DIFF" > $FICHIER_LOG
fi
 
echo "Renommage du fichier NEW en OLD en cours ...";
mv "$DOSSIER_OSM/$FICHIER_ZG_NEW" "$DOSSIER_OSM/$FICHIER_ZG_OLD" >> $FICHIER_LOG
 
echo "Traitement de l'ordre en cours ...";
$CHEMIN_PHP -d memory_limit=$MEMORY_LIMIT_PHP $CHEMIN_SCRIPT/cli.php osm -a ordre -v $VERBOSITE >> $FICHIER_LOG
 
echo "Remplissage des polygones en cours ...";
$CHEMIN_PHP -d memory_limit=$MEMORY_LIMIT_PHP $CHEMIN_SCRIPT/cli.php osm -a polygone -v $VERBOSITE >> $FICHIER_LOG
 
echo "Remise de l'ordre à zéro en cours ...";
$CHEMIN_PHP -d memory_limit=$MEMORY_LIMIT_PHP $CHEMIN_SCRIPT/cli.php osm -a zero -v $VERBOSITE >> $FICHIER_LOG
 
echo "Traitement de l'ordre des polygones incomplets en cours ...";
$CHEMIN_PHP -d memory_limit=$MEMORY_LIMIT_PHP $CHEMIN_SCRIPT/cli.php osm -a ordonnerPolygoneInc -v $VERBOSITE >> $FICHIER_LOG
 
echo "Remplissage des polygones incomplets en cours ...";
$CHEMIN_PHP -d memory_limit=$MEMORY_LIMIT_PHP $CHEMIN_SCRIPT/cli.php osm -a remplirPolygoneInc -v $VERBOSITE >> $FICHIER_LOG
 
echo "Renommage des polygones incomplets en cours ...";
$CHEMIN_PHP -d memory_limit=$MEMORY_LIMIT_PHP $CHEMIN_SCRIPT/cli.php osm -a renommer -v $VERBOSITE >> $FICHIER_LOG
 
echo "Definition des centroïdes en cours ...";
$CHEMIN_PHP -d memory_limit=$MEMORY_LIMIT_PHP $CHEMIN_SCRIPT/cli.php osm -a centre -v $VERBOSITE >> $FICHIER_LOG
 
HEURE_FIN=`date +"%F %X"`;
echo "Fin éxecution scripts php : $HEURE_FIN";
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/trunk/scripts/modules/osm/shell/extract-communes-ccha.sh
New file
0,0 → 1,33
#!/bin/bash
# Utilisation : ./extract-communes fr-14
# Paramètres : .
# - 1 : nom du fichier .pbf dont on veut extraire les communes (sans extenssion)
# Sortie : nom du fichier .pbf suffixé par "_new" et avec l'extenssion .osm
#
if [ -f extract-communes-ccha.cfg ] ; then
source extract-communes-ccha.cfg
echo $DATE;
else
echo "Veuillez paramétrer le script en renommant le fichier 'extract-communes-ccha.defaut.cfg' en 'extract-communes-ccha.cfg'."
exit;
fi
 
# Récupération du dossier OSM dont on veut extraire les communes
FICHIER=$1
 
echo "Export de l'emplacement du binaire Java dans la variable d'environnement JAVACMD";
export JAVACMD="$BIN_JAVA"
 
echo "Export de l'emplacement du dossier tmp pour Osmosis"
export JAVACMD_OPTIONS="-Djava.io.tmpdir=${OSMOSIS_DOSSIER_TMP} -Xmx4G"
 
echo "Filtrage du fichier en cours ...";
$BIN_OSMOSIS \
-v \
--read-pbf-fast "${DOSSIER_OSM}/${FICHIER}.osm.pbf" workers=6 \
--tf accept-relations admin_level=8 \
--tf accept-relations type=boundary \
--tf accept-relations ref:INSEE=48010,48041,48048,48062,48080,48086,48105,48129,48150 \
--used-way \
--used-node \
--write-pbf "${DOSSIER_OSM}/${FICHIER}_communes.osm.pbf"
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:eol-style
+native
\ No newline at end of property
/trunk/scripts/modules/osm/shell/extract-poly.sh
New file
0,0 → 1,29
#!/bin/bash
# Utilisation : ./extract-poly fr-p.osm.pbf fr-14
# Paramètres : .
# - 1 : nom du fichier .pbf dont on veut extraire une portion avec un fichier .poly
# - 2 : nom du fichier .poly sans extenssion (l'extrait aura le même nom avec l'extenssion .pbf)
#
if [ -f config.cfg ] ; then
source config.cfg
echo $DATE;
else
echo "Veuillez paramétrer le script en renommant le fichier 'config.defaut.cfg' en 'config.cfg'."
exit;
fi
 
FICHIER_OSM=$1
FICHIER=$2
 
echo "Export de l'emplacement du binaire Java dans la variable d'environnement JAVACMD";
export JAVACMD="$CHEMIN_JAVA"
 
echo "Export de l'emplacement du dossier tmp pour Osmosis"
export JAVACMD_OPTIONS="-Djava.io.tmpdir=$OSMOSIS_DOSSIER_TMP -Xmx4G"
 
echo "Filtrage du fichier en cours ...";
$CHEMIN_OSMOSIS \
-v \
--read-pbf-fast "$DOSSIER_OSM/$FICHIER_OSM" workers=6 \
--bounding-polygon file="$DOSSIER_OSM/$FICHIER.poly" \
--write-pbf file="$DOSSIER_OSM/$FICHIER.pbf"
Property changes:
Added: svn:executable
+*
\ No newline at end of property
/trunk/scripts/modules/osm/shell
Property changes:
Modified: svn:ignore
config.cfg
+.config.cfg.swp
+.extract-communes.swp
+pbf2mysql-boundary.cfg
+extract-communes-ccha.cfg