Skip to content

Commit

Permalink
Merge pull request #294 from MTES-MCT/zhp_distance
Browse files Browse the repository at this point in the history
Modifie la distance de prise en compte des ZH potentielles
  • Loading branch information
thibault authored Apr 2, 2024
2 parents a3af7c0 + 928770f commit 5584156
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 27 deletions.
8 changes: 4 additions & 4 deletions envergo/moulinette/regulations/loisurleau.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def get_result_data(self):
wetland_status = "inside"
elif self.catalog["wetlands_within_100m"]:
wetland_status = "close_to"
elif self.catalog["potential_wetlands_within_0m"]:
elif self.catalog["potential_wetlands_within_10m"]:
wetland_status = "inside_potential"
else:
wetland_status = "outside"
Expand Down Expand Up @@ -94,16 +94,16 @@ def get_map(self):

elif (
self.catalog["wetlands_within_100m"]
and not self.catalog["potential_wetlands_within_0m"]
and not self.catalog["potential_wetlands_within_10m"]
):
caption = "Le projet se situe à proximité d'une zone humide référencée."

elif (
self.catalog["wetlands_within_100m"]
and self.catalog["potential_wetlands_within_0m"]
and self.catalog["potential_wetlands_within_10m"]
):
caption = "Le projet se situe à proximité d'une zone humide référencée et dans une zone humide potentielle."
elif self.catalog["potential_wetlands_within_0m"] and potential_qs:
elif self.catalog["potential_wetlands_within_10m"] and potential_qs:
caption = "Le projet se situe dans une zone humide potentielle."
else:
caption = "Le projet ne se situe pas dans une zone humide référencée."
Expand Down
8 changes: 4 additions & 4 deletions envergo/moulinette/regulations/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ def get_catalog_data(self):
]
data["wetlands_within_100m"] = bool(data["wetlands_100"])

if "potential_wetlands_0" not in self.catalog:
data["potential_wetlands_0"] = [
if "potential_wetlands_10" not in self.catalog:
data["potential_wetlands_10"] = [
zone
for zone in self.catalog["potential_wetlands"]
if zone.distance <= D(m=0)
if zone.distance <= D(m=10)
]
data["potential_wetlands_within_0m"] = bool(data["potential_wetlands_0"])
data["potential_wetlands_within_10m"] = bool(data["potential_wetlands_10"])

if "forbidden_wetlands_25" not in self.catalog:
data["forbidden_wetlands_25"] = [
Expand Down
8 changes: 4 additions & 4 deletions envergo/moulinette/regulations/natura2000.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def get_result_data(self):
wetland_status = "inside"
elif self.catalog["wetlands_within_100m"]:
wetland_status = "close_to"
elif self.catalog["potential_wetlands_within_0m"]:
elif self.catalog["potential_wetlands_within_10m"]:
wetland_status = "inside_potential"
else:
wetland_status = "outside"
Expand Down Expand Up @@ -93,16 +93,16 @@ def get_map(self):

elif (
self.catalog["wetlands_within_100m"]
and not self.catalog["potential_wetlands_within_0m"]
and not self.catalog["potential_wetlands_within_10m"]
):
caption = "Le projet se situe à proximité d'une zone humide référencée."

elif (
self.catalog["wetlands_within_100m"]
and self.catalog["potential_wetlands_within_0m"]
and self.catalog["potential_wetlands_within_10m"]
):
caption = "Le projet se situe à proximité d'une zone humide référencée et dans une zone humide potentielle."
elif self.catalog["potential_wetlands_within_0m"] and potential_qs:
elif self.catalog["potential_wetlands_within_10m"] and potential_qs:
caption = "Le projet se situe dans une zone humide potentielle."
else:
caption = "Le projet ne se situe pas dans une zone humide référencée."
Expand Down
24 changes: 12 additions & 12 deletions envergo/moulinette/regulations/sage.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def get_result_data(self):
wetland_status = "inside"
elif self.catalog["wetlands_within_100m"]:
wetland_status = "close_to"
elif self.catalog["potential_wetlands_within_0m"]:
elif self.catalog["potential_wetlands_within_10m"]:
wetland_status = "inside_potential"
else:
wetland_status = "outside"
Expand Down Expand Up @@ -159,16 +159,16 @@ def get_map(self):

elif (
self.catalog["wetlands_within_100m"]
and not self.catalog["potential_wetlands_within_0m"]
and not self.catalog["potential_wetlands_within_10m"]
):
caption = "Le projet se situe à proximité d'une zone humide référencée."

elif (
self.catalog["wetlands_within_100m"]
and self.catalog["potential_wetlands_within_0m"]
and self.catalog["potential_wetlands_within_10m"]
):
caption = "Le projet se situe à proximité d'une zone humide référencée et dans une zone humide potentielle."
elif self.catalog["potential_wetlands_within_0m"] and potential_qs:
elif self.catalog["potential_wetlands_within_10m"] and potential_qs:
caption = "Le projet se situe dans une zone humide potentielle."
else:
caption = "Le projet ne se situe pas dans une zone humide référencée."
Expand Down Expand Up @@ -257,7 +257,7 @@ def get_result_data(self):
or self.catalog["forbidden_wetlands_within_100m"]
):
wetland_status = "close_to"
elif self.catalog["potential_wetlands_within_0m"]:
elif self.catalog["potential_wetlands_within_10m"]:
wetland_status = "potential"
else:
wetland_status = "outside"
Expand Down Expand Up @@ -312,15 +312,15 @@ def get_map(self):
elif (
self.catalog["wetlands_within_100m"]
or self.catalog["forbidden_wetlands_within_100m"]
) and not self.catalog["potential_wetlands_within_0m"]:
) and not self.catalog["potential_wetlands_within_10m"]:
caption = "Le projet se situe à proximité d'une zone humide référencée."

