Skip to content

Commit

Permalink
fix: slove merge conflict with main
Browse files Browse the repository at this point in the history
  • Loading branch information
Pradip-p committed Dec 20, 2024
2 parents 7d8de9f + 93c126c commit 703fe74
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ SITE_NAME=${SITE_NAME:-"DTM-Drone Tasking Manager"}
BASE_URL=${BASE_URL:-http://localhost:8000/api}
API_URL_V1=${API_URL_V1:-http://localhost:8000/api}
NODE_ODM_URL=${NODE_ODM_URL:-http://odm-api:3000}
COG_URL=${COG_URL:-"http://localhost:9090/api/v1/buckets/dtm-data/objects/download?prefix="}
COG_URL=${COG_URL}


### ODM ###
Expand Down
18 changes: 18 additions & 0 deletions src/backend/app/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,3 +213,21 @@ def get_object_metadata(bucket_name: str, object_name: str):
"""
client = s3_client()
return client.stat_object(bucket_name, object_name)


def get_cog_path(bucket_name: str, project_id: str, task_id: str):
"""Generate the presigned URL for a COG file in an S3 bucket.
Args:
bucket_name (str): The name of the S3 bucket.
project_id (str): The unique project identifier.
orthophoto_name (str): The name of the COG file.
Returns:
str: The presigned URL to access the COG file.
"""
# Construct the S3 path for the COG file
s3_path = f"dtm-data/projects/{project_id}/{task_id}/orthophoto/odm_orthophoto.tif"

# Get the presigned URL
return get_presigned_url(bucket_name, s3_path)

0 comments on commit 703fe74

Please sign in to comment.