Ticket #2527 (closed defect: worksforme)
Some georeferencing fails for some images from NGA
| Reported by: | jdfergason | Owned by: | warmerdam |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | GDAL_Raster | Version: | 1.5.0 |
| Severity: | normal | Keywords: | |
| Cc: |
Description (last modified by mloskot) (diff)
In nitfimage.c there is little bit of code that appears to break georeferencing for *SOME* files from NGA. Basically the georeference shows up way off target. Older versions of GDAL (1.3.0 and back) do not have this issue and I tracked the culprit down to bug fix #1750 in nitfimage.c When I remove this bit of code it works just fine for all the files that I have. The code I removed is listed below.
/* Bug #1750 */
/* Fix for cjnc/cjncz01/000k1023.jn1 (and similar) from NIMA GNCJNCN CDROM: */
/* this product is crossing meridian 180deg and the upper and lower right longitudes are negative (<-170) */
/* while the upper and lower left longitudes are positive (> 170) which causes problems in OpenEV, etc... */
/* So we are adjusting the upper and lower right longitudes by setting them above +180 */
if( (psImage->chICORDS == 'G' || psImage->chICORDS == 'D') &&
(psImage->dfULX > 170 && psImage->dfLLX > 170 && psImage->dfURX < -170 && psImage->dfLRX < -170 &&
psImage->dfULY > psImage->dfLLY && psImage->dfURY > psImage->dfLRY) )
{
psImage->dfURX += 360;
psImage->dfLRX += 360;
}
Change History
Note: See
TracTickets for help on using
tickets.
