Skip to content

Conversation

@HTRamsey
Copy link
Collaborator

Summary

Major refactoring of the geo file handling system with a unified GeoFormatRegistry:

  • GeoFormatRegistry: Central dispatch for all geo format load/save operations with format auto-detection
  • Reorganized helpers: Format-specific subdirectories (KML/, GeoJSON/, GPX/, SHP/, CSV/, WKT/, WKB/, GeoPackage/, OpenAir/)
  • New format support: CSV points, WKT, WKB, GeoPackage, OpenAir airspace files
  • GeoUtilities: Coordinate validation, Douglas-Peucker/Visvalingam-Whyatt simplification, UTM conversion, polygon operations
  • XsdValidator: Schema-based validation for KML and GPX files
  • PlanImporter/PlanExporter: Unified system with format-specific implementations

Bug Fixes

  • Fixed filterMeters parameter propagation in loadFile() to prevent double-filtering
  • Fixed altitude validation test thresholds (50000 → 150000 to exceed kDefaultMaxAltitude)
  • Added QSKIP for schema validation tests when resources unavailable

Test plan

  • All GeoUtilitiesTest tests pass
  • All ShapeTest tests pass (or skip gracefully when schema unavailable)
  • PlanImporter/PlanExporter tests pass
  • Manual testing of geo file import/export in Plan view

Copilot AI review requested due to automatic review settings January 23, 2026 01:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the geo file handling system with a unified GeoFormatRegistry for centralized format detection and dispatching. The refactoring reorganizes format-specific code into subdirectories (KML/, GeoJSON/, GPX/, SHP/, etc.) and adds support for new formats (CSV, WKT, WKB, GeoPackage, OpenAir). A unified PlanImporter/PlanExporter system with format-specific implementations replaces the previous ad-hoc approach.

Changes:

  • Introduced GeoFormatRegistry for centralized format handling and auto-detection
  • Reorganized geo helpers into format-specific subdirectories with consistent interfaces
  • Added PlanImporter/PlanExporter abstraction with singleton implementations per format
  • Fixed filterMeters parameter propagation and altitude validation test thresholds
  • Renamed loadKMLOrSHPFile() to loadShapeFile() for broader format support

Reviewed changes

