Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
66fcc2e
feat(basemap): geology sources registry
MaxNumerique Nov 25, 2026
8cb229c
feat(basemap): serve wms and export sources as tiles
MaxNumerique Nov 25, 2026
a0a45db
feat(basemap): empty tiles and rate limits of a source
MaxNumerique Nov 25, 2026
817f58b
feat(basemap): fill the geology layer tile by tile
MaxNumerique Nov 25, 2026
f14306e
feat(basemap): geology map
MaxNumerique Nov 25, 2026
83c4a56
feat(basemap): geology sources of the first lot
MaxNumerique Nov 25, 2026
0600535
fix(basemap): drop geology sources with an uncertain licence
MaxNumerique Nov 25, 2026
3591f84
feat(basemap): egdi as the european geology fallback
MaxNumerique Nov 25, 2026
472b4d4
Apply prepare changes
MaxNumerique Nov 25, 2026
165c97f
feat(basemap): geology sources of europe, canada and australian states
MaxNumerique Nov 25, 2026
4120a28
feat(basemap): wms 1.1.1 geology sources, québec regional geology
MaxNumerique Nov 25, 2026
1679c16
feat(basemap): brgm harmonised 1:50 000 geology first in france
MaxNumerique Nov 26, 2026
14d0116
feat(basemap): egdi geology asked up to zoom 13
MaxNumerique Nov 26, 2026
7b6521c
feat(basemap): yukon and saskatchewan geology
MaxNumerique Nov 26, 2026
bf2927d
feat(basemap): estonia and northern ireland geology
MaxNumerique Nov 26, 2026
c6cf7ed
feat(basemap): iceland geology
MaxNumerique Nov 26, 2026
14850ca
feat(basemap): argentina and mexico geology
MaxNumerique Nov 26, 2026
50e8bb8
feat(basemap): northern territory and alberta geology
MaxNumerique Nov 26, 2026
d84b4cd
feat(basemap): luxembourg geology
MaxNumerique Nov 26, 2026
2d2ea07
Merge remote-tracking branch 'origin/next' into feat/geology
MaxNumerique Nov 26, 2026
2d24d3e
Apply prepare changes
MaxNumerique Nov 26, 2026
c54235e
refactor(basemap): layers declare their tile by tile fill
MaxNumerique Nov 26, 2026
f84243a
feat(basemap): circuit breaker and parallel geology sources, nightly …
MaxNumerique Nov 26, 2026
6f6ece7
Apply prepare changes
MaxNumerique Nov 26, 2026
bdbf280
ci: drop the nightly geology sources workflow
MaxNumerique Nov 26, 2026
c93ea23
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
MaxNumerique Nov 27, 2026
cf313d2
Merge remote-tracking branch 'origin/next' into feat/geology
MaxNumerique Dec 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions opengeodeweb_back_schemas.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"enum": [
"satellite",
"plan",
"geology",
"routes"
]
}
Expand Down
2 changes: 1 addition & 1 deletion opengeodeweb_back_typed_schemas.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface Bounds {
y_min: number;
}

export type Map = "satellite" | "plan" | "routes";
export type Map = "satellite" | "plan" | "geology" | "routes";

