Skip to content

[codex] Speed up ImageLayer reprojection assembly#2978

Draft
jasonbeverage wants to merge 1 commit into
masterfrom
codex/image-layer-reprojection-fast-path
Draft

[codex] Speed up ImageLayer reprojection assembly#2978
jasonbeverage wants to merge 1 commit into
masterfrom
codex/image-layer-reprojection-fast-path

Conversation

@jasonbeverage

Copy link
Copy Markdown
Member

Summary

This speeds up ImageLayer::assembleImage when assembling imagery across coordinate systems by reducing how many output pixels need full coordinate reprojection before sampling source images.

For Mercator/geographic pairs, the transform is separable, so the code now transforms the horizontal axis endpoints and one vertical sample per row, then fills the output coordinate grid from those values. Other non-equivalent SRS pairs use a small interpolation mesh instead of per-pixel coordinate transforms, with exact fallback when interpolation is not appropriate or when a transform fails.

Coverage layers no longer force the exact coordinate-transform path; coverage behavior remains controlled by nearest-neighbor pixel sampling.

Validation

  • build.bat
  • cmd /c "call osgearth_shell.bat && cd tests && osgearth_tests"
    • 33105 assertions in 33 test cases
  • cmd /c "call osgearth_shell.bat && cd tests && osgearth_benchmarks --benchmark_filter=ImageLayerAssembleImage_Reproject --benchmark_min_time=0.5s"
    • Before: 6.67 ms real / 6.77 ms CPU
    • After: 2.13 ms real / 2.10 ms CPU

Notes

Added a focused benchmark for reprojection assembly and a regression test comparing the optimized path against exact per-pixel coordinate transforms for both imagery and coverage sampling.

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.

1 participant