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

Dev #302

Merged
merged 3 commits into from
Nov 1, 2022
Merged

Dev #302

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
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