-
Notifications
You must be signed in to change notification settings - Fork 19
feat(cli-vector): introduce logic for overriding feature metadata and properties BM-1268 #3440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Action Items
|
… properties BM-1268 (#3440) 1. This pull request extends the [feat/etl-create] branch, not the [master] branch. 2. The changed files contain short-circuiting code to enable faster debugging that needs to be purged before approval. --- ### Motivation We are currently migrating our Vector ETL system into basemaps as a new `cli-vector` package. We are also re-building the system in the process. As a part of the re-build, we have streamlined the system's architecture in the following four steps: 1. `extract` 2. `create` 3. `join` 4. `analyse` This work implements an extension to the base branch's implementation of the `create` CLI command. This work introduces a series of functions for handling dataset features of specific Shortbread layers for which we require special tagging. ### Modifications | Diagram | | - | | ![][diagram1] | 1. Implements a switch-style pattern for identifying the Shortbread layer to which a feature is assigned. 2. Implements bespoke functions for overriding a feature's metadata and properties for the following Shortbread layers: - `contours` - `place_labels` - This one is weird. We will need to discuss the approach for this one. - `pois` - This one doesn't actually do anything as it never receives any features that will meet its conditions for special tagging. We can discuss this also. - `public_transport` - `street_labels` - This one's logic is very similar to the `streets` logic. - `streets` - This one's logic is very similar to the `street_labels` logic. - `water_polygons` #### Processing a Vector Stac Item The system processes a Stac Item file created via the **cli-vector** package's new `extract` command like so: 1. Parse the file as a runtime `VectorStacItem` type. 2. Download the source file (i.e. a GeoPackage file). 3. Convert the source file into an NDJSON file. 4. Parse each line (i.e. feature) of the NDJSON file, generalise it (i.e. simplify, add/remove attributes, or discard). 5. Process the collection of generalised features into an mbtiles file. 6. Upload a copy of the mbtiles file to the same directory as the Stac Item file. 7. Update the Stac Item file's contents and overwrite it. | Diagram | | - | | ![][diagram2] | ### Verification 1. Established test cases for the special tagging functions for the following Shortbread layers: - `contours` More to come if desired. <!-- external links --> [feat/etl-create]: https://github.com/linz/basemaps/tree/feat/etl-create [master]: https://github.com/linz/basemaps/tree/master [diagram1]: https://github.com/user-attachments/assets/6a405417-59fb-4127-8630-cb0901c12618 [diagram2]: https://github.com/user-attachments/assets/2994bd5d-c668-4b99-957e-57623da7c6a1 --------- Co-authored-by: Wentao Kuang <[email protected]>
… properties BM-1268 (#3440) 1. This pull request extends the [feat/etl-create] branch, not the [master] branch. 2. The changed files contain short-circuiting code to enable faster debugging that needs to be purged before approval. --- ### Motivation We are currently migrating our Vector ETL system into basemaps as a new `cli-vector` package. We are also re-building the system in the process. As a part of the re-build, we have streamlined the system's architecture in the following four steps: 1. `extract` 2. `create` 3. `join` 4. `analyse` This work implements an extension to the base branch's implementation of the `create` CLI command. This work introduces a series of functions for handling dataset features of specific Shortbread layers for which we require special tagging. ### Modifications | Diagram | | - | | ![][diagram1] | 1. Implements a switch-style pattern for identifying the Shortbread layer to which a feature is assigned. 2. Implements bespoke functions for overriding a feature's metadata and properties for the following Shortbread layers: - `contours` - `place_labels` - This one is weird. We will need to discuss the approach for this one. - `pois` - This one doesn't actually do anything as it never receives any features that will meet its conditions for special tagging. We can discuss this also. - `public_transport` - `street_labels` - This one's logic is very similar to the `streets` logic. - `streets` - This one's logic is very similar to the `street_labels` logic. - `water_polygons` #### Processing a Vector Stac Item The system processes a Stac Item file created via the **cli-vector** package's new `extract` command like so: 1. Parse the file as a runtime `VectorStacItem` type. 2. Download the source file (i.e. a GeoPackage file). 3. Convert the source file into an NDJSON file. 4. Parse each line (i.e. feature) of the NDJSON file, generalise it (i.e. simplify, add/remove attributes, or discard). 5. Process the collection of generalised features into an mbtiles file. 6. Upload a copy of the mbtiles file to the same directory as the Stac Item file. 7. Update the Stac Item file's contents and overwrite it. | Diagram | | - | | ![][diagram2] | ### Verification 1. Established test cases for the special tagging functions for the following Shortbread layers: - `contours` More to come if desired. <!-- external links --> [feat/etl-create]: https://github.com/linz/basemaps/tree/feat/etl-create [master]: https://github.com/linz/basemaps/tree/master [diagram1]: https://github.com/user-attachments/assets/6a405417-59fb-4127-8630-cb0901c12618 [diagram2]: https://github.com/user-attachments/assets/2994bd5d-c668-4b99-957e-57623da7c6a1 --------- Co-authored-by: Wentao Kuang <[email protected]>
Motivation
We are currently migrating our Vector ETL system into basemaps as a new
cli-vectorpackage. We are also re-building the system in the process. As a part of the re-build, we have streamlined the system's architecture in the following four steps:extractcreatejoinanalyseThis work implements an extension to the base branch's implementation of the
createCLI command. This work introduces a series of functions for handling dataset features of specific Shortbread layers for which we require special tagging.Modifications
contoursplace_labels- This one is weird. We will need to discuss the approach for this one.pois- This one doesn't actually do anything as it never receives any features that will meet its conditions for special tagging. We can discuss this also.public_transportstreet_labels- This one's logic is very similar to thestreetslogic.streets- This one's logic is very similar to thestreet_labelslogic.water_polygonsProcessing a Vector Stac Item
The system processes a Stac Item file created via the cli-vector package's new
extractcommand like so:VectorStacItemtype.Verification
contoursMore to come if desired.