Skip to content

Commit

Permalink
fix: correct the task area in km2
Browse files Browse the repository at this point in the history
  • Loading branch information
Pradip-p committed Aug 20, 2024
1 parent 6f7e1c8 commit 0c564ae
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/backend/app/projects/project_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ async def get_project_info_by_id(db: Database, project_id: uuid.UUID):
t.outline,
tsc.user_id,
u.name,
ST_Area(ST_Transform(t.outline, 4326)) / 1000000 AS task_area,
ST_Area(ST_Transform(t.outline, 3857)) / 1000000 AS task_area,
COALESCE(tsc.calculated_state, 'UNLOCKED_TO_MAP') AS state
FROM
tasks t
Expand Down
2 changes: 1 addition & 1 deletion src/backend/app/tasks/task_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async def get_tasks_by_user(user_id: str, db: Database, role: str):
query = """SELECT DISTINCT ON (tasks.id)
tasks.id AS task_id,
task_events.project_id AS project_id,
ST_Area(ST_Transform(tasks.outline, 4326)) / 1000000 AS task_area,
ST_Area(ST_Transform(tasks.outline, 3857)) / 1000000 AS task_area,
task_events.created_at,
CASE
WHEN task_events.state = 'REQUEST_FOR_MAPPING' THEN 'request logs'
Expand Down
2 changes: 1 addition & 1 deletion src/backend/app/tasks/task_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async def read_task(
try:
query = """
SELECT
ST_Area(ST_Transform(tasks.outline, 4326)) / 1000000 AS task_area,
ST_Area(ST_Transform(tasks.outline, 3857)) / 1000000 AS task_area,
task_events.created_at,
projects.name AS project_name,
project_task_index,
Expand Down

0 comments on commit 0c564ae

Please sign in to comment.