[BUG] Priority area setting does not handle KML's altitude dimension in geometry field
ramyaragupathy opened this issue · 2 comments
Describe the bug
Raised by @frozenrabi through slack for project 16736
While updating a project's priority area using a KML file, file uploaded succeeded. However project save fails with an unknown error.
To Reproduce
Steps to reproduce the behavior:
- Go to any project's edit section
- Click on
priority areas
from the edit section - Choose to select a file
- Upload the KML file
- KML file data loads fine on map view
- Now attempt to save the project. This fails with a server error
- From server logs noticed this message
psycopg2.errors.InvalidParameterValue: Geometry has Z dimension but column does not
Example file from @frozenrabi : https://drive.google.com/file/d/1dOcN41-NEePePC9BbyhOgS9sT09T5HnI/view?usp=sharing
Expected behavior
Priority areas should get updated for the project. Or if there is some error in the file it has to be indicated via an useful error message.
Additional context
Several applications like geojson.io, kepler.gl handles such files without any error messages. Even mapbox gl JS which we use for visualisation ignores the third field. I would recommend our application to ignore the third field and go ahead store the geometry in the backend.
@kaditya97 @royallsilwallz @manjitapandey @prabinoid @varun2948 @frozenrabi
Also tagging @kshitijrajsharma for his inputs.
Sentry Issue: TASKINGMANAGER-BACKEND-399
From discussion w/ @prabinoid - i think removing the third dimension in geometry should be handled by the frontend as the uploaded data has to be showcased for the end user. This data that's cleaned up by the frontend can be then passed on to the backend for DB storage.
@royallsilwallz - please add your comments.