Mosaics and maps
egms_client.mosaic ¶
Ortho L3 tiles pasted onto one grid. Needs the raster extra.
The tiles sit on a common 100 m grid in EPSG:3035, so a mosaic is a copy of each tile into its place, with no resampling.
Some tiles declare their CRS as IGNF:ETRS89LAEA instead of
EPSG:3035: the same projection under the French IGN's name. In the
2020-2025 release that is E43N26, E44N26, E45N26 and E46N26 (in 2020-2024,
E42N26 and E43N26). Comparing CRS by name rejects them; :func:is_laea
compares the parameters.
Mosaic
dataclass
¶
A float32 array (NaN where there is no data) and its upper-left corner.
is_laea ¶
is_laea(crs: Any) -> bool
True if a rasterio CRS is LAEA Europe (EPSG:3035) by its parameters.
mosaic ¶
mosaic(tiffs: Iterable[Path], *, minx: float, miny: float, maxx: float, maxy: float) -> Mosaic
Paste the tiles of one component over a rectangle in EPSG:3035 metres.
The rectangle widens to the 100 m grid. Pixels no tile covers, and the
tiles' own nodata, are NaN. A tile in another projection raises
ValueError.
lonlat_to_laea ¶
lonlat_to_laea(west: float, south: float, east: float, north: float) -> tuple[float, ...]
A box in degrees as (minx, miny, maxx, maxy) in EPSG:3035 metres.
The edges are densified, so the result contains the whole box, not
only its corners: what :func:mosaic and tiles_for_bounds take.
lonlat_to_xy ¶
lonlat_to_xy(lon: float, lat: float) -> tuple[float, float]
A point in degrees (WGS84) as (x, y) in EPSG:3035 metres.
value_at ¶
value_at(tiff: Path, x: float, y: float) -> float | None
The value of the pixel containing (x, y) (EPSG:3035 metres).
None where the tile has no data, or when the point is outside it. A
tile in another projection raises ValueError.
to_cog ¶
to_cog(m: Mosaic, path: Path) -> Path
Write a mosaic as a Cloud-Optimized GeoTIFF in EPSG:3035.
float32, NaN as nodata, deflate-compressed with overviews: it opens in
QGIS or a browser map and streams over HTTP. Written to .part first.
to_xarray ¶
to_xarray(m: Mosaic, *, name: str = 'velocity') -> Any
A mosaic as an xarray.DataArray on y / x pixel centres.
The CRS travels CF-style in a spatial_ref coordinate, which rioxarray
and GDAL read; values are mm/year, NaN where no data. Needs xarray.