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

Extract additional geometries into submission geojson featurecollection #2197

Merged
merged 12 commits into from
Feb 17, 2025

Conversation

spwoodcock
Copy link
Member

What type of PR is this? (check all applicable)

  • πŸ• Feature
  • πŸ› Bug Fix
  • πŸ“ Documentation
  • πŸ§‘β€πŸ’» Refactor
  • βœ… Test
  • πŸ€– Build or CI
  • ❓ Other (please specify)

Related Issue

Related to #2165

Describe this PR

  • I refactored the submission download endpoint to be a single endpoint, with option csv, json, or geojson.
  • When downloading geojson, I also extract the additional geometry fields (that should always end in _geom as a Feature in the final FeatureCollection).
  • The extra feature is like this:
{"type": "Feature", "id": "65bfe40a-df0f-4f51-9257-e341c9515b87", "geometry": {"type": "Point", "coordinates": [85.302801, 27.712952]}, "properties": {"is_additional_geom": true, "id_field": "kathmandu_point_extract", "geom_field": "kathmandu_point_extract_geom"}}]}
  • As you can see:
    • The "id" field is the entity id.
    • The "is_additional_geom": true property is set.
    • The "id_field" property is set to the submission json field that contained the ID (where the entity list name is also kathmandu_point_extract in this case.
    • The "geom_field" property is set to the submission json field that contained the geometry (javarosa string).

Review Guide

  • Create a new submission for a project with additional datasets.
  • Select the additional entity during submission.
  • Extract a submission geojson and display in QGIS (it will likely have mixed geom: Polygon + Point).

Checklist before requesting a review

[optional] What gif best describes this PR or how it makes you feel?

@spwoodcock spwoodcock self-assigned this Feb 14, 2025
@github-actions github-actions bot added enhancement New feature or request frontend Related to frontend code backend Related to backend code tests Related to automated code tests contrib External contributions, or not related to core functionality labels Feb 14, 2025
@NSUWAL123 NSUWAL123 merged commit 816ec81 into development Feb 17, 2025
9 checks passed
@NSUWAL123 NSUWAL123 deleted the feat/submission-javarosa-to-geojson branch February 17, 2025 03:37
@NSUWAL123
Copy link
Contributor

Mistakenly merged it to development. Sujan and I reviewed the code, and it looked good.

@spwoodcock
Copy link
Member Author

Anyone in the team can merge, not just me, don't worry πŸ˜‰

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Related to backend code contrib External contributions, or not related to core functionality enhancement New feature or request frontend Related to frontend code tests Related to automated code tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants