feat(KMLExport): implement KML export and metadata mapping for geo questions DEV-1592 DEV-1593#348
Merged
Conversation
…, and KPI-style metadata display
There was a problem hiding this comment.
Pull request overview
Adds first-class KML export support for geo questions by converting existing GeoJSON exports into Google Earth-compatible KML, enriching placemarks with survey instance descriptions and GeoJSON properties in ExtendedData.
Changes:
- Implement
Export.to_kml()usinggeojson2kml, including namespace normalization and post-processing of the produced KML. - Add KML placemark metadata mapping (description +
ExtendedData) and point icon styling. - Add test coverage for KML output structure and metadata mapping; register
kmlas a valid export type and addgeojson2kmldependency.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/test_exports.py | Adds tests asserting KML geometry presence, description formatting, and ExtendedData property mapping. |
| src/formpack/reporting/export.py | Implements KML export pipeline and KML XML post-processing (metadata + styling). |
| src/formpack/constants.py | Adds EXPORT_TYPE_KML and includes it in VALID_EXPORT_TYPES. |
| setup.py | Adds geojson2kml as an install requirement. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📣 Summary
Formpack now supports KML export for geo questions, with Google Earth compatible output.
📖 Description
Projects with geo questions can now be exported to KML from Formpack, including points, lines, and polygons in one export.
The generated KML uses a Google Earth-compatible namespace and displays each feature with a simple
Survey Instance: <uuid>description to match KPI behavior. All GeoJSON feature properties are also preserved in KMLExtendedDatafor structured metadata access.👀 Preview steps
python
Export.to_kml()method:preview_to_kml_all_geo_types.kmlSurvey Instance: <uuid>ExtendedDataincludes GeoJSON properties