tf_geo_rasterize
Aggregate point data into x/y bins of a given size in meters to form a dense spatial grid, with taking the maximum z value across all points in each bin as the output value for the bin. The aggregate performed to compute the value for each bin is specified by agg_type
, with allowed aggregate types of AVG
, COUNT
, SUM
, MIN
, and MAX
. If neighborhood_fill_radius
is set greater than 0, a blur pass/kernel will be computed on top of the results according to the optionally-specified fill_agg_type
, with allowed types of GAUSS_AVG, BOX_AVG
, COUNT
, SUM
, MIN
, and MAX
(if not specified, defaults to GAUSS_AVG
, or a Gaussian-average kernel). if fill_only_nulls
is set to true, only null bins from the first aggregate step will have final output values computed from the blur pass, otherwise if false all values will be affected by the blur pass.
Note that the arguments to bound the spatial output grid (x_min, x_max, y_min, y_max) are optional, however either all or none of these arguments must be supplied. If the arguments are not supplied, the bounds of the spatial output grid will be bounded by the x/y range of the input query, and if SQL filters are applied on the output of the tf_geo_rasterize
table function, these filters will also constrain the output range.
Input Arguments
Parameter | Description | Data Types |
---|---|---|
| X-coordinate column or expression | Column<FLOAT | DOUBLE> |
| Y-coordinate column or expression | Column<FLOAT | DOUBLE> |
| Z-coordinate column or expression. The output bin is computed as the maximum z-value for all points falling in each bin. | Column<FLOAT | DOUBLE> |
| The aggregate to be performed to compute the output z-column. Should be one of | TEXT ENCODING NONE |
| The aggregate to be performed when computing the blur pass on the output bins. Should be one of | TEXT ENCODING NONE |
| The width and height of each x/y bin in meters. If | DOUBLE |
| If true, specifies that the input x/y coordinates are in lon/lat degrees. The function will then compute a mapping of degrees to meters based on the center coordinate between x_min/x_max and y_min/y_max. | BOOLEAN |
| The radius in bins to compute the box blur/filter over, such that each output bin will be the average value of all bins within | DOUBLE |
| Specifies that the box blur should only be used to provide output values for null output bins (i.e. bins that contained no data points or had only data points with null Z-values). | BOOLEAN |
| Min x-coordinate value (in input units) for the spatial output grid. | DOUBLE |
| Max x-coordinate value (in input units) for the spatial output grid. | DOUBLE |
| Min y-coordinate value (in input units) for the spatial output grid. | DOUBLE |
| Max y-coordinate value (in input units) for the spatial output grid. | DOUBLE |
Output Columns
Name | Description | Data Types |
---|---|---|
| The x-coordinates for the centroids of the output spatial bins. | Column<FLOAT | DOUBLE> (same as input x-coordinate column/expression) |
| The y-coordinates for the centroids of the output spatial bins. | Column<FLOAT | DOUBLE> (same as input y-coordinate column/expression) |
| The maximum z-coordinate of all input data assigned to a given spatial bin. | Column<FLOAT | DOUBLE> (same as input z-coordinate column/expression) |
Example