Skip to content

Commit

Permalink
Fix Paris canton
Browse files Browse the repository at this point in the history
  • Loading branch information
tgrandje committed Oct 29, 2024
1 parent ef68adc commit ab3b8de
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cartiflette/pipeline/prepare_cog_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,16 +468,19 @@ def find_from_pattern(target):
# Hack to set PARIS, GUYANE and MARTINIQUE with the same key as IGN's
# dataset (if trully missing)
for dep, label in {
"75": "Paris", # missing for year <2024
# Paris missing for year <2024 / for year 2024, key is 99 in IGN
# datasets, NR in INSEE's
"75": "Paris",
"973": "Guyane",
"972": "Martinique",
}.items():
ix = cantons[cantons.DEP == dep].index
if cantons.loc[ix, "CAN"].isnull().all():
if dep == "75" or cantons.loc[ix, "CAN"].isnull().all():
cantons.loc[ix, "INSEE_CAN"] = "NR"
cantons.loc[ix, "CAN"] = (
cantons.loc[ix, "DEP"] + cantons.loc[ix, "INSEE_CAN"]
)
if cantons.loc[ix, "CAN"].isnull().all():
cantons.loc[ix, "LIBELLE_CANTON"] = label

cantons["SOURCE_METADATA"] = "Cartiflette d'après INSEE"
Expand Down

0 comments on commit ab3b8de

Please sign in to comment.