Skip to content

Commit

Permalink
Remove unnecessary buffer(0) hack
Browse files Browse the repository at this point in the history
The `buffer(0)` hack is a way to make sure a polygon is valid.
We don't need it anymore since we fix polygons at map import.
  • Loading branch information
thibault committed Jul 25, 2023
1 parent 5714c9a commit 3b7a887
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions envergo/moulinette/regulations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,9 @@ def to_json(self):
"zoom": self.zoom,
"polygons": [
{
"polygon": to_geojson(
entry.geometry.buffer(0).intersection(buffer)
)
"polygon": to_geojson(entry.geometry.intersection(buffer))
if self.truncate
else to_geojson(entry.geometry.buffer(0)),
else to_geojson(entry.geometry),
"color": entry.color,
"label": entry.label,
}
Expand Down

0 comments on commit 3b7a887

Please sign in to comment.