
Analytics Toolbox for BigQuery
quadkey
You can learn more about quadkeys and quandints in the Overview section of the documentation.
QUADINT_BBOX
Description
Returns an array with the boundary box of a given quadint. 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].
quadint
:INT64
quadint to get the bbox from.
Return type
ARRAY<FLOAT64>
Example
|
|
QUADINT_BOUNDARY
Description
Returns the boundary for a given quadint. We extract the boundary in the same way as when we calculate its QUADINT_BBOX, then enclose it in a GeoJSON and finally transform it into a geography.
quadint
:INT64
quadint to get the boundary geography from.
Return type
GEOGRAPHY
Example
|
|
QUADINT_CENTER
Description
Returns the center for a given quadint. The center is defined as the intersection point of the four immediate children quadint.
quadint
:INT64
quadint to get the center from.
Return type
GEOGRAPHY
Example
|
|
QUADINT_FROMGEOGPOINT
Description
Returns the quadint of a given point at a given level of detail.
point
:GEOGRAPHY
point to get the quadint from.resolution
:INT64
level of detail or zoom.
Return type
INT64
Example
|
|
QUADINT_FROMLONGLAT
Description
Returns the quadint representation for a given level of detail and geographic coordinates.
longitude
:FLOAT64
horizontal coordinate of the map.latitude
:FLOAT64
vertical coordinate of the map.resolution
:INT64
level of detail or zoom.
Return type
INT64
Example
|
|
QUADINT_FROMLONGLAT_ZOOMRANGE
Description
Returns the quadint index for the given point for each zoom level requested, at the specified resolution (computed as the current zoom level + the value of resolution
). The output is an array of structs with the following elements: quadint id
, zoom level (z
), and horizontal (x
) and vertical (y
) position of the tile. These quadint indexes can be used for grouping and generating aggregations of points throughout the zoom range requested. Notice the use of an additional variable resolution
for adjusting the desired level of granularity.
longitude
:FLOAT64
horizontal coordinate of the map.latitude
:FLOAT64
vertical coordinate of the map.zoom_min
:INT64
minimum zoom to get the quadints from.zoom_max
:INT64
maximum zoom to get the quadints from.zoom_step
:INT64
used for skipping levels of zoom.resolution
:INT64
resolution added to the current zoom to extract the quadints.
Return type
ARRAY<STRUCT<INT64, INT64, INT64>>
Example
|
|
QUADINT_FROMQUADKEY
Description
Returns the quadint equivalent to the input quadkey.
quadkey
:STRING
quadkey to be converted to quadint.
Return type
INT64
Example
|
|
QUADINT_FROMZXY
Description
Returns a quadint from z
, x
, y
coordinates.
z
:INT64
zoom level.x
:INT64
horizontal position of a tile.y
:INT64
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
INT64
Example
|
|
QUADINT_KRING
Description
Returns all cell indexes in a filled square k-ring centered at the origin in no particular order.
origin
:INT64
quadint index of the origin.size
:INT64
size of the ring (distance from the origin).
Return type
ARRAY<INT64>
Example
|
|
QUADINT_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
:INT64
quadint index of the origin.size
:INT64
size of the ring (distance from the origin).
Return type
ARRAY<STRUCT<index INT64, distance INT64>>
Example
|
|
QUADINT_POLYFILL
Description
Returns an array of quadints that intersect with the given geography at a given level of detail.
geography
:GEOGRAPHY
geography to extract the quadints from.resolution
:INT64
level of detail or zoom.
Return type
ARRAY<INT64>
Example
|
|
QUADINT_RESOLUTION
Description
Returns the resolution of the input quadint.
quadint
:INT64
quadint from which to get resolution.
Return type
INT64
Example
|
|
QUADINT_SIBLING
Description
Returns the quadint directly next to the given quadint at the same zoom level. The direction must be sent as argument and currently only horizontal/vertical movements are allowed.
quadint
:INT64
quadint to get the sibling from.direction
:STRING
‘right’|‘left’|‘up’|‘down’
direction to move in to extract the next sibling.
Return type
INT64
Example
|
|
QUADINT_TOCHILDREN
Description
Returns an array with the children quadints of a given quadint for a specific resolution. A children quadint is a quadint of higher level of detail that is contained by the current quadint. Each quadint has four children by definition.
quadint
:INT64
quadint to get the children from.resolution
:INT64
resolution of the desired children.
Return type
ARRAY<INT64>
Example
|
|
QUADINT_TOGEOGPOINT
Description
Returns the centroid for a given quadint.
quadint
:INT64
quadint to get the centroid geography from.
Return type
GEOGRAPHY
Example
|
|
QUADINT_TOPARENT
Description
Returns the parent quadint of a given quadint for a specific resolution. A parent quadint is the smaller resolution containing quadint.
quadint
:INT64
quadint to get the parent from.resolution
:INT64
resolution of the desired parent.
Return type
INT64
Example
|
|
QUADINT_TOQUADKEY
Description
Returns the quadkey equivalent to the input quadint.
quadint
:INT64
quadint to be converted to quadkey.
Return type
STRING
Example
|
|
QUADINT_TOZXY
Description
Returns the zoom level z
and coordinates x
, y
for a given quadint.
quadint
:INT64
quadint we want to extract tile information from.
Return type
STRUCT<INT64, INT64, INT64>
Example
|
|

This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement No 960401.