export interface BasemapBuildResponse {
attribution: string;
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ where = ["src"]
"opengeodeweb_back.routes.create.schemas" = ["*.json"]
"opengeodeweb_back.routes.crs.schemas" = ["*.json"]
"opengeodeweb_back.routes.basemap.schemas" = ["*.json"]
"opengeodeweb_back.basemap" = ["*.json"]
"opengeodeweb_back" = ["py.typed", "schema_definitions.json"]
5 changes: 4 additions & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[pytest]
addopts = --ignore=src/opengeodeweb_back/
# Network tests reach the real tile servers: run them by hand with -m network
addopts = --ignore=src/opengeodeweb_back/ -m "not network"
markers =
network: reaches the real tile servers, not run in CI
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,3 @@ werkzeug==3.1.8
# flask
# flask-cors

opengeodeweb-microservice==1.*,>=1.5.0
8 changes: 3 additions & 5 deletions src/opengeodeweb_back/basemap/basemap_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,22 @@

# Third party imports
import opengeode as og
import opengeode_geosciences as og_geosciences

# Local application imports
from opengeodeweb_back.basemap.basemap_tiles import HALF_WORLD
from opengeodeweb_back.crs.crs_functions import convert_xy_corners
from opengeodeweb_back.crs.crs_functions import WEB_MERCATOR, convert_xy_corners
from opengeodeweb_back.geode_objects.geode_triangulated_surface3d import (
GeodeTriangulatedSurface3D,
)

if TYPE_CHECKING:
import opengeode_geosciences as og_geosciences

from opengeodeweb_back.basemap.basemap_tiles import TileRange

GRID_SIZE = 32
MESH_NAME = "basemap"
UV_ATTRIBUTE = "basemap_uv"
WEB_MERCATOR = og_geosciences.GeographicCoordinateSystemInfo(
"EPSG", "3857", "WGS 84 / Pseudo-Mercator"
)
OUTSIDE_MESSAGE = "Area outside the map projection limits"


Expand Down
50 changes: 43 additions & 7 deletions src/opengeodeweb_back/basemap/basemap_providers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

# Standard library imports
import math
import os
from dataclasses import dataclass
from typing import TYPE_CHECKING
Expand All @@ -18,6 +19,27 @@ class Source:
url_template: str
max_zoom: int
attribution: str
# A tile-by-tile layer asks a source only for the tiles of its scale window (in scale
# denominators) and of its Web Mercator area (None for the whole world)
min_scale: float = 0.0
max_scale: float = math.inf
area_3857: tuple[float, float, float, float] | None = None
# Scale of the data, None when unknown
source_scale: float | None = None
# How the server says it has no data: a 404, a transparent tile or a plain colour tile
empty_tile: str = "404"
# Sources asked by bounding box (WMS, map server export): the CRS of their {bbox}
bbox_crs: str | None = None


@dataclass(frozen=True)
class Layer:
"""The sources of one layer of a map, the preferred first."""

sources: tuple[str, ...]
# False: the first source serving any tile draws the whole layer, one style per mosaic.
# True: each tile takes the first source whose scale window and area hold it and that serves it
tile_by_tile: bool = False


_GEOPLATEFORME = (
Expand Down Expand Up @@ -55,14 +77,28 @@ class Source:
),
}

# The layers of each map, from the bottom up. A layer draws the first of its sources serving a
# tile: the next one is only fetched when it serves none
MAPS: dict[str, tuple[tuple[str, ...], ...]] = {

def _geology_sources() -> dict[str, Source]:
# Imported here: the registry builds Source objects of this module
from opengeodeweb_back.basemap import geology_registry # noqa: PLC0415

return geology_registry.load()


_GEOLOGY = _geology_sources()
SOURCES.update(_GEOLOGY)
# The geology sources, the most detailed first
GEOLOGY_SOURCES: tuple[str, ...] = tuple(_GEOLOGY)

# The layers of each map, from the bottom up
MAPS: dict[str, tuple[Layer, ...]] = {
# The IGN covers the world imagery or map where it has tiles (France)
"satellite": (("eox_s2cloudless_2016",), ("ign_orthophotos",)),
"plan": (("osm",), ("ign_plan",)),
"satellite": (Layer(("eox_s2cloudless_2016",)), Layer(("ign_orthophotos",))),
"plan": (Layer(("osm",)), Layer(("ign_plan",))),
# Under the roads, which stay readable over it. Each survey fills the tiles it serves
"geology": (Layer(GEOLOGY_SOURCES, tile_by_tile=True),),
# Transparent: both sources would draw the same roads twice, EOX outside France
"routes": (("ign_roads", "eox_overlay"),),
"routes": (Layer(("ign_roads", "eox_overlay")),),
}


Expand All @@ -85,7 +121,7 @@ def sorted_maps(maps: Iterable[str]) -> list[str]:
def map_layers(maps: list[str], served: Container[str]) -> dict[str, list[str]]:
"""The served sources of each sorted map, from the bottom up: maps without any are left out."""
layers = {
name: [source for layer in MAPS[name] for source in layer if source in served]
name: [source for layer in MAPS[name] for source in layer.sources if source in served]
for name in maps
}
return {name: sources for name, sources in layers.items() if sources}
Expand Down
Loading
Loading