Cool, thanks for your feedback. I could also test it successfully with GeoGenesis LITE that visibly takes into account the GEOLOB & GEOPSB TRE when available.
I've commited the changes in trunk in r20708 with minor variations (comments, and so on). The only change that you'd notice is that I renamed the creation option to be SDE_TRE, so that in the future it can be also used to write MAPLOB & PRJPSB TRE in case of projected SRS. Le mardi 28 septembre 2010 17:41:35, Frank Evans a écrit : > Even, I downloaded and compiled the GDAL trunk, then added your changes. It > worked perfectly. See the attached screenshot. > > gdal_translate -of NITF -co WRITE_GEOLOB=YES -co \ > BLOCKXSIZE=1024 -co BLOCKYSIZE=1024 \ > foo.tif foo.ntf > > I'm actually working against an older release (1.7), so I'll need to do a > little merging, but things are looking very good. > > I'm very grateful for your help. Is there any other information I can > provide? > > > --- On Sun, 9/26/10, Frank Evans <frankhev...@yahoo.com> wrote: > > From: Frank Evans <frankhev...@yahoo.com> > Subject: Re: [gdal-dev] Re: NITF driver reads GEOLOB, but does not write > it. To: "Even Rouault" <even.roua...@mines-paris.org> > Date: Sunday, September 26, 2010, 2:18 PM > > In the case of Global Mapper I might not have been clear. > > Global Mapper Summary > Even though GlobalMapper does not use GEOLOB, specifying the GEOLOB "broke" > the NITF for GlobalMapper because it changed the IGEOLO to Decimal > Degrees, GlobalMapper didn't complain. But it registered the image in the > wrong location (way wrong). > > After I applied the change you suggested, GlobalMapper was able to read the > IGEOLO. But you are right, it probably ignores the GEOLOB. > > ERDAS Summary (version 10) > Like GlobalMapper, ERDAS also chokes unless ICORDS='G'If you add the GEOLOB > and set ICORDS='G', ERDAS will read the NITF but you don't get the > accuracy.If you add the GEOLOB, and add the GEOPSB, and also specify > ICORDS='G', then you get submeter accuracy which lines up with the > original image. > > I wrote the GEOPSB as a TRE, not as a FILE_TRE. I will try FILE_TRE, and > let you know. I will definitely test the patch. Thanks very much.... > > > > > > --- On Sun, 9/26/10, Even Rouault <even.roua...@mines-paris.org> wrote: > > From: Even Rouault <even.roua...@mines-paris.org> > Subject: Re: [gdal-dev] Re: NITF driver reads GEOLOB, but does not write > it. To: "turtlewax" <frankhev...@yahoo.com> > Date: Sunday, September 26, 2010, 1:34 PM > > Hi, > > Which Global Mapper version did you try ? I tried with v11 and v12 > (evaluation) versions and they don't appear to read GEOPSB and/or GEOLOB at > all (for the sake of testing, I applied a big shift in the longitudes of > the IGEOLO field to be sure to > distinguish if GEOLOB was used (1)), so I'm > surprised by your report. Are you really sure that GEOLOB was used ? > > I have not access to ERDAS software to test neither. > > By the way, when reading the specs, to be valid, the GEOPSB TRE must be > written as a file header TRE (FILE_TRE=xxxx creation option in GDAL), and > not as a image header TRE (TRE=xxxx creation option in GDAL). Which one > did you use ? > > I've attached a patch against latest SVN trunk (and the archive of the > frmts/nitf directory) with all the that writes the GEOLOB and GEOPSB TRE > from the georeferencing info, provided that you specify the > WRITE_GEOLOB=YES creation option. Would you mind testing it and reporting > if it works with the other software ? > > Best regards, > > Even > > (1) You can do that for example by adding the following lines at the > beginning of NITFWriteIGEOLO() in nitfimage.c > > dfULX += > 100; > dfURX += 100; > dfLRX += 100; > dfLLX += 100; > > Le samedi 25 septembre 2010 23:41:22, turtlewax a écrit : > > Thanks, you were right on both counts. > > 1. Code change in nitfimage.c fixed the ERDAS/Global Mapper error. > > 2. To get the improved accuracy I did have to specify the GEOPSB TRE as > > well. > > > > To make this work in mapserver I'll need to do something like the > > following, but that means the OUTPUTFORMAT will be specific to each > > raster/layer, so a mapfile can only contain a single layer. > > > > OUTPUTFORMAT > > NAME NITF > > DRIVER "GDAL/NITF" > > IMAGEMODE RGB > > MIMETYPE "image/nitf" > > EXTENSION "ntf" > > #The following option needs to be > > specific to each layer > > > FORMATOPTION > > > > "TRE=GEOLOB=073932800080076800-136.9774560321+045.1446198929" > > > > END _______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev