homogénéisation upload vers serveur
This commit is contained in:
parent
ec467a556b
commit
a84d63fa58
|
@ -5,11 +5,17 @@
|
|||
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
# on récupère les couches geojson depuis umap
|
||||
|
||||
|
||||
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
|
||||
echo " Récupération des fichiers geojson depuis umap"
|
||||
|
||||
# le tracé manuel
|
||||
curl -sS http://umap.openstreetmap.fr/fr/datalayer/746021/ > data/phase_1_umap_trace.geojson
|
||||
# PK VIP
|
||||
curl -sS http://umap.openstreetmap.fr/fr/datalayer/715179/ > data/phase_1_umap_pk_vip.geojson
|
||||
|
||||
echo " fait"
|
||||
echo ""
|
||||
|
||||
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
# on charge dans postgis
|
||||
|
@ -17,16 +23,36 @@ curl -sS http://umap.openstreetmap.fr/fr/datalayer/715179/ > data/phase_1_umap_
|
|||
|
||||
# note : les coordonnées sont en 3857 mais la déclaration de la table = 4326
|
||||
|
||||
echo " chargement des fichiers dans la BD"
|
||||
echo ""
|
||||
|
||||
psql -U redadeg -d redadeg -c "DROP TABLE phase_1_trace_3857 CASCADE;"
|
||||
ogr2ogr -f "PostgreSQL" PG:"host=localhost user=redadeg password=redadeg dbname=redadeg" data/phase_1_umap_trace.geojson -nln phase_1_trace_3857 -lco GEOMETRY_NAME=the_geom -explodecollections -overwrite
|
||||
|
||||
psql -U redadeg -d redadeg -c "DROP TABLE phase_1_pk_vip_3857;"
|
||||
ogr2ogr -f "PostgreSQL" PG:"host=localhost user=redadeg password=redadeg dbname=redadeg" data/phase_1_umap_pk_vip.geojson -nln phase_1_pk_vip_3857 -lco GEOMETRY_NAME=the_geom -explodecollections -overwrite
|
||||
|
||||
echo " fait"
|
||||
echo ""
|
||||
|
||||
|
||||
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
|
||||
echo " Application des traitements SQL "
|
||||
echo ""
|
||||
|
||||
# on crée les tables en 3948
|
||||
psql -U redadeg -d redadeg < traitements_phase_1.sql
|
||||
|
||||
echo " fait"
|
||||
echo ""
|
||||
|
||||
|
||||
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
|
||||
echo " Exports et upload vers le serveur de diffusion"
|
||||
echo ""
|
||||
|
||||
echo " exports geojson"
|
||||
echo ""
|
||||
|
||||
# et on exporte vers Geojson
|
||||
rm data/phase_1_pk_auto.geojson
|
||||
|
@ -39,3 +65,20 @@ ogr2ogr -f "GeoJSON" data/phase_1_trace_4326.geojson PG:"host=localhost user=red
|
|||
rm data/phase_1_pk_auto.xlsx
|
||||
ogr2ogr -f "XLSX" data/phase_1_pk_auto.xlsx PG:"host=localhost user=redadeg password=redadeg dbname=redadeg" phase_1_pk_auto_4326
|
||||
|
||||
echo " fait"
|
||||
echo ""
|
||||
echo " upload"
|
||||
echo ""
|
||||
|
||||
# upload
|
||||
rsync -av -z data/phase_1_pk_auto.geojson data/phase_1_trace_4326.geojson data/phase_1_pk_auto.xlsx breizhpovh2:/data/www/vhosts/ar-redadeg_openstreetmap_bzh/htdocs/scripts/data/
|
||||
|
||||
echo " fait"
|
||||
echo ""
|
||||
|
||||
echo ""
|
||||
echo ""
|
||||
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
|
||||
echo " F I N traitements phase 1"
|
||||
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
|
||||
echo ""
|
||||
|
|
|
@ -224,7 +224,7 @@ $PSQL -U $DB_USER -d $DB_NAME < traitements_phase_2.2.sql
|
|||
# et on exporte en geojson pour umap
|
||||
|
||||
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
|
||||
echo " Exports"
|
||||
echo " Exports et upload vers le serveur de diffusion"
|
||||
echo ""
|
||||
|
||||
echo " exports geojson"
|
||||
|
@ -250,11 +250,18 @@ ogr2ogr -f "CSV" data/phase_2_tdb.csv PG:"host=localhost user=redadeg password=r
|
|||
|
||||
echo " fait"
|
||||
echo ""
|
||||
echo " upload"
|
||||
echo ""
|
||||
|
||||
# upload
|
||||
rsync -av -z data/phase_2_pk_secteur.geojson data/phase_2_trace_pgr.geojson data/phase_2_trace_secteur.geojson data/phase_2_tdb.xlsx data/phase_2_tdb.csv breizhpovh2:/data/www/vhosts/ar-redadeg_openstreetmap_bzh/htdocs/scripts/data/
|
||||
|
||||
echo " fait"
|
||||
echo ""
|
||||
|
||||
echo ""
|
||||
echo ""
|
||||
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
|
||||
echo " F I N"
|
||||
echo " F I N traitements phase 2"
|
||||
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
|
||||
echo ""
|
||||
|
|
|
@ -29,32 +29,35 @@ echo ""
|
|||
# et on exporte en geojson pour umap
|
||||
|
||||
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
|
||||
echo " Exports"
|
||||
echo " Exports et upload vers le serveur de diffusion"
|
||||
echo ""
|
||||
|
||||
echo " exports geojson"
|
||||
echo ""
|
||||
|
||||
#rm data/phase_3_pk_auto.geojson
|
||||
#ogr2ogr -f "GeoJSON" data/phase_3_pk_auto.geojson PG:"host=$DB_HOST user=redadeg password=redadeg dbname=redadeg" phase_3_pk_auto_4326
|
||||
#rm data/phase_3_pk_sens_verif.geojson
|
||||
#ogr2ogr -f "GeoJSON" data/phase_3_pk_sens_verif.geojson PG:"host=$DB_HOST user=redadeg password=redadeg dbname=redadeg" phase_3_pk_sens_verif_4326
|
||||
#rm data/phase_3_trace_troncons.geojson
|
||||
#ogr2ogr -f "GeoJSON" data/phase_3_trace_troncons.geojson PG:"host=$DB_HOST user=redadeg password=redadeg dbname=redadeg" phase_3_trace_troncons_4326
|
||||
#rm data/phase_3_trace_secteurs.geojson
|
||||
#ogr2ogr -f "GeoJSON" data/phase_3_trace_secteurs.geojson PG:"host=$DB_HOST user=redadeg password=redadeg dbname=redadeg" phase_3_trace_secteurs_4326
|
||||
rm data/phase_3_pk_auto.geojson
|
||||
ogr2ogr -f "GeoJSON" data/phase_3_pk_auto.geojson PG:"host=$DB_HOST user=redadeg password=redadeg dbname=redadeg" phase_3_pk_auto_4326
|
||||
rm data/phase_3_pk_sens_verif.geojson
|
||||
ogr2ogr -f "GeoJSON" data/phase_3_pk_sens_verif.geojson PG:"host=$DB_HOST user=redadeg password=redadeg dbname=redadeg" phase_3_pk_sens_verif_4326
|
||||
rm data/phase_3_trace_troncons.geojson
|
||||
ogr2ogr -f "GeoJSON" data/phase_3_trace_troncons.geojson PG:"host=$DB_HOST user=redadeg password=redadeg dbname=redadeg" phase_3_trace_troncons_4326
|
||||
rm data/phase_3_trace_secteurs.geojson
|
||||
ogr2ogr -f "GeoJSON" data/phase_3_trace_secteurs.geojson PG:"host=$DB_HOST user=redadeg password=redadeg dbname=redadeg" phase_3_trace_secteurs_4326
|
||||
|
||||
echo " fait"
|
||||
echo ""
|
||||
echo " upload"
|
||||
echo ""
|
||||
|
||||
# upload
|
||||
rsync -av -z data/phase_3_*.geojson breizhpovh2:/data/www/vhosts/ar-redadeg_openstreetmap_bzh/htdocs/scripts/data/
|
||||
|
||||
echo " fait"
|
||||
echo ""
|
||||
|
||||
|
||||
rsync -av -z data/phase_3_*.geojson breizhpovh2:/data/www/vhosts/ar-redadeg_openstreetmap_bzh/htdocs/scripts/data/
|
||||
|
||||
|
||||
echo ""
|
||||
echo ""
|
||||
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
|
||||
echo " F I N"
|
||||
echo " F I N traitements phase 3"
|
||||
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
|
||||
echo ""
|
||||
|
|
Loading…
Reference in a new issue