Skip to content

Commit

Permalink
Update datasource in analyser_merge_heritage_FR_merimee.py #2074
Browse files Browse the repository at this point in the history
  • Loading branch information
frodrigo committed Nov 19, 2023
1 parent 3047421 commit 657fdc8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions analysers/analyser_merge_heritage_FR_merimee.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ def parseDPRO(dpro):
attribution="Ministère de la Culture",
url="https://data.culture.gouv.fr/explore/dataset/liste-des-immeubles-proteges-au-titre-des-monuments-historiques",
filter=lambda s: reduce(lambda a, v: a.replace(v, ''), SKIP, (u'' + s).encode('utf-8').replace(b'l\u92', b"l'").replace(b'\x85)', b"...)").decode('utf-8', 'ignore')))),
Load_XY("p_coordonnees", "p_coordonnees",
Load_XY("coordonnees_au_format_WGS84", "coordonnees_au_format_WGS84",
xFunction = lambda x: x and x.split(',')[1],
yFunction = lambda y: y and y.split(',')[0],
select = {"Date de protection": True}),
select = {"Date_et_typologie_de_la_protection": True}),
Conflate(
select = Select(
types = ["nodes", "ways", "relations"],
Expand All @@ -107,8 +107,8 @@ def parseDPRO(dpro):
static1 = {"heritage:operator": "mhs"},
static2 = {"source:heritage": self.source},
mapping1 = {
"ref:mhs": "Référence",
"mhs:inscription_date": lambda res: parseDPRO(res["Date de protection"]),
"heritage": lambda res: 2 if res["Précision protection"] and "classement par arrêté" in res["Précision protection"] else 3 if res["Précision protection"] and "inscription par arrêté" in res["Précision protection"] else None},
mapping2 = {"name": lambda res: res["Appellation courante"] if res["Appellation courante"] not in BLACK_WORDS else None},
text = lambda tags, fields: T_("Historical monument: {0}", ", ".join(filter(lambda x: x, [fields["Date de Protection"], fields["Adresse"], fields["Commune"]]))) )))
"ref:mhs": "Reference",
"mhs:inscription_date": lambda res: parseDPRO(res["Date_et_typologie_de_la_protection"]),
"heritage": lambda res: 2 if res["Precision_de_la_protection"] and "classement par arrêté" in res["Precision_de_la_protection"] else 3 if res["Precision_de_la_protection"] and "inscription par arrêté" in res["Precision_de_la_protection"] else None},
mapping2 = {"name": lambda res: res["Titre_editorial_de_la_notice"] if res["Titre_editorial_de_la_notice"] not in BLACK_WORDS else None},
text = lambda tags, fields: T_("Historical monument: {0}", ", ".join(filter(lambda x: x and x != "None", [fields["Date_et_typologie_de_la_protection"], fields["Adresse_forme_index"], fields["Commune_forme_index"]]))) )))

0 comments on commit 657fdc8

Please sign in to comment.