Skip to content

Commit

Permalink
Tried to deal with even more potentially invalid mask shapes
Browse files Browse the repository at this point in the history
  • Loading branch information
kueda committed Oct 19, 2023
1 parent 2e7bb3a commit a8c1a84
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions sources/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,16 @@ def initialize_masks_table(mask_table_name, source_table_name, buff=0.01):
ST_Multi(
ST_MakeValid(
ST_Buffer(
ST_Buffer(
ST_MakeValid(
ST_Union(geom)
),
{buff},
'join=mitre'
ST_MakeValid(
ST_Buffer(
ST_MakeValid(
ST_Union(
ST_MakeValid(geom)
)
),
{buff},
'join=mitre'
)
),
-{buff},
'join=mitre'
Expand All @@ -229,16 +233,22 @@ def update_masks_table(mask_table_name, source_table_name, buff=0.01):
ST_Multi(
(
SELECT
ST_Buffer(
ST_MakeValid(
ST_Buffer(
ST_MakeValid(
ST_Union(ST_MakeValid(s.geom))
ST_Buffer(
ST_MakeValid(
ST_Union(
ST_MakeValid(s.geom)
)
),
{buff},
'join=mitre'
)
),
{buff},
-{buff},
'join=mitre'
),
-{buff},
'join=mitre'
)
)
FROM {source_table_name} s
)
Expand Down

0 comments on commit a8c1a84

Please sign in to comment.