You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** Applies a mask using bit values in the `mask_tile`. Working from the right, extract the bit at `bitPosition` from the `maskTile`. In all locations where these are equal to the `valueToMask`, the returned tile is set to NoData, else the original `dataTile` cell value. */
/** Applies a mask using bit values in the `mask_tile`. Working from the right, extract the bit at `bitPosition` from the `maskTile`. In all locations where these are equal to the `valueToMask`, the returned tile is set to NoData, else the original `dataTile` cell value. */
/** Applies a mask from blacklisted bit values in the `mask_tile`. Working from the right, the bits from `start_bit` to `start_bit + num_bits` are @ref:[extracted](reference.md#rf_local_extract_bits) from cell values of the `mask_tile`. In all locations where these are in the `mask_values`, the returned tile is set to NoData; otherwise the original `tile` cell value is returned. */
/** Applies a mask from blacklisted bit values in the `mask_tile`. Working from the right, the bits from `start_bit` to `start_bit + num_bits` are @ref:[extracted](reference.md#rf_local_extract_bits) from cell values of the `mask_tile`. In all locations where these are in the `mask_values`, the returned tile is set to NoData; otherwise the original `tile` cell value is returned. */
Tile rf_make_ones_tile(Int tile_columns, Int tile_rows, [String cell_type_name])
168
168
```
169
169
170
-
171
170
Create a `tile` of shape `tile_columns` by `tile_rows` full of ones, with the optional cell type; default is float64. See @ref:[this discussion](nodata-handling.md#cell-types) on cell types for info on the `cell_type` argument. All arguments are literal values and not column expressions.
172
171
173
172
### rf_make_constant_tile
174
173
175
174
Tile rf_make_constant_tile(Numeric constant, Int tile_columns, Int tile_rows, [CellType cell_type])
176
175
Tile rf_make_constant_tile(Numeric constant, Int tile_columns, Int tile_rows, [String cell_type_name])
177
176
178
-
179
177
Create a `tile` of shape `tile_columns` by `tile_rows` full of `constant`, with the optional cell type; default is float64. See @ref:[this discussion](nodata-handling.md#cell-types) on cell types for info on the `cell_type` argument. All arguments are literal values and not column expressions.
180
178
181
179
182
180
### rf_rasterize
183
181
184
182
Tile rf_rasterize(Geometry geom, Geometry tile_bounds, Int value, Int tile_columns, Int tile_rows)
185
183
186
-
187
184
Convert a vector Geometry `geom` into a Tile representation. The `value` will be "burned-in" to the returned `tile` where the `geom` intersects the `tile_bounds`. Returned `tile` will have shape `tile_columns` by `tile_rows`. Values outside the `geom` will be assigned a NoData value. Returned `tile` has cell type `int32`, note that `value` is of type Int.
188
185
189
186
Parameters `tile_columns` and `tile_rows` are literals, not column expressions. The others are column expressions.
@@ -236,10 +233,35 @@ Generate a `tile` with the values from `data_tile`, with NoData in cells where t
Tile rf_mask_by_values(Tile data_tile, Tile mask_tile, list mask_values)
240
237
241
238
Generate a `tile` with the values from `data_tile`, with NoData in cells where the `mask_tile` is in the `mask_values` Array or list. `mask_values` can be a [`pyspark.sql.ArrayType`][Array] or a `list`.
242
239
240
+
### rf_mask_by_bit
241
+
242
+
Tile rf_mask_by_bits(Tile tile, Tile mask_tile, Int bit_position, Bool mask_value)
243
+
244
+
Applies a mask using bit values in the `mask_tile`. Working from the right, the bit at `bit_position` is @ref:[extracted](reference.md#rf_local_extract_bits) from cell values of the `mask_tile`. In all locations where these are equal to the `mask_value`, the returned tile is set to NoData; otherwise the original `tile` cell value is returned.
245
+
246
+
This is a single-bit version of @ref:[`rf_mask_by_bits`](reference.md#rf-mask-by-bits).
247
+
248
+
### rf_mask_by_bits
249
+
250
+
Tile rf_mask_by_bits(Tile tile, Tile mask_tile, Int start_bit, Int num_bits, Array mask_values)
251
+
Tile rf_mask_by_bits(Tile tile, Tile mask_tile, Int start_bit, Int num_bits, list mask_values)
252
+
253
+
Applies a mask from blacklisted bit values in the `mask_tile`. Working from the right, the bits from `start_bit` to `start_bit + num_bits` are @ref:[extracted](reference.md#rf_local_extract_bits) from cell values of the `mask_tile`. In all locations where these are in the `mask_values`, the returned tile is set to NoData; otherwise the original `tile` cell value is returned.
254
+
255
+
This function is not available in the SQL API. The below is equivalent:
256
+
257
+
```sql
258
+
SELECT rf_mask_by_values(
259
+
tile,
260
+
rf_extract_bits(mask_tile, start_bit, num_bits),
261
+
mask_values
262
+
),
263
+
```
264
+
243
265
### rf_inverse_mask
244
266
245
267
Tile rf_inverse_mask(Tile tile, Tile mask)
@@ -406,6 +428,15 @@ Returns a `tile` column containing the element-wise inequality of `tile1` and `r
406
428
407
429
Returns a `tile` column with cell values of 1 where the `tile` cell value is in the provided array or list. The `array` is a Spark SQL [Array][Array]. A python `list` of numeric values can also be passed.
408
430
431
+
### rf_local_extract_bits
432
+
433
+
Tile rf_local_extract_bits(Tile tile, Int start_bit, Int num_bits)
434
+
Tile rf_local_extract_bits(Tile tile, Int start_bit)
435
+
436
+
Extract value from specified bits of the cells' underlying binary data. Working from the right, the bits from `start_bit` to `start_bit + num_bits` are extracted from cell values of the `tile`. The `start_bit` is zero indexed. If `num_bits` is not provided, a single bit is extracted.
437
+
438
+
A common use case for this function is covered by @ref:[`rf_mask_by_bits`](reference.md#rf-mask-by-bits).
Copy file name to clipboardExpand all lines: docs/src/main/paradox/release-notes.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,10 @@
2
2
3
3
## 0.8.x
4
4
5
+
### 0.8.5
6
+
7
+
* Add `rf_mask_by_bit`, `rf_mask_by_bits` and `rf_local_extract_bits` to deal with bit packed quality masks. Updated the masking documentation to demonstrate the use of these functions.
0 commit comments