Skip to content

Commit

Permalink
Dev (#302)
Browse files Browse the repository at this point in the history
* Update Fantoir T2 2022
* Ajout dans le dico type_voie (#285)
* typo sur le nom de fichier des communes pour batch nocturne
* Caractères parasites dans les noms BAN (#301)
  • Loading branch information
vdct committed Nov 1, 2022
1 parent 72f7460 commit 35f320a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
7 changes: 7 additions & 0 deletions bano/bin.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ def main():
)
subparser.set_defaults(func=ban.update_bis_table)

subparser = subparsers.add_parser(
"remove_chars_in_ban",
help="ménage de caractères parasites dans les noms de voie BAN",
description="ménage de caractères parasites dans les noms de voie BAN",
)
subparser.set_defaults(func=ban.remove_chars_in_ban)

subparser = subparsers.add_parser(
"pre_process_suffixe",
help="Détermine les zones où les noms dans le Cadastre sont suffixés",
Expand Down
1 change: 1 addition & 0 deletions bano/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def normalize(s):
s = s.replace('’',' ') # separateur espace
s = s.replace('/',' ') # separateur espace
s = s.replace(':',' ') # separateur deux points
s = s.replace('"','') # suppression des guillemets
s = ' '.join(s.split()) # separateur : 1 espace

for l in iter(constants.LETTRE_A_LETTRE):
Expand Down
5 changes: 4 additions & 1 deletion bano/sources/ban.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,7 @@ def get_destination(departement):
return cwd / f'adresses-{departement}.csv.gz'

def update_bis_table(**kwargs):
dbh.process_sql(db.bano_cache,'update_table_rep_b_as_bis',dict())
dbh.process_sql(db.bano_cache,'update_table_rep_b_as_bis',dict())

def remove_chars_in_ban(**kwargs):
dbh.process_sql(db.bano_cache,'remove_chars_in_ban',dict())
4 changes: 4 additions & 0 deletions bano/sql/remove_chars_in_ban.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
UPDATE ban_odbl
SET nom_voie = TRANSLATE(nom_voie,'"','')
WHERE nom_voie LIKE '%"%';
COMMIT;
1 change: 1 addition & 0 deletions cron_bano.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ cat deplist.txt | parallel -j 4 export LANG=fr_FR.UTF-8\; bano download_ban {1}
cat deplist.txt | parallel -j 4 export LANG=fr_FR.UTF-8\; bano download_cadastre lieux_dits {1}
bano update_code_cadastre
bano update_bis_table
bano remove_chars_in_ban
./copy_table_from_osm_to_cadastre.sh rep_b_as_bis


Expand Down

0 comments on commit 35f320a

Please sign in to comment.