-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix overlap query again? (comstud)
- Loading branch information
Showing
2 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
-- Fix procedure for overlap disablement | ||
-- I guess ST_Overlaps() is false if fully contained? | ||
-- So, just check we have Poly/MPoly before doing ST_Area(). | ||
DROP PROCEDURE IF EXISTS fl_nest_filter_overlap; | ||
CREATE PROCEDURE fl_nest_filter_overlap (IN maximum_overlap double) | ||
BEGIN | ||
DROP TEMPORARY TABLE IF EXISTS overlapNest; | ||
CREATE TEMPORARY TABLE overlapNest AS ( | ||
SELECT b.nest_id | ||
FROM nests a, nests b | ||
WHERE a.active = 1 AND b.active = 1 AND | ||
a.m2 > b.m2 AND | ||
ST_Intersects(a.polygon, b.polygon) AND | ||
ST_GeometryType(ST_Intersection(a.polygon, b.polygon)) IN ('Polygon', 'MultiPolygon') AND | ||
(100 * ST_Area(ST_Intersection(a.polygon,b.polygon)) / ST_Area(b.polygon)) > maximum_overlap | ||
); | ||
UPDATE nests a, overlapNest b SET a.active=0, discarded = 'overlap' WHERE a.nest_id=b.nest_id; | ||
DROP TEMPORARY TABLE overlapNest; | ||
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package version | ||
|
||
const ( | ||
APP_VERSION = "0.99.7" | ||
APP_VERSION = "0.99.8" | ||
) |