Matthew , Basically, you need to specify 2 creation options to allow georeferencing information and color table to be written. This 2 creation options allocate the necessary space in the header of the NITF file so they can be later overriden.
Try: gdalwarp run.tiff -of nitf run1.nitf -co ICORDS=G -co IREP=RGB/LUT For complete reference, look at http://gdal.org/frmt_nitf.html, especially the "Creation Issues" part. Best regards, Evn Le Wednesday 24 June 2009 10:06:06 Matthew Golczak, vous avez écrit : > Hi Frank, > Thank you very much for your suggestion. I've followed your idea with > success . I've got nitif file with geo-spatial references but gdalwarp > during execution was not entirely happy please see output dump. gdalwarp > run.tiff -of nitf run1.nitf > Copying color table from run1linux.tiff to new file. > Creating output file that is 12595P x 1851L. > ERROR 6: NITF file should have been created with creation option > 'ICOORDS=G'. > > ERROR 6: Apparently no space reserved for IGEOLO info in NITF file. > NITFWriteIGEOGLO() fails. > ERROR 1: Unable to write all 256 LUT entries, only able to write 0. > Processing input file run1linux.tiff. > 0...10...20...30...40...50...60...70...80...90...100 - done. > I'm not sure that those two errors are critical especially that I have got > nitif image which is correctly displayed by openev and ESRI tools. In this > circumstance could you comment those errors and advice me what needs to be > done to eliminate those errors? Thank you very much for your advice . > > regards > > Maciek > > --- On Tue, 6/23/09, Frank Warmerdam <warmer...@pobox.com> wrote: > > From: Frank Warmerdam <warmer...@pobox.com> > > Subject: Re: [gdal-dev] gdal_translate help > > To: "Matthew Golczak" <mgolc...@yahoo.com> > > Cc: gdal-dev@lists.osgeo.org > > Date: Tuesday, June 23, 2009, 4:37 PM > > > > Matthew Golczak wrote: > > > Hello, I’m new to gdal concept and I’ll appreciate > > > > if you could help me. I’m > > > > > trying to use gdal_translate to geo-referencing aerial > > > > images but with > > > > > limited success so far. The image is generated as gif > > > > file plus > > > > > information about geo-location of each corner. Due to > > > > the fact that the > > > > > corner geo-location is calculated based on GPS, the > > > > datum and projection is > > > > > specified as EPSG:4326. The following translation > > > > works very well for me gdal_translate -of GTiff -a_srs > > EPSG:4326 -gcp 0 0 138.792939 -34.721669 > > > > > -gcp 1784 0 138.791485 -34.753698 -gcp 0 12515 > > > > 138.519595 -34.713290 -gcp > > > > > 1784 12515 138.518036 -34.745320 run.gif > > > > run.tiff but I need also this > > > > > image in nitif format so I have tried the > > > > following translation gdal_translate -of nitf run1tiff > > run.nitf. Unfortunately in this case > > > > > nitif file has not any geospatial references. > > > > The gdalinof in regards to > > > > > tiff contains geospatial information and none in > > > > respect to nitif. It seems > > > > > to me that is something wrong but what? Any support in > > > > this matter highly > > > > > appreciated. > > > > Maciek, > > > > The GDAL NITF driver does not support writing GCPs in NITF > > format. In fact, > > I'm not aware of a general mechanism for storing GCPs in > > NITF format. I > > think you will need to georeference it using affine > > georeferencing. If > > the image is not north up, you may need to rectify the > > image first with > > gdalwarp. In fact gdalwarp can write directly to nitf > > format so perhaps > > you could do: > > > > eg. > > > > gdalwarp run.tiff -of NITF run.nitf > > > > Best regards, > > -- > > ---------------------------------------+--------------------------------- > >----- I set the clouds in motion - turn up | > > Frank Warmerdam, warmer...@pobox.com > > light and sound - activate the windows | http://pobox.com/~warmerdam > > and watch the world go round - Rush | > > Geospatial Programmer for Rent > > _______________________________________________ > gdal-dev mailing list > gdal-dev@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/gdal-dev _______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev