feat: extract tileset.json from 3tz and validate footprint (MAPCO-11837) - #12
Open
lirantul123 wants to merge 2 commits into
Open
lirantul123 wants to merge 2 commits into
lirantul123 wants to merge 2 commits into
Conversation
Add tileset validation to the ingestion flow for both 3tz and folder inputs: read tileset.json, extract the model polygon from its bounding volume, and require the footprint to intersect and cover the model above a configurable threshold. TilesetReader reads tileset.json without a zip dependency: for a 3tz it reads the first local file entry directly via a file handle (real 3tz archives break yauzl's central-directory parsing), guarding against data-descriptor/ZIP64 entries whose size is absent from the local header; for a folder it reads the file from disk. Polygon extraction (region/sphere bounding volumes) lives in @map-colonies/3d-shared. Coverage is checked with turf against validation.percentageLimit (default 10), wired through schema, config, custom-environment-variables and helm. Unit and integration tests included.
|
🎫 Related Jira Issue: MAPCO-11837 |
Return ValidationResponse {isValid, message} from the tileset polygon
extraction and footprint-intersection checks (mirroring 3d-gateway), route
every failure through a single rejectValidation() that logs the outcome and
throws AppError so the message reaches the client. Move ValidationResponse to
common/interfaces. Match 3d-gateway's coverage/far-from-model messages and add
a coverage-below-threshold test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add tileset validation to the ingestion flow for both 3tz and folder inputs: read tileset.json, extract the model polygon from its bounding volume, and require the footprint to intersect and cover the model above a configurable threshold.
TilesetReader reads tileset.json without a zip dependency: for a 3tz it reads the first local file entry directly via a file handle (real 3tz archives break yauzl's central-directory parsing), guarding against data-descriptor/ZIP64 entries whose size is absent from the local header; for a folder it reads the file from disk. Polygon extraction (region/sphere bounding volumes) lives in @map-colonies/3d-shared. Coverage is checked with turf against validation.percentageLimit (default 10), wired through schema, config, custom-environment-variables and helm. Unit and integration tests included.