rasteret.ingest.normalize¶
Shared normalization layer: raw Arrow table to Collection.
normalize
¶
Shared normalisation layer: raw Arrow table -> Collection.
Every ingest driver calls :func:build_collection_from_table as its
final step to validate column contract, add partition columns, and
construct a :class:~rasteret.core.collection.Collection.
Functions¶
parse_epsg
¶
Extract an integer EPSG code from a CRS value.
Accepts int (returned as-is), "EPSG:32632"-style strings,
or None. Returns None when parsing fails.
Source code in src/rasteret/ingest/normalize.py
crs_code_from_epsg
¶
normalize_crs_code
¶
Normalize supported CRS inputs into an authority-code string.
Source code in src/rasteret/ingest/normalize.py
build_collection_from_table
¶
build_collection_from_table(
table: Table,
*,
name: str = "",
description: str = "",
data_source: str = "",
date_range: tuple[str, str] | None = None,
workspace_dir: str | Path | None = None,
partition_cols: Sequence[str] = ("year", "month"),
) -> Any
Normalise an Arrow table into a Collection.
Validates the Collection contract columns, adds bbox
and partition columns when missing, and optionally materialises
to Parquet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
table
|
Table
|
Arrow table with at least the required columns. |
required |
name
|
str
|
Human-readable collection name. |
''
|
description
|
str
|
Free-text description. |
''
|
data_source
|
str
|
Data source identifier (e.g. |
''
|
date_range
|
tuple[str, str] | None
|
|
None
|
workspace_dir
|
str | Path | None
|
If provided, persist the collection as partitioned Parquet here. |
None
|
partition_cols
|
Sequence[str]
|
Columns to partition by when writing Parquet. |
('year', 'month')
|
Returns:
| Type | Description |
|---|---|
Collection
|
|
Source code in src/rasteret/ingest/normalize.py
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | |