Skip to content

Commit 49cc14b

Browse files
committed
Doc supervised, set tile size to 256 for visual
Signed-off-by: Jason T. Brown <[email protected]>
1 parent 52983e3 commit 49cc14b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

pyrasterframes/src/main/python/docs/supervised-learning.pymd

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ catalog_df = pd.DataFrame([
3232
{b: uri_base.format(b) for b in cols}
3333
])
3434

35-
df = spark.read.raster(catalog_df, catalog_col_names=cols, tile_dimensions=(256, 256)) \
35+
tile_size = 256
36+
df = spark.read.raster(catalog_df, catalog_col_names=cols, tile_dimensions=(tile_size, tile_size)) \
3637
.repartition(100)
3738

3839
df = df.select(
@@ -193,10 +194,10 @@ scored = model.transform(df_mask.drop('label'))
193194
retiled = scored \
194195
.groupBy('extent', 'crs') \
195196
.agg(
196-
rf_assemble_tile('column_index', 'row_index', 'prediction', 128, 128).alias('prediction'),
197-
rf_assemble_tile('column_index', 'row_index', 'B04', 128, 128).alias('red'),
198-
rf_assemble_tile('column_index', 'row_index', 'B03', 128, 128).alias('grn'),
199-
rf_assemble_tile('column_index', 'row_index', 'B02', 128, 128).alias('blu')
197+
rf_assemble_tile('column_index', 'row_index', 'prediction', tile_size, tile_size).alias('prediction'),
198+
rf_assemble_tile('column_index', 'row_index', 'B04', tile_size, tile_size).alias('red'),
199+
rf_assemble_tile('column_index', 'row_index', 'B03', tile_size, tile_size).alias('grn'),
200+
rf_assemble_tile('column_index', 'row_index', 'B02', tile_size, tile_size).alias('blu')
200201
)
201202
retiled.printSchema()
202203
```

0 commit comments

Comments
 (0)