feat: detect geozone from spatial.geom - #3857
Draft
abulte wants to merge 1 commit into
Draft
Conversation
Contributor
Author
|
Related ecolabdata/ecospheres#1191 |
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.
This feed
dataset.extras['analysis:spatial:zones']with one or more detected geozones fromdataset.spatial.geom.We're not using
dataset.spatial.zonesbecause:dataset.spatialI believe this belongs in
udatasince it's working on dataset's metadata. Theanalysis:namespace might be wrong though.The matching is done by comparing the geozone bbox to the spatial geometry bbox. This makes it fast and doesn't require any geo lib. See https://github.com/abulte/dataset-geom-to-zone for more info on matching method. It's triggered through Celery on dataset creation and dataset geometry update.
This requires associating a bbox to geozones, which this PR introduces a CLI command for. See attached file for a working draft of the expected input file. This should probably be industrialised through a DAG and published on data.gouv.fr. See https://github.com/abulte/dataset-geom-to-zone for more info on building the required input file.
Performance insights:
I'm leaving this in draft for now since I want to take more time to review the code and do more tests on the matching threshold, but don't hesitate to comment on the principle and implementation choices.
zones_bboxes.json