Skip to content

Commit

Permalink
Merge branch 'master' of github.com:OSGeo/gdal
Browse files Browse the repository at this point in the history
* 'master' of github.com:OSGeo/gdal:
  gdalasyncread.cpp: add missing .h to gdal_version include. (OSGeo#3951)
  GMLJP2v2 writing: fix axis order issue for gml:Envelope (fixes OSGeo#3866)
  gdaljp2metadata.cpp: use std::swap(). no functional change
  NITF: add PROFILE=NPJE_VISUALLY_LOSSLESS/NPJE_NUMERICALLY_LOSSLESS with JP2OpenJPEG driver
  nitf.py: whitespace fixing
  Doc: rename GDAL Advisory Board to GDAL Advisory Council
  JP2OpenJPEG: add a TLM=YES creation option
  • Loading branch information
a0x8o committed Jun 10, 2022
1 parent 862b49e commit 49a7c73
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 0 deletions.
11 changes: 11 additions & 0 deletions autotest/gdrivers/jp2openjpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -2992,7 +2992,11 @@ def test_jp2openjpeg_tilesize_16():

def test_jp2openjpeg_generate_PLT():

<<<<<<< HEAD
# Only try the test with openjpeg >= 2.4.0 that supports it
=======
# Only try the rest with openjpeg >= 2.4.0 that supports it
>>>>>>> 33d99249ed (Merge branch 'master' of github.com:OSGeo/gdal)
if gdaltest.jp2openjpeg_drv.GetMetadataItem('DMD_CREATIONOPTIONLIST').find('PLT') < 0:
pytest.skip()

Expand All @@ -3019,7 +3023,11 @@ def test_jp2openjpeg_generate_PLT():

def test_jp2openjpeg_generate_TLM():

<<<<<<< HEAD
# Only try the test with openjpeg >= 2.5.0 that supports it
=======
# Only try the rest with openjpeg >= 2.5.0 that supports it
>>>>>>> 33d99249ed (Merge branch 'master' of github.com:OSGeo/gdal)
if gdaltest.jp2openjpeg_drv.GetMetadataItem('DMD_CREATIONOPTIONLIST').find('TLM') < 0:
pytest.skip()

Expand All @@ -3039,6 +3047,7 @@ def test_jp2openjpeg_generate_TLM():

gdaltest.jp2openjpeg_drv.Delete(filename)

<<<<<<< HEAD


###############################################################################
Expand All @@ -3062,3 +3071,5 @@ def test_jp2openjpeg_STRICT_NO():
with gdaltest.error_handler():
assert ds.GetRasterBand(1).Checksum() == 5058
ds = None
=======
>>>>>>> 33d99249ed (Merge branch 'master' of github.com:OSGeo/gdal)
4 changes: 4 additions & 0 deletions doc/source/development/rfc/rfc80_numfocus_relationship.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ Author: Even Rouault (with content from Chris Holmes)
Contact: even.rouault @ spatialys.com
Started: 2021-Apr-15
<<<<<<< HEAD:doc/source/development/rfc/rfc80_numfocus_relationship.rst
<<<<<<< HEAD:doc/source/development/rfc/rfc80_numfocus_relationship.rst
Last modified: 2021-Jun-07
=======
>>>>>>> 98488c2119 (Merge pull request #3837 from bjornharrtell/fgb-flatbuffers-2.0):gdal/doc/source/development/rfc/rfc80_numfocus_relationship.rst
=======
Last modified: 2021-Jun-07
>>>>>>> 33d99249ed (Merge branch 'master' of github.com:OSGeo/gdal):gdal/doc/source/development/rfc/rfc80_numfocus_relationship.rst
Status: Adopted
============== =============================================

Expand Down
14 changes: 14 additions & 0 deletions doc/source/drivers/raster/nitf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ Creation Options:
- C8 means JPEG2000 compression (one block) and is available for
CreateCopy() and/or Create() methods. See below paragraph for specificities.

<<<<<<< HEAD:doc/source/drivers/raster/nitf.rst
- **NUMI=n** : Number of images. Default = 1.
See :ref:`Advanced GDAL NITF Driver Information <raster.nitf_advanced>` for
the procedure to follow to write several images in a NITF file.
Expand All @@ -105,6 +106,10 @@ Creation Options:
When WRITE_ALL_IMAGES=YES, the space for all images is allocated, which is
only compatible with IC=NC (uncompressed images).
(Behavior with GDAL < 3.4 was similar to WRITE_ALL_IMAGES=YES)
=======
- **NUMI=n** : Number of images. Default =
1. This option is only compatible with IC=NC (uncompressed images).
>>>>>>> 33d99249ed (Merge branch 'master' of github.com:OSGeo/gdal):gdal/doc/source/drivers/raster/nitf.rst
- **ICORDS=G/D/N/S**: Set to "G" to ensure that space will be reserved
for geographic corner coordinates (in DMS) to be set later via
SetGeoTransform(), set to "D" for geographic coordinates in decimal
Expand Down Expand Up @@ -183,7 +188,11 @@ JPEG2000 compression (write support)

JPEG2000 compression is available when using the IC=C8 creation option,
if the JP2ECW (SDK 3.3, or for later versions assuming the user has the key to
<<<<<<< HEAD:doc/source/drivers/raster/nitf.rst
enable JPEG2000 writing), JP2KAK or JP2OpenJPEG driver are available.
=======
enable JPEG2000 writing), JP2KAK, JP2OpenJPEG or Jasper driver are available.
>>>>>>> 33d99249ed (Merge branch 'master' of github.com:OSGeo/gdal):gdal/doc/source/drivers/raster/nitf.rst

They are tried in that order when several ones are available, unless the
JPEG2000_DRIVER creation option (added in GDAL 3.4) is set to explicitly specify
Expand Down Expand Up @@ -213,6 +222,11 @@ the JPEG2000 capable driver to use.
When those profiles are specified, the J2KLRA TRE will also be written, unless
the J2KLRA=NO creation option is specified.

<<<<<<< HEAD:doc/source/drivers/raster/nitf.rst
=======
- Jasper JPEG2000 driver: only in the CreateCopy() case.

>>>>>>> 33d99249ed (Merge branch 'master' of github.com:OSGeo/gdal):gdal/doc/source/drivers/raster/nitf.rst
Links
-----

Expand Down
42 changes: 42 additions & 0 deletions frmts/nitf/nitfdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,18 @@ static bool NITFPatchImageLength( const char *pszFilename,
GUIntBig nImageOffset,
GIntBig nPixelCount,
const char *pszIC,
<<<<<<< HEAD:frmts/nitf/nitfdataset.cpp
vsi_l_offset nICOffset,
CSLConstList papszCreationOptions );
static bool NITFWriteExtraSegments( const char *pszFilename,
CSLConstList papszCgmMD,
CSLConstList papszTextMD,
CSLConstList papszOptions );
=======
CSLConstList papszCreationOptions );
static bool NITFWriteCGMSegments( const char *pszFilename, char **papszList );
static bool NITFWriteTextSegments( const char *pszFilename, char **papszList );
>>>>>>> 33d99249ed (Merge branch 'master' of github.com:OSGeo/gdal):gdal/frmts/nitf/nitfdataset.cpp

#ifdef JPEG_SUPPORTED
static bool NITFWriteJPEGImage( GDALDataset *, VSILFILE *, vsi_l_offset, char **,
Expand Down Expand Up @@ -201,8 +207,13 @@ int NITFDataset::CloseDependentDatasets()
nBands;

CPL_IGNORE_RET_VAL(
<<<<<<< HEAD:frmts/nitf/nitfdataset.cpp
NITFPatchImageLength( GetDescription(), m_nIMIndex, m_nImageOffset, nPixelCount,
"C8", m_nICOffset, nullptr ));
=======
NITFPatchImageLength( GetDescription(), nImageStart, nPixelCount,
"C8", nullptr ));
>>>>>>> 33d99249ed (Merge branch 'master' of github.com:OSGeo/gdal):gdal/frmts/nitf/nitfdataset.cpp
}