Copilot reviewed 140 out of 152 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/Utilities/Geo/GeoTest.cc Removed comment explaining tolerance threshold
test/Utilities/Geo/CMakeLists.txt Added GeoUtilitiesTest sources and test resources
test/UnitTestList.cc Registered new test classes (GeoUtilitiesTest, PlanImporter/ExporterTest)
test/MissionManager/QGCMapPolylineTest.cc Updated to use renamed loadShapeFile() method
test/MissionManager/QGCMapPolygonTest.cc Updated to use renamed loadShapeFile() method
test/MissionManager/PlanImporterTest.h New test class for PlanImporter functionality
test/MissionManager/PlanExporterTest.h New test class for PlanExporter functionality
test/MissionManager/CMakeLists.txt Added PlanImporter/ExporterTest sources
src/Utilities/JsonHelper.h Added geoJsonFormat parameter to coordinate array functions
src/Utilities/JsonHelper.cc Implemented GeoJSON coordinate format support
src/Utilities/Geo/XsdValidator.h New base class for XSD-based XML validators
src/Utilities/Geo/XsdValidator.cc Implementation of XSD validator with schema parsing
src/Utilities/Geo/WKB/WKBHelper.h New WKB (Well-Known Binary) format support
src/Utilities/Geo/ShapeFileHelper.* Removed (replaced by GeoFormatRegistry)
src/Utilities/Geo/SHPFileHelper.h Removed (replaced by SHP/SHPHelper)
src/Utilities/Geo/SHP/SHPHelper.h New SHP helper with expanded API
src/Utilities/Geo/OpenAir/OpenAirParser.h New OpenAir airspace format parser
src/Utilities/Geo/KMLSchemaValidator.* Removed (replaced by KML/KMLSchemaValidator)
src/Utilities/Geo/KML/KMLSchemaValidator.* New KML validator extending XsdValidator
src/Utilities/Geo/KML/KMLDomDocument.cc Updated logging category name
src/Utilities/Geo/GeoValidation.* New unified validation result structure
src/Utilities/Geo/GeoPackage/GeoPackageHelper.h New GeoPackage format support
src/Utilities/Geo/GeoJsonHelper.* Removed (replaced by GeoJSON/GeoJsonHelper)
src/Utilities/Geo/GeoJSON/GeoJsonHelper.h New GeoJSON helper with expanded API
src/Utilities/Geo/GeoFileIO.h New file I/O utilities for various formats
src/Utilities/Geo/GPX/GPXSchemaValidator.* New GPX validator extending XsdValidator
src/Utilities/Geo/GPX/GPXHelper.h New GPX format helper
src/Utilities/Geo/CSV/CSVHelper.* New CSV format support
src/Utilities/Geo/CMakeLists.txt Reorganized sources into format subdirectories
src/Settings/AppSettings.h Removed kmlFileExtension and shpFileExtension constants
src/QmlControls/ShapeFileDialog.qml New unified shape file dialog
src/QmlControls/QGCMapPolyline.* Renamed loadKMLOrSHPFile() to loadShapeFile()
src/QmlControls/QGCMapPolygon.* Renamed loadKMLOrSHPFile() to loadShapeFile(), removed KML-specific methods
src/QmlControls/PlanView.qml Updated to use GeoFormatRegistryQml
src/QmlControls/KMLOrSHPFileDialog.qml Updated to use GeoFormatRegistryQml filters
src/QmlControls/CMakeLists.txt Replaced KMLOrSHPFileDialog.qml with ShapeFileDialog.qml
src/MissionManager/TransectStyleComplexItem.* Removed addKMLVisuals() method
src/MissionManager/SurveyComplexItem.* Renamed parameter kmlOrShpFile to shapeFile
src/MissionManager/StructureScanComplexItem.* Renamed parameter kmlOrShpFile to shapeFile
src/MissionManager/PlanShapes/WKT/* New WKT format plan importer/exporter/document
src/MissionManager/PlanShapes/SHP/* New SHP format plan importer/exporter/document
src/MissionManager/PlanShapes/PlanStatistics.* New plan statistics and analysis utility
src/MissionManager/PlanShapes/PlanImporter.* New base class for plan importers with registry
src/MissionManager/PlanShapes/PlanExporter.* New base class for plan exporters with registry
src/MissionManager/PlanShapes/PlanDocument.* New base class for plan document exporters
src/MissionManager/PlanShapes/OpenAir/* New OpenAir format plan importer
src/MissionManager/PlanShapes/KML/* New KML/KMZ plan importer/exporter/document
src/MissionManager/PlanShapes/GeoPackage/* New GeoPackage plan importer/exporter/document
src/MissionManager/PlanShapes/GeoJSON/* New GeoJSON plan importer/exporter/document
src/MissionManager/PlanShapes/GeoFormatPlanImporter.* New generic plan importer using GeoFormatRegistry
src/MissionManager/PlanShapes/GPX/* New GPX plan importer/exporter/document
src/MissionManager/PlanShapes/CSV/* New CSV plan importer/exporter/document
src/MissionManager/PlanMasterController.* Replaced saveToKml() with exportToFile(), updated API
src/MissionManager/MissionController.* Removed addMissionToKML(), added export-oriented methods
src/MissionManager/CorridorScanComplexItem.* Renamed parameter kmlOrShpFile to shapeFile
src/MissionManager/ComplexMissionItem.* Removed addKMLVisuals() method
src/MissionManager/CMakeLists.txt Added all PlanShapes sources with format subdirectories
src/FlightMap/MapItems/QGCMapPolylineVisuals.qml Updated to use ShapeFileDialog
src/FlightMap/MapItems/QGCMapPolygonVisuals.qml Updated to use ShapeFileDialog

@github-actions
Copy link
Contributor

github-actions bot commented Jan 23, 2026

Build Results

Platform Status

Platform Status Details
Linux Passed View
Windows Passed View
MacOS Passed View
Android Passed View

All builds passed.

Test Results

linux_gcc_64: 691 passed, 1 skipped

Total: 691 passed, 1 skipped

Code Coverage

Coverage: 100.0%

No baseline available for comparison

Artifact Sizes

Artifact Size
QGroundControl-aarch64.AppImage 187.31 MB
QGroundControl-installer-AMD64-ARM64.exe 74.61 MB
QGroundControl-installer-AMD64.exe 162.49 MB
QGroundControl-installer-ARM64.exe 75.42 MB
QGroundControl-mac.apk 163.31 MB
QGroundControl-windows.apk 163.28 MB
QGroundControl-x86_64.AppImage 175.15 MB
QGroundControl.apk 319.94 MB
QGroundControl.dmg 311.72 MB

No baseline available for comparison

Updated: 2026-01-23 05:20:15 UTC • Triggered by: MacOS

Major refactoring of geo file handling with a unified GeoFormatRegistry:

- Add GeoFormatRegistry as central dispatch for all geo format operations
- Reorganize helpers into format-specific subdirectories (KML/, GeoJSON/, GPX/, SHP/, etc.)
- Add new format support: CSV points, WKT, WKB, GeoPackage, OpenAir airspace
- Add GeoUtilities with coordinate validation, simplification algorithms, UTM conversion
- Add XsdValidator for schema-based KML/GPX validation
- Add comprehensive PlanImporter/PlanExporter system with format-specific implementations
- Fix filterMeters parameter propagation in loadFile() to prevent double-filtering
- Add QSKIP for schema validation tests when resources unavailable
- Update altitude validation tests to use correct threshold values
- Add extensive unit tests for all geo formats and utilities
@HTRamsey HTRamsey force-pushed the feature/geo-format-registry-refactor branch from 0a275a9 to d8fb513 Compare January 23, 2026 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant