fix(map): make area analysis scale-aware
This commit is contained in:
@@ -881,6 +881,24 @@ Rules:
|
||||
- `limit` is bounded to `1..1000`. Municipality-scale clients must page spatially by viewport instead of requesting an unbounded municipality FeatureCollection.
|
||||
- The Map workspace uses this existing endpoint for vector datasets above 5,000 features. It starts delivery at zoom level 14, debounces `moveend` requests and explicitly reports `truncated=true` as a request to zoom further in. This is a client delivery policy, not a second API or persistence path.
|
||||
|
||||
### POST `/api/v1/projects/{project_id}/datasets/vector/partitions/select`
|
||||
|
||||
Combines `1..16` bounded vector acquisitions of one governed source product
|
||||
into one read-only selection result. The request uses the same `bbox`, optional
|
||||
`area_id` and `limit` contract as vector selection plus `dataset_ids`.
|
||||
|
||||
The backend rejects mixed projects, non-ready vector datasets and partitions
|
||||
whose `source_name` or `product_key` differs. PostGIS calculates area and length
|
||||
metrics across all persisted tile geometries. `total_feature_count` is
|
||||
deduplicated by provider `source_feature_id` where available so a source object
|
||||
crossing a tile edge is not presented as two objects. The response includes
|
||||
`partition_count`, `source_name` and the exact `dataset_ids` used.
|
||||
|
||||
The Map workbench uses this route only for regional selections up to 50 by 50
|
||||
kilometres. Provider calls remain individually bounded below 20 kilometres;
|
||||
larger overview selections do not fan out into unbounded high-resolution
|
||||
downloads.
|
||||
|
||||
### POST `/api/v1/projects/{project_id}/datasets/{dataset_id}/vector/select/derive`
|
||||
|
||||
Persists a bbox selection as a new derived vector dataset and indexes the
|
||||
|
||||
@@ -10953,3 +10953,40 @@ Validation:
|
||||
themes through acquisition or persisted national data and semantic
|
||||
selection metrics;
|
||||
- browser verification follows against the deployed commit on port 1202.
|
||||
|
||||
## 2026-07-21 - Scale-aware rectangle analysis
|
||||
|
||||
Implemented:
|
||||
|
||||
- reproduced the reported provider failure with an approximately 11,468 km2
|
||||
cross-region rectangle: twenty high-resolution adapters received one unsafe
|
||||
bbox and returned their governed size limits;
|
||||
- added explicit detail, regional and overview selection tiers before any
|
||||
provider acquisition starts;
|
||||
- regional selections up to 50 by 50 km now split compatible vector and point
|
||||
sources into at most sixteen 18 km tiles, resolve the authority zone per tile
|
||||
and combine each provider product as one persisted PostGIS result;
|
||||
- added a canonical multi-partition vector selection route with project,
|
||||
readiness and source-product consistency guards and source-feature count
|
||||
deduplication;
|
||||
- allowed terrain and flood partition analysis to receive an explicit set of
|
||||
freshly acquired Dataset ids, avoiding accidental reuse of overlapping old
|
||||
bounded rasters;
|
||||
- kept 5 m raster analysis behind its real pixel budget and 10 m thematic
|
||||
analysis behind its 50 km scale budget;
|
||||
- changed overview selections to query only national or already provisioned
|
||||
scale-compatible datasets and explain the scale choice once, instead of
|
||||
presenting one provider error for every unavailable detail source.
|
||||
|
||||
Validation:
|
||||
|
||||
- backend import/compile and frontend TypeScript passed after the contract
|
||||
change;
|
||||
- focused selection-partition, DHMV and VMM tests passed (30 tests);
|
||||
- focused frontend scale, tiling and concurrency tests passed (12 tests).
|
||||
|
||||
Remaining in this pass:
|
||||
|
||||
- run the complete readiness gate, deploy the immutable revision and repeat
|
||||
both the large overview rectangle and a regional partitioned rectangle in
|
||||
the live browser.
|
||||
|
||||
@@ -835,3 +835,14 @@ This file now starts with the current implementation status. Older preparation/b
|
||||
uncertainty tests exist; never merge TAW, LAT and mDNG implicitly.
|
||||
- [ ] Add water volume only when bed and water-surface inputs share a governed
|
||||
time, datum and coverage contract.
|
||||
|
||||
# Scale-aware map selection
|
||||
|
||||
- [x] Prevent country-scale rectangles from fan-out querying every local
|
||||
provider and replace repeated source-limit errors with one overview status.
|
||||
- [x] Partition compatible 20-50 km regional vector acquisitions into bounded
|
||||
source requests and combine their persisted PostGIS metrics.
|
||||
- [x] Keep terrain, flood and thematic rasters behind explicit pixel and
|
||||
selection-size budgets.
|
||||
- [ ] Provision additional national-scale baseline datasets before exposing
|
||||
more overview themes; do not synthesize regional detail at national scale.
|
||||
|
||||
Reference in New Issue
Block a user