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
The @ref:[`rf_agg_local_stats`](reference.md#rf-agg-local-stats) function computes the element-wise local aggregate statistical summary as shown below. The DataFrame used in the previous two code blocks has unequal _tile_ dimensions, so a different DataFrame is used in this code block to avoid a runtime error.
94
93
95
94
```python, agg_local_stats
96
-
rf = spark.sql("""
97
-
SELECT 1 as id, rf_make_ones_tile(5, 5, 'float32') as tile
98
-
UNION
99
-
SELECT 2 as id, rf_make_constant_tile(3, 5, 5, 'float32') as tile
100
-
UNION
101
-
SELECT 3 as id, rf_make_constant_tile(5, 5, 5, 'float32') as tile
Copy file name to clipboardExpand all lines: pyrasterframes/src/main/python/docs/local-algebra.pymd
+7-5Lines changed: 7 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -34,13 +34,15 @@ We will apply the @ref:[catalog pattern](raster-catalogs.md) for defining the da
34
34
This form of `(x - y) / (x + y)` is common in remote sensing and is called a normalized difference. It is used with other band pairs to highlight water, snow, and other phenomena.
@@ -126,15 +126,17 @@ Now that we have prepared our catalog, we simply pass the DataFrame or CSV strin
126
126
```python, read_catalog
127
127
rf = spark.read.raster(
128
128
catalog=equator,
129
-
catalog_col_names=['red', 'nir'],
129
+
catalog_col_names=['red', 'nir']
130
130
)
131
131
rf.printSchema()
132
132
```
133
133
134
134
Observe the schema of the resulting DataFrame has a projected raster struct for each column passed in `catalog_col_names`. For reference, the URI is now in a column appended with `_path`. Taking a quick look at the representation of the data, we see again each row contains an arbitrary portion of the entire scene coverage. We also see that for two-D catalogs, each row contains the same spatial extent for all tiles in that row.
@@ -168,9 +170,10 @@ When reading a multiband raster or a _catalog_ describing multiband rasters, you
168
170
For example, we can read a four-band (red, green, blue, and near-infrared) image as follows. The individual rows of the resulting DataFrame still represent distinct spatial extents, with a projected raster column for each band specified by `band_indexes`.
0 commit comments