h3_try_coverash3
function
Applies to: Databricks SQL Databricks Runtime 16.3 and above
This function behaves the same as h3_coverash3, but returns NULL
instead of an error if the first argument is invalid. It returns an ARRAY
of BIGINT
values representing H3 cell IDs. These values correspond to the minimal set of hexagons or pentagons at the specified resolution that fully covers the input linear or areal geography.
h3_try_coverash3 ( geographyExpr, resolutionExpr )
Argumentsâ
geographyExpr
: A BINARY
or STRING
expression representing a linear (linestring or multilinestring) or areal (polygon or multipolygon) geography in WKB, WKT, or GeoJSON. The geography must have longitude and latitude coordinates in degrees that refer to the WGS84 coordinate reference system.resolutionExpr
: An INT
expression, with a value between 0
and 15
inclusive, specifying the resolution for the H3 cell IDs.An ARRAY
of BIGINT
values corresponding to the minimal set of hexagons or pentagons at the specified resolution that fully covers the input linear or areal geography.
The function returns NULL
if any one of the input expressions is NULL
. If the first input argument is of type BINARY
, the input value must be the WKB description of a polygon or a multipolygon. If the first input argument is of type STRING
, the input value must be either the WKT or the GeoJSON description of a linestring, polygon, multilinestring, or multipolygon. The dimension of the input linestring, polygon, multilinestring, or multipolygon can be 2D, 3DZ, 3DM, or 4D. The function returns NULL
if the first argument corresponds to an invalid WKB, WKT, or GeoJSON or does not represent a linestring, polygon, multilinestring, or multipolygon.
resolutionExpr
is smaller than 0
or larger than 15
, the function returns H3_INVALID_RESOLUTION_VALUE.SQL
> SELECT h3_try_coverash3('POLYGON((-122.4194 37.7749,-118.2437 34.0522,-74.0060 40.7128,-122.4194 37.7749))', 0)
[577164439745200127, 577199624117288959, 577234808489377791, 577762574070710271]
> SELECT h3_try_coverash3(unhex('0103000000010000000400000050fc1873d79a5ec0d0d556ec2fe342404182e2c7988f5dc0f46c567dae064140aaf1d24d628052c05e4bc8073d5b444050fc1873d79a5ec0d0d556ec2fe34240'), 0)
[577164439745200127, 577199624117288959, 577234808489377791, 577762574070710271]
SELECT h3_try_coverash3('{"type":"LineString","coordinates":[[-122.4194,37.7749],[-118.2437,34.0522],[-74.0060,40.7128]]}', 1)
[582248581512036351, 581698825698148351, 581707621791170559, 581716417884192767, 581641651093503999, 581650447186526207, 581672437419081727]
> SELECT h3_try_coverash3('{"type":"MultiPoint","coordinates":[]}', 2)
null
> SELECT h3_try_coverash3(unhex('020700000000'), 2)
null
> SELECT h3_try_coverash3('POLYGON((-122.4194 37.7749,-118.2437 34.0522,-74.0060 40.7128,-74.0060 40.7128))', 2)
null
> SELECT h3_try_coverash3('POLYGON((-122.4194 37.7749,-118.2437 34.0522,-74.0060 40.7128,-122.4194 37.7749))', 16)
[H3_INVALID_RESOLUTION_VALUE] H3 resolution 16 must be between 0 and 15, inclusive
h3_coverash3
functionh3_coverash3string
functionh3_polyfillash3
functionh3_polyfillash3string
functionh3_tessellateaswkb
functionh3_try_coverash3string
functionh3_try_polyfillash3
functionh3_try_tessellateaswkb
functionRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4