Skip to content
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

Feat/clipping no fly zones #83

Merged
merged 3 commits into from
Jul 23, 2024
Merged

Feat/clipping no fly zones #83

merged 3 commits into from
Jul 23, 2024

Conversation

Pradip-p
Copy link
Collaborator

@Pradip-p Pradip-p commented Jul 22, 2024

Description

This PR introduces enhancements to our geometry handling to support multiple Polygon and MultiPolygon types in the no_fly_zones field and also render the task split with no-fly zones.

Changes

  • Read and parse no-fly zones GeoJSON if provided.
  • Calculate the difference between the project shape and no-fly zones.
  • Generate the resulting GeoJSON feature with the new outline.

Geometry Merging:

  • Implemented logic to merge multiple geometries into a single MultiPolygon using Shapely's unary_union.
  • Ensured that if the merged geometry is not already a MultiPolygon, it is converted to one.

screenshot
multiPolygon
multi-polygon

Copy link
Member

@spwoodcock spwoodcock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Via shapely is ok for now, but with PostGIS directly in the db would be a bit nicer 👍

Note I recently tried to standardise our GeoJSON usage for FMTM, taking into account multipolygons, z-index, etc: https://github.com/hotosm/fmtm/blob/f1ec17040f1ab8819cc62129c19dae7e51ef72d2/src/backend/app/db/postgis_utils.py#L409

I'm thinking of pulling these utils out into a separate package geojson-parsers that could be used in FMTM & Drone-TM, so we could refactor in the future 😄

@nrjadkry nrjadkry merged commit a0d5f00 into main Jul 23, 2024
1 check passed
@nrjadkry nrjadkry deleted the feat/clipping-no-fly-zones branch July 23, 2024 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants