-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GeoPackage spec 1.4 updates (version number, rtree udpates)
- Loading branch information
Showing
7 changed files
with
187 additions
and
10 deletions.
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
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
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
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
11 changes: 11 additions & 0 deletions
11
src/main/resources/sql/extension/rtree/rtree_trigger_update5
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,11 @@ | ||
CREATE TRIGGER "rtree_<t>_<c>_update5" AFTER UPDATE ON "<t>" | ||
WHEN OLD."<i>" != NEW."<i>" AND | ||
(NEW."<c>" NOTNULL AND NOT ST_IsEmpty(NEW."<c>")) | ||
BEGIN | ||
DELETE FROM "rtree_<t>_<c>" WHERE id = OLD."<i>"; | ||
INSERT OR REPLACE INTO "rtree_<t>_<c>" VALUES ( | ||
NEW."<i>", | ||
ST_MinX(NEW."<c>"), ST_MaxX(NEW."<c>"), | ||
ST_MinY(NEW."<c>"), ST_MaxY(NEW."<c>") | ||
); | ||
END; |
12 changes: 12 additions & 0 deletions
12
src/main/resources/sql/extension/rtree/rtree_trigger_update6
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,12 @@ | ||
CREATE TRIGGER "rtree_<t>_<c>_update6" AFTER UPDATE OF "<c>" ON "<t>" | ||
WHEN OLD."<i>" = NEW."<i>" AND | ||
(NEW."<c>" NOTNULL AND NOT ST_IsEmpty(NEW."<c>")) AND | ||
(OLD."<c>" NOTNULL AND NOT ST_IsEmpty(OLD."<c>")) | ||
BEGIN | ||
UPDATE "rtree_<t>_<c>" SET | ||
minx = ST_MinX(NEW."<c>"), | ||
maxx = ST_MaxX(NEW."<c>"), | ||
miny = ST_MinY(NEW."<c>"), | ||
maxy = ST_MaxY(NEW."<c>") | ||
WHERE id = NEW."<i>"; | ||
END; |
11 changes: 11 additions & 0 deletions
11
src/main/resources/sql/extension/rtree/rtree_trigger_update7
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,11 @@ | ||
CREATE TRIGGER "rtree_<t>_<c>_update7" AFTER UPDATE OF "<c>" ON "<t>" | ||
WHEN OLD."<i>" = NEW."<i>" AND | ||
(NEW."<c>" NOTNULL AND NOT ST_IsEmpty(NEW."<c>")) AND | ||
(OLD."<c>" ISNULL OR ST_IsEmpty(OLD."<c>")) | ||
BEGIN | ||
INSERT INTO "rtree_<t>_<c>" VALUES ( | ||
NEW."<i>", | ||
ST_MinX(NEW."<c>"), ST_MaxX(NEW."<c>"), | ||
ST_MinY(NEW."<c>"), ST_MaxY(NEW."<c>") | ||
); | ||
END; |