Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
database-lib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Global Dynamic Exposure
Libraries
database-lib
Merge requests
!24
Draft: Resolve "[Epic] Changes to database-lib for the 25.01 release"
Code
Änderungen prüfen
Branch auschecken
Herunterladen
Patches
Unformatierter Diff
Menüleiste ausklappen
Open
Draft: Resolve "[Epic] Changes to database-lib for the 25.01 release"
v25.01
into
main
Overview
0
Commits
9
Pipelines
14
Changes
1
Open
Draft: Resolve "[Epic] Changes to database-lib for the 25.01 release"
Danijel Schorlemmer
requested to merge
v25.01
into
main
8 months ago
Overview
0
Commits
9
Pipelines
14
Changes
1
Closes
#25
\approve
@laurens
@gislars
@chengzhi
@pdlmora
\fyi
@tara
0
0
Merge request reports
Viewing commit
e7f24be4
Show latest version
1 file
+
11
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
e7f24be4
Implement intersection check between tiles and geometry
· e7f24be4
Pablo de la Mora
authored
1 month ago
quadkeyfunctions/10_geom_to_quadkeys.sql
+
11
−
4
View file @ e7f24be4
Edit in single-file editor
Open in Web IDE
Show full file
@@ -34,6 +34,9 @@ DECLARE
_max_pixel_xy
RECORD
;
_min_tile_xy
RECORD
;
_max_tile_xy
RECORD
;
tile_x
INT
;
tile_y
INT
;
tile_geom
GEOMETRY
;
BEGIN
_bbox
=
ST_Envelope
(
geom
);
_min_lat
=
ST_YMin
(
_bbox
);
@@ -44,10 +47,14 @@ BEGIN
_max_pixel_xy
=
latlon_to_pixel_xy
(
_min_lat
,
_max_lon
,
level_of_detail
);
_min_tile_xy
=
pixel_xy_to_tile_xy
(
_min_pixel_xy
.
pixel_x
,
_min_pixel_xy
.
pixel_y
);
_max_tile_xy
=
pixel_xy_to_tile_xy
(
_max_pixel_xy
.
pixel_x
,
_max_pixel_xy
.
pixel_y
);
FOR
i
IN
_min_tile_xy
.
tile_x
..
_max_tile_xy
.
tile_x
LOOP
FOR
j
IN
_min_tile_xy
.
tile_y
..
_max_tile_xy
.
tile_y
LOOP
quadkey
:
=
tile_xy_to_quadkey
(
i
,
j
,
level_of_detail
);
RETURN
next
;
FOR
tile_x
IN
_min_tile_xy
.
tile_x
..
_max_tile_xy
.
tile_x
LOOP
FOR
tile_y
IN
_min_tile_xy
.
tile_y
..
_max_tile_xy
.
tile_y
LOOP
quadkey
:
=
tile_xy_to_quadkey
(
tile_x
,
tile_y
,
level_of_detail
);
tile_geom
:
=
quadkey_to_geom
(
quadkey
);
IF
tile_geom
&&
geom
THEN
RETURN
NEXT
;
END
IF
;
END
LOOP
;
END
LOOP
;
END
;
Loading