Create Chips from Embeddings¶
geoembed.chipping.from_embeddings
¶
Create a chip metadata table with spatial geometry from an embeddings table.
The embeddings pipeline already computes chip_id, parent_id, parent_path, col_off, row_off, minx, miny, maxx, maxy for every chip. This module creates a proper spatial table (with geometry_wkb and native Databricks geometry columns) from that information — no need to run the chipping pipeline separately.
create_chip_table_from_embeddings(spark, embeddings_table, output_table, metadata_table=None, srid=None)
¶
Create a chip metadata table with spatial geometry from an embeddings table.
The embeddings table (produced by EmbeddingsPipeline) already contains spatial bounds per chip. This function creates a proper geometry table for spatial queries.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spark
|
Any
|
Active SparkSession. |
required |
embeddings_table
|
str
|
Source embeddings table (three-part UC name). |
required |
output_table
|
str
|
Destination chip metadata table (three-part UC name). |
required |
metadata_table
|
str | None
|
Source imagery metadata table (used to derive SRID if not provided). |
None
|
srid
|
int | None
|
Spatial Reference ID. If None, derived from metadata_table's epsg column. Defaults to 27700 (BNG) if neither is provided. |
None
|