Skip to content

Modern GDAL Integration for MapWinGIS6 - #6

Merged
pmeems merged 3 commits into
developmentfrom
phase-2-typed-apis
Oct 25, 2026
Merged

pmeems merged 3 commits into
developmentfrom
phase-2-typed-apis

Conversation

@pmeems

@pmeems pmeems commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Introduce strongly typed options and ToArgs() conversions for the ten prioritized GDAL raster and vector algorithms, validating them through GDAL 3.12 argument metadata. The wrappers use GDAL’s actual option names and value types; unsupported legacy raster-convert flags and raster-reproject template input are omitted. No dependencies were added.

Tests cover metadata-recognized arguments, validation with real raster/vector fixtures, a successful raster conversion, and invalid options. CI passes the full Debug x64 build and test suite.

- Add ToArgs structures for the ten prioritized raster and vector algorithms.

- Validate typed values through GDAL argument metadata and structured errors.

- Add metadata, validation, and raster conversion tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The conflict test can pass on an unrelated missing-input failure, and an unused helper conflicts with the warning-clean requirement.

2 open issues
What changed in this PR

Adds typed options for ten prioritized GDAL raster and vector algorithms, integrating argument conversion and validation with the existing algorithm runner.

Changes:

  • Introduces option structures and ToArgs() conversions using GDAL argument names and types.
  • Extends the runner with integer-list arguments and explicit validation.
  • Adds metadata, fixture-based validation, raster conversion, and invalid-option tests.

Builds and tests were not run during this review.

File Description
tests/​MapWinGIS.Core.Tests/​MapWinGIS.Core.Tests.vcxproj Registers the typed-options tests.
tests/​MapWinGIS.Core.Tests/​GdalTypedOptionsTests.cpp Tests option mappings, validation, and raster conversion.
src/​MwGdalCore/​MwGdalCore.vcxproj Registers typed-options sources and the internal include path.
src/​MwGdalCore/​GdalTypedOptions.cpp Implements argument conversion and configuration.
src/​MwGdalCore/​GdalAlgorithmRunner.cpp Adds integer-list setters and argument validation.
src/​MapWinGIS.Core/​MapWinGIS.Core.vcxproj Registers the public typed-options header.
src/​MapWinGIS.Core/​include/​mapwingis/​gdal/​GdalTypedOptions.h Declares option structures for ten algorithms.
src/​MapWinGIS.Core/​include/​mapwingis/​gdal/​GdalAlgorithmRunner.h Exposes the new runner methods.

Review effort: Balanced

Comment thread src/MwGdalCore/GdalTypedOptions.cpp Resolved
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@pmeems pmeems left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Two non-blocking recommendations from my review:

  1. Broaden behavioral execution tests. The current tests provide useful coverage for metadata-recognized argument names/types and include a successful raster conversion. Please consider adding end-to-end execution tests for representative vector operations, raster clipping, reprojection, and mosaicking, asserting the generated output and key properties. These would catch option-mapping or argument-combination issues that metadata validation alone cannot detect.

  2. Expand public API documentation in GdalTypedOptions.h. Please document required inputs, the meaning of unset optional fields/default behavior, and any relevant error/exception and thread-safety guarantees for the option structs and ToArgs() methods. This would bring the new public API closer to the expectations in docs/CODING-STANDARDS.md.

These are follow-up quality improvements, not confirmed defects; I found no blocking functional issue in the reviewed changes.

Add output round-trip tests for vector conversion and clipping, raster clipping, reprojection, and mosaicking. Document required inputs, omitted values, conversion errors, and thread safety.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pmeems

pmeems commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

Addressed both recommendations from #6 (review) in 8731c10.

Added five execution tests for vector conversion, vector clipping, raster clipping, reprojection, and mosaicking. Each test closes the runner and reopens the generated output. Assertions cover feature counts, attributes, clipped geometry areas and extents, coordinate reference systems, raster dimensions, geotransforms, pixel values, compression, and nodata where applicable. The georeferenced raster fixture now lives in the shared TestData helpers.

Expanded GdalTypedOptions.h with required inputs and selector constraints for each struct. The shared conversion contract and ToArgs() references document omitted values and GDAL defaults, ownership, validation boundaries, exceptions, thread safety, and conversion cost. ConfigureGdalAlgorithm() also documents partial application and error reporting.

The Debug x64 CI build and all 95 tests passed: https://github.com/MapWindow/MapWinGIS6/actions/runs/40206393593. No public API signatures or algorithm behavior changed.

@pmeems
pmeems merged commit 27be16b into development Oct 25, 2026
1 check passed
@pmeems
pmeems deleted the phase-2-typed-apis branch October 25, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants