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
normalize_raster_crs_sidecars
¶
normalize_raster_crs_sidecars(
table: Table,
*,
required_columns: Sequence[str] | None = None,
) -> Table
Normalize row-level raster CRS sidecars from common source fields.
Priority per row:
1. proj:code
2. proj:epsg
3. crs
4. proj:wkt2
5. proj:projjson
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
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 | |