Opened 16 years ago

Closed 15 years ago

#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 Mateusz Łoskot)

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 (4)

comment:1 by Even Rouault, 16 years ago

If you hit the special case of that "if", it should mean that you have an image with meridian 180° in the middle of it. The 360 shift to the upper and lower right longitudes is supposed to avoid that they are negative. It is preferable in many applications that they are a bit above 180° rather than negative.

Can you provide more info on the expected georeferencing of your image ?

comment:2 by Even Rouault, 16 years ago

jdfergason, any news on that topic ?

comment:3 by Mateusz Łoskot, 16 years ago

Description: modified (diff)

comment:4 by warmerdam, 15 years ago

Resolution: worksforme
Status: newclosed

jdfergason,

I'm closing now for lack of followup. If you can provide more information please just reopen this ticket.

Thanks.

Note: See TracTickets for help on using tickets.