Opened 13 years ago
Closed 13 years ago
#3742 closed enhancement (fixed)
[PATCH] GDALSuggestedWarpOutput2 more accurate output
Reported by: | bishop | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 1.8.0 |
Component: | Algorithms | Version: | svn-trunk |
Severity: | normal | Keywords: | GDALSuggestedWarpOutput2 |
Cc: |
Description
In GDALSuggestedWarpOutput2 the function only uses 20 points from each side of image. For more accurate suggest of warp output I increase point count. Its worth thinking to provide the step count in parameters (like SAMPLE_STEPS does). This is important while ortocorrecting tiled images without overlaps.
Attachments (2)
Change History (6)
comment:1 by , 13 years ago
Summary: | {PATCH} GDALSuggestedWarpOutput2 more accurate output → [PATCH] GDALSuggestedWarpOutput2 more accurate output |
---|
follow-up: 3 comment:2 by , 13 years ago
comment:3 by , 13 years ago
Unfortunately I have tested this patch on real commerce (single use license) geoeye-1 imagery. The feature of such imagery is that the scene divided on 2Gb tiles without overlaps. Each tile have it's own rpc file. While ortocorrecting with 20 points the result tiles have holes at the junction with the other tiles (about 1-2 pixels wide). I used patched gdal library from my program (not from command line), see http://code.google.com/p/wxgis/ so I have no examples of command line used (but if needed I can provide C++ code of such using). According the "+15" at the end of the line *pnPixels = (int) ((dfMaxXOut - dfMinXOut) / dfPixelSize + 0.5) + 15; - this is my mistake. I have overlapped the incorrect patch with fixed one.
by , 13 years ago
Attachment: | tiles_error.jpg added |
---|
example of error in output image size of two tiles
comment:4 by , 13 years ago
Milestone: | → 1.8.0 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
I've incorporated a variation of your patch with small adjustements into trunk (r20537).
- If memory allocations fail with nSteps > 20, retry with nSteps = 20
- Avoid using the dfRatio as the increment in the for() as it is unreliable. Use iStep instead
- The CPLAssert( nSamplePoints == nSize ); line didn't compile. Replaced by CPLAssert( nSamplePoints == nSampleMax );
Thanks
Do you have a link to source images and the command line used that could show the benefits that the patch brings ? Also, there's a little part of the patch I don't understand : the "+15" at the end of the line *pnPixels = (int) ((dfMaxXOut - dfMinXOut) / dfPixelSize + 0.5) + 15;