Skip to content

Conversation

jayneel-shah18
Copy link
Contributor

This PR introduces a comprehensive regression test suite for the i.rectify module in GRASS. The tests cover the core rectification workflows, including affine and polynomial transformations, flag-specific behaviors, and region/resolution control.

Tests Included

  • test_affine_rectification

    • Verifies a first-order (affine) polynomial transformation using cubic interpolation.
    • Ensures that spatial transformation and pixel values remain consistent with expected statistics.
  • test_polynomial_order2_rectification

    • Validates 2nd-order polynomial transformation using linear interpolation.
    • Tests numerical stability and interpolation accuracy when extending beyond affine geometry.
  • test_polynomial_order3_rectification

    • Verifies 3rd-order polynomial transformation with lanczos interpolation.
    • Demonstrates support for higher-order models and tests precision of the resampling algorithm.
  • test_region_restriction

    • Tests the -c flag which restricts the output to the current computational region.
    • Confirms geographic extents of rectified rasters match the region bounds (via r.info).
  • test_c_flag_with_resolution_override

    • Ensures that the -c flag takes precedence over the resolution= parameter.
    • Validates that output resolution aligns with the region and not the explicit input.
  • test_automatic_rectification

    • Uses the -a flag to automatically rectify all maps in the group.
    • Confirms multi-raster handling and that results match expected statistical summaries.
  • test_thin_plate_spline

    • Tests -t flag for thin plate spline (TPS) interpolation.
    • TPS is nonlinear and sensitive to control point configuration; this test validates the transformation correctness.
  • test_resolution_parameter

    • Verifies the resolution= parameter sets the desired output resolution when -c is not used.
    • Ensures output maps honor the specified resolution and dimensions.

The suite validates correctness using raster inputs and univariate statistics on rectified outputs. Looking forward to feedback and improvements!

@github-actions github-actions bot added Python Related code is in Python module imagery tests Related to Test Suite labels Jun 20, 2025
@petrasovaa petrasovaa enabled auto-merge (squash) June 24, 2025 20:55
@petrasovaa petrasovaa merged commit 5e35191 into OSGeo:main Jun 24, 2025
27 checks passed
@github-actions github-actions bot added this to the 8.5.0 milestone Jun 24, 2025
@jayneel-shah18 jayneel-shah18 deleted the test_i_rectify_tests branch June 25, 2025 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
imagery module Python Related code is in Python tests Related to Test Suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants