forked from osm-fr/bano
-
Notifications
You must be signed in to change notification settings - Fork 0
/
import-bano.sh
executable file
·77 lines (60 loc) · 2.59 KB
/
import-bano.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
. config || exit -1
if [[ $# != 3 && $# != 4 ]] ; then
echo "ERREUR: mauvais nombre d'arguments"
exit -1
fi
code_departement=$1
code_commune=$2
nom_commune=$3
bis=$4
if [ ${#code_departement} != 3 ] ; then
echo "ERREUR: le code département doit avoir 3 caractères"
exit -1
fi
if [ ${#code_commune} != 5 ] ; then
echo "ERREUR: le code commune doit avoir 5 caractères"
exit -1
fi
#
# Déduit le code INSEE
#
if [ ${code_departement:0:1} == "0" ] ; then
code_insee=${code_departement:1:2}${code_commune:2:3}
else
if [ ${code_departement:2:1} != ${code_commune:2:1} ] ; then
echo "ERREUR: le code commune ne correspond pas au code departement"
exit -1
fi
code_insee=${code_departement:0:2}${code_commune:2:3}
fi
#
# Lance la génération des adresses:
#
depdir="$DATA_DIR/$code_departement"
communedir="$HIDDEN_DIR/$code_departement/$code_commune"
if [ "$bis" = "false" ] ; then
nobis="-nobis"
fi
# command1="env LD_LIBRARY_PATH=/home/tyndare/.local/lib/ PYTHONPATH=/home/tyndare/.local/lib/python2.7/site-packages/ $PWD/cadastre_vers_osm_adresses_pour_bano.py $nobis $code_departement $code_commune"
command1="env LD_LIBRARY_PATH=/home/tyndare/.local/lib/ PYTHONPATH=/home/tyndare/.local/lib/python2.7/site-packages/ $PWD/cadastre_vers_osm_adresses.py $nobis $code_departement $code_commune"
command1dir="$communedir"
# command2="python addr_fantoir_building.py $code_insee $code_commune"
# command2dir=$PWD/cadastre-housenumber/associatedStreet
# command3="$PWD/cadastre-housenumber/supprime_relations_associatedStreet.py"
# file1="${depdir}/${code_commune}-${nom_commune}-adresses-associatedStreet_sans_batiment.zip"
# file2="${depdir}/${code_commune}-${nom_commune}-adresses-associatedStreet_mix_en_facade_ou_isole.zip"
# file3="${depdir}/${code_commune}-${nom_commune}-adresses-associatedStreet_tag_sur_batiment.zip"
# file4="${depdir}/${code_commune}-${nom_commune}-adresses-associatedStreet_point_sur_batiment.zip"
mkdir -p $communedir
chmod 02775 $communedir
cd $command1dir && $command1 || exit -1
# mv "$communedir/${code_commune}-adresses.zip" "${file1}"
# mv "$communedir/${code_commune}-adresses_buildings_proches.zip" "${file2}"
# $command3 "${file1}" "${file1/associatedStreet/addrstreet}"
# $command3 "${file2}" "${file2/associatedStreet/addrstreet}"
# cd $command2dir && $command2 || exit -1
# mv "$communedir/${code_commune}_adresse_tag_sur_batiment.zip" "${file3}"
# mv "$communedir/${code_commune}_adresse_point_sur_batiment.zip" "${file4}"
# $command3 "${file3}" "${file3/associatedStreet/addrstreet}"
# $command3 "${file4}" "${file4/associatedStreet/addrstreet}"