
Analytics Toolbox for Redshift
quadbin
You can learn more about quadbins in the Overview section of the documentation.
QUADBIN_BBOX
Description
Returns an array with the boundary box of a given quadbin. This boundary box contains the minimum and maximum longitude and latitude. The output format is [West-South, East-North] or [min long, min lat, max long, max lat].
quadbin
:BIGINT
quadbin to get the boundary box from.
Return type
SUPER
Example
|
|
QUADBIN_BOUNDARY
Description
Returns the boundary for a given quadbin. We extract the boundary in the same way as when we calculate its QUADBIN_BBOX, then enclose it in a GeoJSON and finally transform it into a geography.
quadbin
:BIGINT
quadbin to get the boundary geography from.
Return type
VARCHAR
Example
|
|
QUADBIN_CENTER
Description
Returns the center for a given quadbin. The center is defined as the intersection point of the four immediate children quadbin.
quadbin
:BIGINT
quadbin to get the center from.
Return type
GEOMETRY
Example
|
|
QUADBIN_FROMGEOGPOINT
Description
Returns the quadbin of a given point at a given level of detail.
point
:GEOMETRY
point to get the quadbin from.resolution
:INT
level of detail or zoom.
Return type
BIGINT
Example
|
|
QUADBIN_FROMLONGLAT
Description
Returns the quadbin representation for a given level of detail and geographic coordinates.
longitude
:FLOAT8
horizontal coordinate of the map.latitude
:FLOAT8
vertical coordinate of the map.resolution
:INT
level of detail or zoom.
Return type
BIGINT
Example
|
|
QUADBIN_FROMZXY
Description
Returns a quadbin from z
, x
, y
coordinates.
z
:BIGINT
zoom level.x
:BIGINT
horizontal position of a tile.y
:BIGINT
vertical position of a tile.
Constraints
Tile coordinates x
and y
depend on the zoom level z
. For both coordinates, the minimum value is 0, and the maximum value is two to the power of z
, minus one (2^z - 1
).
Return type
BIGINT
Example
|
|
QUADBIN_ISVALID
Description
Returns true
when the given index is valid, false
otherwise.
quadbin
:BIGINT
quadbin index.
Return type
BOOLEAN
Examples
|
|
|
|
QUADBIN_KRING
Description
Returns all cell indexes in a filled square k-ring centered at the origin in no particular order.
origin
:BIGINT
quadbin index of the origin.size
:INT
size of the ring (distance from the origin).
Return type
SUPER
Example
|
|
QUADBIN_KRING_DISTANCES
Description
Returns all cell indexes and their distances in a filled square k-ring centered at the origin in no particular order.
origin
:BIGINT
quadbin index of the origin.size
:INT
size of the ring (distance from the origin).
Return type
SUPER
Example
|
|
QUADBIN_POLYFILL
Description
Returns an array of quadbins that intersect with the given geography at a given level of detail.
geography
:GEOMETRY
geography to extract the quadbins from.resolution
:INT
level of detail or zoom.
Return type
SUPER
Example
|
|
QUADBIN_RESOLUTION
Description
Returns the resolution of the input quadbin.
quadbin
:INT64
quadbin from which to get resolution.
Return type
BIGINT
Example
|
|
QUADBIN_SIBLING
Description
Returns the quadbin directly next to the given quadbin at the same zoom level. The direction must be included as an argument and currently only horizontal/vertical movements are allowed.
quadbin
:BIGINT
quadbin to get the sibling from.direction
:VARCHAR
‘right’|‘left’|‘up’|‘down’
direction to move in to extract the next sibling.
Return type
BIGINT
Example
|
|
QUADBIN_TOCHILDREN
Description
Returns an array with the children quadbins of a given quadbin for a specific resolution. A children quadbin is a quadbin of higher level of detail that is contained within the current quadbin. Each quadbin has four children by definition.
quadbin
:BIGINT
quadbin to get the children from.resolution
:INT
resolution of the desired children.
Return type
ARRAY
Example
|
|
QUADBIN_TOPARENT
Description
Returns the parent quadbin of a given quadbin for a specific resolution. A parent quadbin is the smaller resolution containing quadbin.
quadbin
:BIGINT
quadbin to get the parent from.resolution
:INT
resolution of the desired parent.
Return type
BIGINT
Example
|
|
QUADBIN_TOZXY
Description
Returns the zoom level z
and coordinates x
, y
for a given quadbin.
quadbin
:BIGINT
quadbin we want to extract tile information from.
Return type
SUPER
Example
|
|