elif (
self.catalog["wetlands_within_100m"]
or self.catalog["forbidden_wetlands_within_100m"]
) and self.catalog["potential_wetlands_within_0m"]:
) and self.catalog["potential_wetlands_within_10m"]:
caption = "Le projet se situe à proximité d'une zone humide référencée et dans une zone humide potentielle."
elif self.catalog["potential_wetlands_within_0m"] and potential_qs:
elif self.catalog["potential_wetlands_within_10m"] and potential_qs:
caption = "Le projet se situe dans une zone humide potentielle."
else:
caption = "Le projet ne se situe pas dans une zone humide référencée."
Expand Down Expand Up @@ -501,7 +501,7 @@ def get_result_data(self):
or self.catalog["forbidden_wetlands_within_100m"]
):
wetland_status = "close_to"
elif self.catalog["potential_wetlands_within_0m"]:
elif self.catalog["potential_wetlands_within_10m"]:
wetland_status = "potential"
else:
wetland_status = "outside"
Expand Down Expand Up @@ -546,15 +546,15 @@ def get_map(self):
elif (
self.catalog["wetlands_within_100m"]
or self.catalog["forbidden_wetlands_within_100m"]
) and not self.catalog["potential_wetlands_within_0m"]:
) and not self.catalog["potential_wetlands_within_10m"]:
caption = "Le projet se situe à proximité d'une zone humide référencée."

elif (
self.catalog["wetlands_within_100m"]
or self.catalog["forbidden_wetlands_within_100m"]
) and self.catalog["potential_wetlands_within_0m"]:
) and self.catalog["potential_wetlands_within_10m"]:
caption = "Le projet se situe à proximité d'une zone humide référencée et dans une zone humide potentielle."
elif self.catalog["potential_wetlands_within_0m"] and potential_qs:
elif self.catalog["potential_wetlands_within_10m"] and potential_qs:
caption = "Le projet se situe dans une zone humide potentielle."
else:
caption = "Le projet ne se situe pas dans une zone humide référencée."
Expand Down
4 changes: 2 additions & 2 deletions envergo/moulinette/tests/test_loisurleau.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def test_3310_medium_footprint_inside_potential_wetlands(moulinette_data):
moulinette = Moulinette(moulinette_data, moulinette_data)
moulinette.catalog["wetlands_within_25m"] = False
moulinette.catalog["wetlands_within_100m"] = False
moulinette.catalog["potential_wetlands_within_0m"] = True
moulinette.catalog["potential_wetlands_within_10m"] = True
moulinette.evaluate()
assert moulinette.loi_sur_leau.zone_humide.result == "non_soumis"

Expand Down Expand Up @@ -147,7 +147,7 @@ def test_3310_large_footprint_inside_potential_wetland(moulinette_data):
moulinette = Moulinette(moulinette_data, moulinette_data)
moulinette.catalog["wetlands_within_25m"] = False
moulinette.catalog["wetlands_within_100m"] = False
moulinette.catalog["potential_wetlands_within_0m"] = True
moulinette.catalog["potential_wetlands_within_10m"] = True
moulinette.evaluate()
assert moulinette.loi_sur_leau.zone_humide.result == "action_requise"

Expand Down
2 changes: 1 addition & 1 deletion envergo/moulinette/tests/test_natura2000.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def test_zh_large_footprint_inside_potential_wetland(moulinette_data):
moulinette = Moulinette(moulinette_data, moulinette_data)
moulinette.catalog["wetlands_within_25m"] = False
moulinette.catalog["wetlands_within_100m"] = False
moulinette.catalog["potential_wetlands_within_0m"] = True
moulinette.catalog["potential_wetlands_within_10m"] = True
moulinette.evaluate()
assert moulinette.natura2000.zone_humide.result == "action_requise"

Expand Down

0 comments on commit 5584156

Please sign in to comment.