bJP2Writing = FALSE;
Expand Down Expand Up @@ -4313,6 +4324,15 @@ NITFDataset::NITFCreateCopy(
poJ2KDriver =
GetGDALDriverManager()->GetDriverByName( "JP2OPENJPEG" );
}
<<<<<<< HEAD:frmts/nitf/nitfdataset.cpp
=======
if( poJ2KDriver == nullptr )
{
/* Try with Jasper as an alternate driver */
poJ2KDriver =
GetGDALDriverManager()->GetDriverByName( "JPEG2000" );
}
>>>>>>> 33d99249ed (Merge branch 'master' of github.com:OSGeo/gdal):gdal/frmts/nitf/nitfdataset.cpp
}
if( poJ2KDriver == nullptr )
{
Expand Down Expand Up @@ -5088,6 +5108,7 @@ NITFDataset::NITFCreateCopy(
GIntBig nPixelCount = nXSize * ((GIntBig) nYSize) *
poSrcDS->GetRasterCount();

<<<<<<< HEAD:frmts/nitf/nitfdataset.cpp
bool bOK = NITFPatchImageLength( pszFilename,
nIMIndex,
nImageOffset, nPixelCount,
Expand All @@ -5099,6 +5120,12 @@ NITFDataset::NITFCreateCopy(
papszTextMD,
papszFullOptions );
}
=======
bool bOK = NITFPatchImageLength( pszFilename, nImageOffset, nPixelCount,
"C8", papszFullOptions );
bOK &= NITFWriteCGMSegments( pszFilename, papszCgmMD );
bOK &= NITFWriteTextSegments( pszFilename, papszTextMD );
>>>>>>> 33d99249ed (Merge branch 'master' of github.com:OSGeo/gdal):gdal/frmts/nitf/nitfdataset.cpp
if( !bOK )
{
CSLDestroy(papszCgmMD);
Expand Down Expand Up @@ -5156,6 +5183,7 @@ NITFDataset::NITFCreateCopy(

NITFClose( psFile );

<<<<<<< HEAD:frmts/nitf/nitfdataset.cpp
bool bOK = NITFPatchImageLength( pszFilename,
nIMIndex,
nImageOffset,
Expand All @@ -5167,6 +5195,13 @@ NITFDataset::NITFCreateCopy(
papszTextMD,
papszFullOptions );
}
=======
bool bOK = NITFPatchImageLength( pszFilename, nImageOffset,
nPixelCount, pszIC, papszFullOptions );

bOK &= NITFWriteCGMSegments( pszFilename, papszCgmMD );
bOK &= NITFWriteTextSegments( pszFilename, papszTextMD );
>>>>>>> 33d99249ed (Merge branch 'master' of github.com:OSGeo/gdal):gdal/frmts/nitf/nitfdataset.cpp
if( !bOK )
{
CSLDestroy(papszCgmMD);
Expand Down Expand Up @@ -5379,7 +5414,10 @@ static bool NITFPatchImageLength( const char *pszFilename,
GUIntBig nImageOffset,
GIntBig nPixelCount,
const char *pszIC,
<<<<<<< HEAD:frmts/nitf/nitfdataset.cpp
vsi_l_offset nICOffset,
=======
>>>>>>> 33d99249ed (Merge branch 'master' of github.com:OSGeo/gdal):gdal/frmts/nitf/nitfdataset.cpp
CSLConstList papszCreationOptions )

{
Expand Down Expand Up @@ -6690,8 +6728,12 @@ void NITFDriver::InitCreationOptionList()
" <Option name='PROGRESSIVE' type='boolean' description='JPEG progressive mode'/>"
" <Option name='RESTART_INTERVAL' type='int' description='Restart interval (in MCUs). -1 for auto, 0 for none, > 0 for user specified' default='-1'/>"
#endif
<<<<<<< HEAD:frmts/nitf/nitfdataset.cpp
" <Option name='NUMI' type='int' default='1' description='Number of images to create (1-999). Only works with IC=NC if WRITE_ONLY_FIRST_IMAGE=NO'/>"
" <Option name='WRITE_ONLY_FIRST_IMAGE' type='boolean' default='NO' description='To be used with NUMI. If YES, only write first image. Subsequent one must be written with APPEND_SUBDATASET=YES'/>";
=======
" <Option name='NUMI' type='int' default='1' description='Number of images to create (1-999). Only works with IC=NC'/>";
>>>>>>> 33d99249ed (Merge branch 'master' of github.com:OSGeo/gdal):gdal/frmts/nitf/nitfdataset.cpp

if( bHasJPEG2000Drivers)
{
Expand Down

0 comments on commit 49a7c73

Please sign in to comment.