MapColonies / MapColonies/polygon-parts-worker
Layer Parts GeoPackage table: select + rename to product-required export schema
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- Avg merge
- 1h 58m
- Merged PRs (30d)
- 1
Description
## What to build
Change the **Layer Parts** table written into the exported GeoPackage so it contains exactly the product-required fields, named per the agreed convention.
In the worker's feature-manipulation step, **after** the existing resolution recalculation:
- **Select** only the required source properties and drop the rest (`jobType`, `catalogId`, `partId`, `sourceId`, `sourceResolutionMeter`, and the already-stripped `requestFeatureId`).
- **Rename** the survivors to their snake_case export names using the shared converter from `raster-shared` (which applies the `resolutionDegree -> resolution_deg` override).
- Emit a **fixed schema**: every required column is always present, with missing optional values (`description`, `countries`, `cities`) defaulting to `null` so the column always exists.
- The recalculated resolution values must flow into `resolution_deg` and `resolution_meter`.
Required columns (besides the GeoPackage-generated `fid`): `id`, `description`, `sensors`, `product_id`, `product_type`, `product_version`, `imaging_time_begin_utc`, `imaging_time_end_utc`, `ingestion_date_utc`, `resolution_deg`, `resolution_meter`, `horizontal_accuracy_ce90`, `countries`, `source_name`, `cities`.
The `find` API contract is unchanged; no DB changes; no `raster-shared` schema rename.
## Acceptance criteria
- [ ] The transformed feature properties contain exactly the 15 required keys in snake_case; no extra source fields leak through.
- [ ] camelCase to snake_case renaming is correct for all fields, including `horizontal_accuracy_ce90` and the `*_utc` fields, via the shared converter.
- [ ] `resolution_deg` is present (from the override) and carries the recalculated resolution value; `resolution_meter` carries the recalculated value.
- [ ] Missing `description`/`countries`/`cities` yield a null-valued column rather than an absent column (fixed schema).
- [ ] The worker consumes the shared converter from `raster-shared` (no local re-implementation).
- [ ] Unit tests at the feature-manipulation seam assert the exact output key set, the renames, the override, and the null defaults.
## Blocked by
- MapColonies/raster-shared#211
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the worker's feature-manipulation step after resolution recalculation, then inspect the shared converter in raster-shared and the dependency noted in MapColonies/raster-shared#211. Add unit tests at that seam for the exact 15-key output, renames, recalculated resolution values, and null defaults; done means the exported properties match the fixed schema without extra fields.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend, data
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 58/100