Skip to content

Commit

Permalink
Production Release (#407)
Browse files Browse the repository at this point in the history
* feat: make project approval page authentication free

* feat: disable show popup functionality if user role is `REGULATOR`

* feat(project-approval-by-regulator): add services to register regulator as a user

* feat(project-approval-by-regulator): fetch project data after the user token is received and saved on local storage on successful response of user token api

user token api takes the token as body and creates user and returns tokens and role the role will be the `REGULATOR`

* feat(project-approval-by-regulator): round off project area and add unit `km²`

* feat: add ts

* feat(project-approval-by-regulator): add ApprovalSection component

* feat(project-approval-by-regulator): post regulator's comment with approval status

* feat(project-approval-by-regulator): show regulator's approval status and comment on about section

* feat: show dashboard button only if the user is authenticated and the user role is other than `Regulator`

* feat: update drone-flightplan to v0.3.2 and notify project creator on unflyable task state (#357)

* feat: notify project creator when a task is marked as unflyable

* feat: upgrade drone-flightplan to >=0.3.2 and add email notification for unflyable task

* fix: added author email to send the email notification

* feat: add actions and reducer for image processing

* feat: add exifreader component

* refactor: update component to HOC, add forwardRef

* feat: add image plotted modal and type

* refactor: update handle change function to extract and dispatch exif data

* feat: add component to plot images data in map using its exif data

* feat: add function to convert exifData to GeoJson data

* feat: add function to extract exif data from image file

* feat: add function to sort array of objects using dateTime property

* hotfix: orthophoto zoom to geotiff

* refactor: handle cases of no selection

* refactor: handle cases of undefined/ null data

* refactor: rename item to exifData at map function

* refactor: remove destructuring of state and use single var

* refactor: update type for handle change event

* feat: post drone registered certificate and drone pilot certificate on profile complete

* refactor: update import of redux state

* refactor: destructure url instead of accessing whole object and accessing url

* feat: show default image on profile in case of failure

* refactor: update message mutation for if the task is not flyable

* refactor: reset exifData at redux state at initial render

* feat(update-profile): post only the binary file on certificate

* feat: add `@cyntler/react-doc-viewer` package

* feat: add document preview modal

* feat(dashboard): implement drone certificate preview on task lock request

* fix(individual-project): task requested for lock although the project owner lockes the task

* feat: set certificate & registration url in my-info endpoint

* fix: document viewer details style

* fix: UploadArea component

* feat: show uploaded certificates on edit profile page

* feat: clear selectedDocumentDetails on document preview component unmount

* docs: update user roadmap with latest requirements

* feat(document-preview): download certificate using blob and additional UI  if the file is image

* docs: tweak user roadmap based on feedback

* feat: set the certificate & registration url in task request page

* feat(dashboard): show drone certificate and pilot certificate on task request log

* feat: ommit password section if the existing user is trying to login as another role

* fix: remove comment code from task schemas

* feat(regulators-approval-page): clear local storage on main page unmount

* feat: implemented user certificate upload functionality, storing user certificates on S3. (#331)

* feat: Implement S3 path structure & file upload for user-specific drone operator certificate uploads

* refac: refactor user profile update: Add validation for empty data, handle certificate URL and role updates

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* feat: update certificate URL in database for user profile

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* feat: update registration registration of drone operator

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix(profile-update): UI Issue

* feat: add method parameter on `callApiSimultaneously` function

* feat(update-profile): post add files `certificate` and `drone registration` file along with the other details

* feat: post drone registered certificate and drone pilot certificate on profile complete

* feat: show default image on profile in case of failure

* feat(update-profile): post only the binary file on certificate

* feat: add `@cyntler/react-doc-viewer` package

* feat: add document preview modal

* feat(dashboard): implement drone certificate preview on task lock request

* fix(individual-project): task requested for lock although the project owner lockes the task

* feat: set certificate & registration url in my-info endpoint

* fix: document viewer details style

* fix: UploadArea component

* feat: show uploaded certificates on edit profile page

* feat: clear selectedDocumentDetails on document preview component unmount

* feat(document-preview): download certificate using blob and additional UI  if the file is image

* feat: set the certificate & registration url in task request page

* feat(dashboard): show drone certificate and pilot certificate on task request log

* feat: ommit password section if the existing user is trying to login as another role

* fix: remove comment code from task schemas

* feat(regulators-approval-page): clear local storage on main page unmount

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sujit <sujitkarki703@gmail.com>

* fix: set iscertifiedDroneUser initial value once

* feat(user-profile): support pdf to upload certificates

* feat: add zoom to extent function

* refactor: remove unecessary states and handle session end of modal

* refactor: rename title for imageMapBox modal

* feat(project-approval-page): clear comment on approval comment success

* feat: update type for coordinates

* feat: make project `DescriptionSection` dynamic to render on both project description and project approval page

* feat: add about section on project description page

* feat: make regulator approval status optional to view on description section

* feat(project-description): make map popup disabled if the regulator approval status is `REJECTED`

* feat(project-description): disable popup open on table row click if requlator approval status is `REJECTED`

* Adjust project description as per regulator's approval status  (#361)

* feat: Implement S3 path structure & file upload for user-specific drone operator certificate uploads

* refac: refactor user profile update: Add validation for empty data, handle certificate URL and role updates

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* feat: update certificate URL in database for user profile

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* feat: update registration registration of drone operator

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix(profile-update): UI Issue

* feat: add method parameter on `callApiSimultaneously` function

* feat(update-profile): post add files `certificate` and `drone registration` file along with the other details

* feat: post drone registered certificate and drone pilot certificate on profile complete

* feat: show default image on profile in case of failure

* feat(update-profile): post only the binary file on certificate

* feat: add `@cyntler/react-doc-viewer` package

* feat: add document preview modal

* feat(dashboard): implement drone certificate preview on task lock request

* fix(individual-project): task requested for lock although the project owner lockes the task

* feat: set certificate & registration url in my-info endpoint

* fix: document viewer details style

* fix: UploadArea component

* feat: show uploaded certificates on edit profile page

* feat: clear selectedDocumentDetails on document preview component unmount

* feat(document-preview): download certificate using blob and additional UI  if the file is image

* feat: set the certificate & registration url in task request page

* feat(dashboard): show drone certificate and pilot certificate on task request log

* feat: ommit password section if the existing user is trying to login as another role

* fix: remove comment code from task schemas

* feat(regulators-approval-page): clear local storage on main page unmount

* fix: set iscertifiedDroneUser initial value once

* feat(user-profile): support pdf to upload certificates

* feat(project-approval-page): clear comment on approval comment success

* feat: make project `DescriptionSection` dynamic to render on both project description and project approval page

* feat: add about section on project description page

* feat: make regulator approval status optional to view on description section

* feat(project-description): make map popup disabled if the regulator approval status is `REJECTED`

* feat(project-description): disable popup open on table row click if requlator approval status is `REJECTED`

---------

Co-authored-by: Pradip-p <thapapradip542@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sujit <sujitkarki703@gmail.com>

* fix: hide approval section if the approval status has value

* add trailing slash(/) in the regulator approval endpoint

* style: about project

* feat(project-description): show different popup message and hide task lock button if the `regulator_approval_status` is `PENDING` or `REJECTED`

* fix: about typo and set default selected project tab to about

* fix: capitalize tab options label

* fix: update roles in existing user when auto local regulator creation

* feat(regulators-approval-section): hide approval section on approval status updates

* fix: remove commented code

* fix: show popup on task click although the project is rejected

* fix: update roles in existing user when auto local regulator creation (#362)

* fix: upadate the regulator

* Fix/regulator profile creation (#366)

* fix: update roles in existing user when auto local regulator creation

* fix: upadate the regulator

* fix: reslove user roles access issues with regulator

* feat: add drone altitude regulations model

* feat: Add 'get all' and 'get one' endpoints for drone altitudes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* reac: Rename DbDroneAltitude class to DbDroneFlightHeight and update table name

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* feat: Implemented endpoint to retrieve all drone altitude regulations of country (#368)

* feat: add drone altitude regulations model

* feat: Add 'get all' and 'get one' endpoints for drone altitudes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* reac: Rename DbDroneAltitude class to DbDroneFlightHeight and update table name

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* feat: add `OSM_NOMINATIM_URL` on viteconfig and env.example

* feat(project-creation): get project country by project centroid using `OSM Nominatim API`

find centroid with the help of `truf`

Integrated Nominatim API to fetch the country based on the centroid coordinates

* Replace `pdm` to `uv` for faster dependency management (#347)

* feat: migrate from pdm to uv

* build: replace pdm with uv, add pre-commit hook to lock deps

* build: replace all usage of pdm with uv

* build:  replace pdm with uv for faster dependency managementreplace all usage of pdm with uv

* feat: update entry point to run with uv

* update: users deps login_required

---------

Co-authored-by: Niraj Adhikari <nrjadkry@gmail.com>

* feat: add className optional prop to InfoMessage component for dynamic styling

* feat: add orthoPhoto task component

* feat: add symbol type prop for icon at tooltip

* refactor: remove delay

* feat: add functions to handle visiblity of vector layers and orthophoto layers

* refactor: remove button of show orthophoto from description section

* refactor: update onSuccess function to navigate user from task page to project page

* feat(create-project): Show warning if altitude exceeds country’s max limit

* feat(individual-project): disable popup only if the user role regulator and has no other roles

* feat(create-project): update fields description

* feat: add validations for input feild

* refactor: update onSuccess Function to navigate user to dashboard after password change

* style: add z-index to user profile

* feat: remove nominatim api from .env and vite config and save as a constant variable since it is constant on all environment

* feat: update .env.example

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* feat: Show warning if altitude exceeds country's max limit (#370)

* feat: add drone altitude regulations model

* feat: Add 'get all' and 'get one' endpoints for drone altitudes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* reac: Rename DbDroneAltitude class to DbDroneFlightHeight and update table name

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* feat: add `OSM_NOMINATIM_URL` on viteconfig and env.example

* feat(project-creation): get project country by project centroid using `OSM Nominatim API`

find centroid with the help of `truf`

Integrated Nominatim API to fetch the country based on the centroid coordinates

* feat: add className optional prop to InfoMessage component for dynamic styling

* feat(create-project): Show warning if altitude exceeds country’s max limit

* feat(individual-project): disable popup only if the user role regulator and has no other roles

* feat(create-project): update fields description

* feat: remove nominatim api from .env and vite config and save as a constant variable since it is constant on all environment

* feat: update .env.example

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Pradip-p <thapapradip542@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sujit <sujitkarki703@gmail.com>

* feat: overwrite props className using `cn` the utils function to merge class names using `clsc` and `twMerge`

* fix: typo

* feat: add validation to check if old and new password are same

* refactor: update placeholder for file upload

* feat: updated count waypoints within AOI

* fix: added auth in endpoint

* feat: update handleDrawEnd function to prevent duplicate draw

* feat: add conditional rendering for orthophoto button at map

* refactor: remove character length restriction from comment submission

* refactor: update naming of filterDuplicateFeature parameters

* fix: update waypoints count of aoi

* feat: add service to get project waypoints

* feat: implementation of project avg taskway points count api

* feat: add logic to count number of waypoints in task split (#373)

* feat: updated count waypoints within AOI

* fix: added auth in endpoint

* fix: update waypoints count of aoi

* feat: add service to get project waypoints

* feat: implementation of project avg taskway points count api

---------

Co-authored-by: Bijay Rauniyar <rauniyarbijay0@gmail.com>

* fix: disable popup trigger if user signin as `ReGULATOR`

* fix: added slash in waypoints count endpoint

* [pre-commit.ci] pre-commit autoupdate (#376)

updates:
- [github.com/astral-sh/uv-pre-commit: 0.5.2 → 0.5.5](astral-sh/uv-pre-commit@0.5.2...0.5.5)
- [github.com/commitizen-tools/commitizen: v3.31.0 → v4.0.0](commitizen-tools/commitizen@v3.31.0...v4.0.0)
- [github.com/astral-sh/ruff-pre-commit: v0.8.0 → v0.8.1](astral-sh/ruff-pre-commit@v0.8.0...v0.8.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* refctor: update params and add a loading state for avg way points

* fix: ensure small areas merge with the nearest one in task splitting (#378)

* fix: task locking and validation error in project creator (#382)

* add images.json file into s3

* feat: add turf/transform-rotate package

* feat: add onDrag event listner and corresponding props

* feat: add type for functions to be call at on drag event

* feat: add feature to rotate filght plan

* feat: add function to calculate angle, centeroid

* feat: add funciton to rotate geojson

* refactor: update type for function params

* Feat/flightplan rotation (#383)

* feat: add turf/transform-rotate package

* feat: add onDrag event listner and corresponding props

* feat: add type for functions to be call at on drag event

* feat: add feature to rotate filght plan

* feat: add function to calculate angle, centeroid

* feat: add funciton to rotate geojson

* refactor: update type for function params

* feat: gcp app with router setup

* feat: function to calculate image footprints

* fix: regulator tags updated in routes

* functions to find images within a point

* feat: endpoint to find all the images that contains the specific point

* gcp router added in main.py

* typing used for params

* refactor: update type for calculate angle fn

* hot-fix: ignore ts on modal component

* feat: add needDragEvent Prop

* refactor: update taskDataPolygon and pass needDragEvent at vector layer

* bump drone_flightplan version

* bump drone_flightplan version (#387)

* bump drone_flightplan version to 0.3.3

* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/uv-pre-commit: 0.5.5 → 0.5.7](astral-sh/uv-pre-commit@0.5.5...0.5.7)
- [github.com/commitizen-tools/commitizen: v4.0.0 → v4.1.0](commitizen-tools/commitizen@v4.0.0...v4.1.0)
- [github.com/astral-sh/ruff-pre-commit: v0.8.1 → v0.8.2](astral-sh/ruff-pre-commit@v0.8.1...v0.8.2)
- [github.com/pycontribs/mirrors-prettier: v3.3.3 → v3.4.2](pycontribs/mirrors-prettier@v3.3.3...v3.4.2)

* feat: update rotation funcitons

* feat: optimization of  flightplan rotation

* style: add dropshadow style

* feat: add newAsync Popup for taskpage

* feat: add rotattionCue component

* feat: optimize flightplan rotation

* feat: add layer ids constants

* refactor: remove unused vars

* feat: add function to swap first and last coordinate and fucntion to get last coordinate

* style: add responsive attributes to rotation cue

* refactor: update swapFirstAndLastCoordinate

* refactor: remove swapFirstAndLast coordinate function

* fix: update the flight plan time & updated waypoints conuts if user terrian follow (#390)

* feat: update api for taskDataPolygon

* refactor: update popup close fn

* refactor: update type for mouse Events

* fix: calculate bbox for the drone image (#393)

* refactor: update taskWayPointsData data

* feat: add est flight time

* refactor: update type for coordinates

* feat: generate and download KMZ files with placemarks (#392)

* Added API to generate and download KMZ files

* feat: added centroids on task details

* fix: update authentication read task

* feat: update rotation cue to handle touch events

* feat: add button to save rotated taskpoints

* Gcp calculation (#394)

* fix: calculate bbox for the drone image

* fix: calculate image footprints

* refactor: extract centroid from api

* feat: remove conditional color of points vector layer

* refactor: update get exif data function to check N and S and provide negative or positive coordinates

* style: decrease height of save rotated plan button

* feat: add rotation degree inside rotation cue

* docs: add quick summary page about GCP workflow

* style: add bgcolor for toggled buttons

* feat: update events for rotation handle

* Get a list of images that contains a GCP Point from a whole Project (#396)

* fix: calculate bbox for the drone image

* fix: calculate image footprints

* feat: get a list of images that contains a point

* Style/responsive (#397)

* refactor: remove useEffect and items to show state

* style: add css to hide spinner on input:number

* style: decrease width of select and input feilds

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Fix/image procssing status (#386)

* fix: add state image processing started to already image uploaded state

* fix: change updated time to be same as created at

* fix: add state for image processing to already present url

* refactor: add funcitonality to start image processing manually

* refactor: remove upload button

* style: add bg color for IMAGE_UPLOADED state

* fix: resolved image processing issues, state management for color, and dashboard listing

---------

Co-authored-by: Bijay Rauniyar <rauniyarbijay0@gmail.com>
Co-authored-by: Pradip-p <thapapradip542@gmail.com>

* feat: Download dem file from JAXA if not provided by the user (#380)

* feat: auto add dem file if not provided by the user

for more information, see https://pre-commit.ci

* fix: scrapy signals issue with signals

for more information, see https://pre-commit.ci

* feat: add constants for dem radio data

* feat: add reducer and action ro set demTYpe

* feat: add dem type

* feat: auto add dem file if not provided by the user

for more information, see https://pre-commit.ci

* fix: scrapy signals issue with signals

for more information, see https://pre-commit.ci

* refactor: remove title from dem type switch

* fix: pre commit  fix

---------

Co-authored-by: Bijay Rauniyar <rauniyarbijay0@gmail.com>

* Update README.md

* update: label for dem file download from jaxa

* Feat/flightplan rotation (#400)

* feat: implement api to save rotated flight plan

* refactor: remove type from flightPlan mutation

* refactor: update condition to show update image button

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* [pre-commit.ci] pre-commit autoupdate (#403)

updates:
- [github.com/astral-sh/uv-pre-commit: 0.5.7 → 0.5.9](astral-sh/uv-pre-commit@0.5.7...0.5.9)
- [github.com/astral-sh/ruff-pre-commit: v0.8.2 → v0.8.3](astral-sh/ruff-pre-commit@v0.8.2...v0.8.3)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* feat: update drone image processor to handle single and multiple tasks (#399)

* feat: add endpoints to process all task images of AOI

* reac: refactor process_assets_from_odm function to reduce redundancy

* fix: remove double s3_path from process_assets_from_odm

* fix: added all tasks images in odm processing

* fix: remove local setup of config & docker-compose

* fix: remove multple class for drone images processing & now handle from single class

* fix: refine drone image processing

* added tags in the odm webhook router endpoint

---------

Co-authored-by: Niraj Adhikari <nrjadkry@gmail.com>

* Update faq section to add basic frequently asked questions.md (#402)

* Update faq.md

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* feat: initial py-test setup & update Dockerfile (#404)

* feat: setup the pytest

* feat: initial pytest setup for drone create

* feat: updated dependency overrides for login required

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* feat: updated test case for read drone

* feat: update user test routes & make dummy project data as fixtures

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

---------

Co-authored-by: Sujit <sujitkarki703@gmail.com>
Co-authored-by: Sovas Tiwari <40485930+subashtiwari1010@users.noreply.github.com>
Co-authored-by: Bijay Rauniyar <rauniyarbijay0@gmail.com>
Co-authored-by: Niraj Adhikari <nrjadkry@gmail.com>
Co-authored-by: spwoodcock <sam.woodcock@protonmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sujit <90745363+suzit-10@users.noreply.github.com>
Co-authored-by: Bijay Rauniyar <155698689+bijayrauniyar0@users.noreply.github.com>
Co-authored-by: Niraj Adhikari <41701707+nrjadkry@users.noreply.github.com>
Co-authored-by: Saurav Aryal <64722587+aryalsaurav@users.noreply.github.com>
Co-authored-by: Manjita Pandey <97273021+manjitapandey@users.noreply.github.com>
  • Loading branch information
12 people authored Dec 20, 2024
1 parent 93c126c commit 97e855e
Show file tree
Hide file tree
Showing 122 changed files with 9,107 additions and 3,165 deletions.
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ POSTGRES_HOST=${POSTGRES_HOST:-db}
S3_BUCKET_NAME=${S3_BUCKET_NAME:-dtm-bucket}
S3_ACCESS_KEY=${S3_ACCESS_KEY:-SAMPLEACCESSKEYFORMINIOROOT}
S3_SECRET_KEY=${S3_SECRET_KEY:-SAMPLESECRETACCESSKEYFORMINIOROOT}


### JAXA ###
JAXA_AUTH_TOKEN=${JAXA_AUTH_TOKEN:-SAMPLEJAXAACCESSTOKEN}

# Use MINIO_ENDPOINT if minioconsole exposed to internet & behind rev proxy.
# REF:https://min.io/docs/minio/linux/integrations/setup-nginx-proxy-with-minio.html
# ex: https://minio.example.net/minio/ui/
Expand Down
14 changes: 11 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,25 @@ repos:
stages: [pre-commit, pre-push, manual]
args: ["--maxkb=10240"]

# Deps: ensure Python uv lockfile is up to date
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.5.9
hooks:
- id: uv-lock
files: src/backend/pyproject.toml
args: [--project, src/backend]

# Versioning: Commit messages & changelog
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.31.0
rev: v4.1.0
hooks:
- id: commitizen
stages: [commit-msg]

# Lint / autoformat: Python code
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: "v0.7.4"
rev: "v0.8.3"
hooks:
# Run the linter
- id: ruff
Expand All @@ -99,7 +107,7 @@ repos:

# Autoformat: YAML, JSON, Markdown, etc.
- repo: https://github.com/pycontribs/mirrors-prettier
rev: v3.3.3
rev: v3.4.2
hooks:
- id: prettier
args:
Expand Down
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,20 @@ To get started with Drone TM:
|| 🖥️ project area subdivision into smaller task areas for operators |
|| 📱 flight plan generation in task areas for DJI drones |
|| 🖥️ upload of drone imagery collected during flight |
|⚙️| 📱 follow terrain during flight plan generation in hilly/mountainous regions |
|| 📱 follow terrain during flight plan generation in hilly/mountainous regions |
|| 🖥️ merging of drone imagery into a final combined image for the project |
|⚙️| 🖥️ automated Digital Elevation Model inclusion (no manual upload required) |
|⚙️| 🖥️ automated uploading of final imagery to OpenAerialMap (+ credit to user that uploads) |
|⚙️| 📱 allow adjustments to the flight plan orientation based on field conditions |
|⚙️| 🖥️ merging of drone imagery into a final combined image for the project |
|⚙️| 🖥️ precise georeferencing of final imagery using Ground Control Points |
| | 📱 capture of imagery at multiple (configurable) angles from the drone camera |
| | 📱 support for more drone models (DJI first, other manufacturers next) |
| | 📱 removing laptop requirement for flight plan upload to drone (via mobile instead) |
| | 🖥️ user access management for each part of the UI |
| | 📱 & 🖥️ real-time updates for drone flight progress |
| | 📱 flight plan generation for other drone manufacturers |
| | 📱 & 🖥️ real-time notifications for drone flight progress & task status |
| | 📱 improved offline capabilities of Drone-TM, reducing reliance on stable internet in the field |
|⚙️| 🖥️ separate workflows for processing individual images vs batch processing in ODM |
| | 🖥️ scaling of ODM imagery processing to hundreds of images in parallel |
| | 🖥️ better usage of 3D model data collected by drones |
| | 📱 HOT community mapping drone: cheap, mapping optimized, materials sourced locally |
<!-- prettier-ignore-end -->
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.vm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,5 @@ services:
- .env
networks:
- dtm-network
entrypoint: ["pdm", "run", "alembic", "upgrade", "head"]
entrypoint: ["uv", "run", "alembic", "upgrade", "head"]
restart: "no"
77 changes: 77 additions & 0 deletions docs/about/faq.md
Original file line number Diff line number Diff line change
@@ -1 +1,78 @@
# ❓ Frequently Asked Questions ❓

# Frequently Asked Questions (FAQ)

## Q. What problem do we solve with DroneTM?

**Enhancing Emergency Response**
We address the need for faster and more precise deployment of drones during
emergencies, enabling improved resource allocation and decision-making
to ensure quicker and more effective crisis management.

**Empowering Local Communities**
We solve the challenge of limited access to real-time aerial data
by equipping local communities with insights that enhance disaster
preparedness, support local initiatives, and enable informed decision-making.

**Optimizing Operational Efficiency**
We tackle inefficiencies in drone operations by streamlining tasking,
reducing manual interventions, and minimizing resource wastage, resulting in cost and time savings.

**Streamlining Access to Drone Data**
We eliminate barriers to accessing drone data by providing a centralized
platform, ensuring critical information is easily available to stakeholders for better decision-making.

---

## Q. How do I get started with DroneTM?

You can contribute to DroneTM in multiple ways:

1. If you have a DJI Mini 4 Pro drone, you can choose nearby projects, capture images, and upload them.
2. If you need drone imagery for your locality, you can create a project with the necessary details.
3. If you're a developer, you can fork the project and contribute
to its development. We encourage starting with tickets labeled as “good first issue.”

---

## Q. What are the outputs I get from DroneTM? Are they raw drone imagery or the processed data like orthophotos and surface models?

Currently, only processed data is available for download. The final outputs include:

- **2D Orthophoto**
- **Digital Terrain Model (DTM)**
- **Digital Surface Model (DSM)**

---

## Q. Do I need an OSM account or need to create a new account to contribute to DroneTM?

No, you don’t need an OSM account. You can simply sign up using your Google account.

---

## Q. What if the project area of my project is large and needs multiple flight operations?

DroneTM divides large project areas into multiple tasks, allowing you to adjust the area per task.
**Note:** The maximum project area allowed is 100 sq. km.

---

## Q. What if my project creation contains no-fly zones?

During project creation, you can specify that the project area includes
no-fly zones. There is a feature to draw these zones on the project map, and the flight plan will exclude any specified no-fly zones.

---

## Q. Can I use any drones to contribute to DroneTM or are there any specifications of drones?

Currently, DroneTM is tested on **DJI Mini 4 Pro**, and flight plans are optimized for its camera specifications.
However, the system is compatible with any DJI drones that support waypoint features, such as:

- **Mavic 3/3P/3C**
- **Air 3/3S**
- **Mini 4 Pro**

Users can also download the **GeoJSON** of the task area, load it into their
drones, and create custom flight plans as per the specifications provided by the project creator.
Binary file added docs/images/diagrams/dtm-gcp-workflow.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions docs/manuals/ground-control-points.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Ground Control Points

Ground Control Points are simply a way of mapping a known coordinate
in the real world (ideally in very accurate coordinates such as
[ECEF](https://en.wikipedia.org/wiki/Earth-centered,_Earth-fixed_coordinate_system)),
to a pixel on an image for georeferencing.

When multiple GCPs are used together in the final stitching of drone flight
imagery together, the final georeferencing should be very accurate.

Further details can be found on the OpenDroneMap
[docs page about GCPs](https://docs.opendronemap.org/gcp)

## Our Workflow

![](../images/diagrams/dtm-gcp-workflow.jpg)
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ nav:
- The Team: about/team.md
- User Manuals:
- Flightplans: manuals/generate-flightplans.md
- Ground Control Points: manuals/ground-control-points.md
- Developer Guide:
- Setup: dev/setup.md
- Timeline: timeline.md
56 changes: 42 additions & 14 deletions src/backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,47 @@ RUN set -ex \
"libgdal-dev" \
&& rm -rf /var/lib/apt/lists/*

# Install PDM
RUN pip install -U pdm
# Disable update check
ENV PDM_CHECK_UPDATE=false

WORKDIR /project

# Install uv
COPY --from=ghcr.io/astral-sh/uv:0.5.2 /uv /bin/uv

# Ensure executables are at the front of the path
ENV PATH="/bin:$PATH"

# - Silence uv complaining about not being able to use hard links,
# - tell uv to byte-compile packages for faster application startups,
# - prevent uv from accidentally downloading isolated Python builds,
# - use a temp dir instead of cache during install,
# - select system python version,
# - declare `/opt/python` as the target for `uv sync` (i.e. instead of .venv).
ENV LANG=en_US.UTF-8 \

Check warning on line 39 in src/backend/Dockerfile

View workflow job for this annotation

GitHub Actions / backend-build / build-image

Variables should be defined before their use

UndefinedVar: Usage of undefined variable '$PYTHON_BASE' More info: https://docs.docker.com/go/dockerfile/rule/undefined-var/
LANGUAGE=en_US:en \
LC_ALL=en_US.UTF-8 \
UV_LINK_MODE=copy \
UV_COMPILE_BYTECODE=1 \
UV_PYTHON_DOWNLOADS=never \
UV_NO_CACHE=1 \
UV_PYTHON="python$PYTHON_BASE" \
UV_PROJECT_ENVIRONMENT=/opt/python
STOPSIGNAL SIGINT

# Copy files needed for building the project
COPY ./pyproject.toml /project/
COPY ./pdm.lock /project/
COPY ./pyproject.toml ./alembic.ini ./uv.lock /project/

# Install dependencies using uv (caching to improve speed for repeated builds)
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
--mount=type=bind,source=uv.lock,target=uv.lock \
uv sync --frozen --no-install-project

# Sync the project again using uv, ensuring all project dependencies are installed
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync

# Install dependencies and project into the local packages directory
RUN pdm install --check --prod --no-editable
# Install the test dependencies using uv
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --group test

# Run stage (final stage)
FROM python:$PYTHON_BASE AS service
Expand All @@ -61,17 +89,17 @@ RUN set -ex \
"libgdal-dev" \
&& rm -rf /var/lib/apt/lists/*

# Retrieve packages from build stage
COPY --from=build /project/.venv/ /project/.venv
# Retrieve global Python packages and dependencies from the build stage
COPY --from=build /opt/python /opt/python

# Set working directory
WORKDIR /project/src/backend

# Set environment PATH
ENV PATH="/project/.venv/bin:$PATH"
ENV PATH="/opt/python/bin:$PATH"

# Install PDM in runtime stage
RUN pip install -U pdm
# Install uv in runtime stage
COPY --from=ghcr.io/astral-sh/uv:0.5.2 /uv /bin/uv

# Copy the source files to the final image
COPY . /project/src/backend
Expand Down
2 changes: 2 additions & 0 deletions src/backend/app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ def assemble_db_connection(cls, v: Optional[str], info: ValidationInfo) -> Any:
S3_BUCKET_NAME: str = "dtm-data"
S3_DOWNLOAD_ROOT: Optional[str] = None

JAXA_AUTH_TOKEN: Optional[str] = ""

ALGORITHM: str = "HS256"
ACCESS_TOKEN_EXPIRE_MINUTES: int = 60 * 60 * 24 * 1 # 1 day
REFRESH_TOKEN_EXPIRE_MINUTES: int = 60 * 60 * 24 * 8 # 8 day
Expand Down
36 changes: 35 additions & 1 deletion src/backend/app/db/db_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
ProjectVisibility,
UserRole,
State,
RegulatorApprovalStatus,
)
from sqlalchemy.orm import (
object_session,
Expand Down Expand Up @@ -137,11 +138,26 @@ class DbProject(Base):
requires_approval_from_manager_for_locking = cast(
bool, Column(Boolean, default=False)
)
requires_approval_from_regulator = cast(bool, Column(Boolean, default=False))
regulator_emails = cast(list, Column(ARRAY(String), nullable=True))
# PROJECT STATUS
status = cast(
ProjectStatus,
Column(Enum(ProjectStatus), default=ProjectStatus.DRAFT, nullable=False),
)
regulator_approval_status = cast(
RegulatorApprovalStatus, Column(Enum(RegulatorApprovalStatus), nullable=True)
)
regulator_comment = cast(str, Column(String, nullable=True))
commenting_regulator_id = cast(
str,
Column(
String,
ForeignKey("users.id", name="fk_projects_commenting_regulator_id"),
nullable=True,
),
)
commenting_regulator = relationship(DbUser, uselist=False, backref="regulator")
visibility = cast(
ProjectVisibility,
Column(
Expand Down Expand Up @@ -291,4 +307,22 @@ class DbUserProfile(Base):
experience_years = cast(int, Column(SmallInteger, nullable=True))
drone_you_own = cast(str, Column(String, nullable=True))
certified_drone_operator = cast(bool, Column(Boolean, default=False))
certificate = cast(bytes, Column(LargeBinary, nullable=True))
certificate_url = cast(str, Column(String, nullable=True))
# drone registration certificate
registration_certificate_url = cast(str, Column(String, nullable=True))


class DbDroneFlightHeight(Base):
"""Describes drone altitude regulations by country."""

__tablename__ = "drone_flight_height"

id = cast(int, Column(Integer, primary_key=True, autoincrement=True))
country = cast(str, Column(String, nullable=False, unique=True))
country_code = cast(
str, Column(String(3), nullable=False)
) # ISO 3166-1 alpha-3 country code
max_altitude_ft = cast(float, Column(Float, nullable=False))
max_altitude_m = cast(float, Column(Float, nullable=False))
created_at = cast(datetime, Column(DateTime, default=timestamp))
updated_at = cast(datetime, Column(DateTime, nullable=True))
32 changes: 32 additions & 0 deletions src/backend/app/drones/drone_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,35 @@ async def read_drone(
dict: The drone record if found.
"""
return drone


@router.get("/drone-altitude/")
async def get_all_altitudes(
db: Annotated[Connection, Depends(database.get_db)],
user_data: Annotated[AuthUser, Depends(login_required)],
):
"""
Retrieves all drone altitude regulations.
"""
altitudes = await drone_schemas.DroneFlightHeight.all(db)
if not altitudes:
return []
return altitudes


@router.get("/drone-altitude/{country}/")
async def get_drone_altitude_by_country(
country: str,
db: Annotated[Connection, Depends(database.get_db)],
user_data: Annotated[AuthUser, Depends(login_required)],
):
"""
Get drone altitude details by country.
"""
result = await drone_schemas.DroneFlightHeight.one(db, country)

if not result:
return []

return result
Loading

0 comments on commit 97e855e

Please sign in to comment.