Skip to content

Commit

Permalink
take out page size
Browse files Browse the repository at this point in the history
  • Loading branch information
gillins committed Apr 22, 2024
1 parent 9b3535d commit 9ac3c92
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 13 deletions.
7 changes: 1 addition & 6 deletions gdal/keadataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,6 @@ GDALDataset *KEADataset::Create( const char * pszFilename,
if( pszValue != nullptr )
nattblockSize = atol( pszValue );

hsize_t npageSize = kealib::KEA_PAGE_SIZE;
pszValue = CSLFetchNameValue( papszParmList, "PAGESIZE" );
if( pszValue != nullptr )
npageSize = atol( pszValue );

unsigned int nmdcElmts = kealib::KEA_MDC_NELMTS;
pszValue = CSLFetchNameValue( papszParmList, "MDC_NELMTS" );
if( pszValue != nullptr )
Expand Down Expand Up @@ -301,7 +296,7 @@ GDALDataset *KEADataset::Create( const char * pszFilename,
H5::H5File *keaImgH5File = kealib::KEAImageIO::createKEAImage( pszFilename,
GDAL_to_KEA_Type( eType ),
nXSize, nYSize, nBands,
nullptr, nullptr, npageSize, nimageblockSize,
nullptr, nullptr, nimageblockSize,
nattblockSize, nmdcElmts, nrdccNElmts,
nrdccNBytes, nrdccW0, nsieveBuf,
nmetaBlockSize, ndeflate );
Expand Down
1 change: 0 additions & 1 deletion include/libkea/KEACommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ namespace kealib{
static const unsigned int KEA_DEFLATE( 1 ); // 1
static const hsize_t KEA_IMAGE_CHUNK_SIZE( 512 ); // 512
static const hsize_t KEA_ATT_CHUNK_SIZE( 10000 ); // 10000
static const hsize_t KEA_PAGE_SIZE(8192); // 8192

enum KEADataType
{
Expand Down
2 changes: 1 addition & 1 deletion include/libkea/KEAImageIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ namespace kealib{
// remove band from file
virtual void removeImageBand(const uint32_t bandIndex);

static H5::H5File* createKEAImage(const std::string &fileName, KEADataType dataType, uint32_t xSize, uint32_t ySize, uint32_t numImgBands, std::vector<std::string> *bandDescrips=NULL, KEAImageSpatialInfo *spatialInfo=NULL, uint32_t imageBlockSize=KEA_IMAGE_CHUNK_SIZE, uint32_t attBlockSize=KEA_ATT_CHUNK_SIZE, hsize_t pageSize=KEA_PAGE_SIZE, int mdcElmts=KEA_MDC_NELMTS, hsize_t rdccNElmts=KEA_RDCC_NELMTS, hsize_t rdccNBytes=KEA_RDCC_NBYTES, double rdccW0=KEA_RDCC_W0, hsize_t sieveBuf=KEA_SIEVE_BUF, hsize_t metaBlockSize=KEA_META_BLOCKSIZE, uint32_t deflate=KEA_DEFLATE);
static H5::H5File* createKEAImage(const std::string &fileName, KEADataType dataType, uint32_t xSize, uint32_t ySize, uint32_t numImgBands, std::vector<std::string> *bandDescrips=NULL, KEAImageSpatialInfo *spatialInfo=NULL, uint32_t imageBlockSize=KEA_IMAGE_CHUNK_SIZE, uint32_t attBlockSize=KEA_ATT_CHUNK_SIZE, int mdcElmts=KEA_MDC_NELMTS, hsize_t rdccNElmts=KEA_RDCC_NELMTS, hsize_t rdccNBytes=KEA_RDCC_NBYTES, double rdccW0=KEA_RDCC_W0, hsize_t sieveBuf=KEA_SIEVE_BUF, hsize_t metaBlockSize=KEA_META_BLOCKSIZE, uint32_t deflate=KEA_DEFLATE);
static bool isKEAImage(const std::string &fileName);
static H5::H5File* openKeaH5RW(const std::string &fileName, int mdcElmts=KEA_MDC_NELMTS, hsize_t rdccNElmts=KEA_RDCC_NELMTS, hsize_t rdccNBytes=KEA_RDCC_NBYTES, double rdccW0=KEA_RDCC_W0, hsize_t sieveBuf=KEA_SIEVE_BUF, hsize_t metaBlockSize=KEA_META_BLOCKSIZE);
static H5::H5File* openKeaH5RDOnly(const std::string &fileName, int mdcElmts=KEA_MDC_NELMTS, hsize_t rdccNElmts=KEA_RDCC_NELMTS, hsize_t rdccNBytes=KEA_RDCC_NBYTES, double rdccW0=KEA_RDCC_W0, hsize_t sieveBuf=KEA_SIEVE_BUF, hsize_t metaBlockSize=KEA_META_BLOCKSIZE);
Expand Down
7 changes: 2 additions & 5 deletions src/libkea/KEAImageIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2967,7 +2967,7 @@ namespace kealib{
}
}

H5::H5File* KEAImageIO::createKEAImage(const std::string &fileName, KEADataType dataType, uint32_t xSize, uint32_t ySize, uint32_t numImgBands, std::vector<std::string> *bandDescrips, KEAImageSpatialInfo * spatialInfo, uint32_t imageBlockSize, uint32_t attBlockSize, hsize_t pageSize, int mdcElmts, hsize_t rdccNElmts, hsize_t rdccNBytes, double rdccW0, hsize_t sieveBuf, hsize_t metaBlockSize, uint32_t deflate)
H5::H5File* KEAImageIO::createKEAImage(const std::string &fileName, KEADataType dataType, uint32_t xSize, uint32_t ySize, uint32_t numImgBands, std::vector<std::string> *bandDescrips, KEAImageSpatialInfo * spatialInfo, uint32_t imageBlockSize, uint32_t attBlockSize, int mdcElmts, hsize_t rdccNElmts, hsize_t rdccNBytes, double rdccW0, hsize_t sieveBuf, hsize_t metaBlockSize, uint32_t deflate)
{
KEAStackPrintState printState;

Expand All @@ -2982,10 +2982,7 @@ namespace kealib{
keaAccessPlist.setMetaBlockSize(metaBlockSize);

// CREATE THE HDF FILE - EXISTING FILE WILL BE TRUNCATED
H5::FileCreatPropList keaPlist = H5::FileCreatPropList();
keaPlist.setFileSpaceStrategy(H5F_FSPACE_STRATEGY_AGGR, false, 0);
keaPlist.setFileSpacePagesize(pageSize);
keaImgH5File = new H5::H5File( fileName, H5F_ACC_TRUNC, keaPlist, keaAccessPlist);
keaImgH5File = new H5::H5File( fileName, H5F_ACC_TRUNC, H5::FileCreatPropList::DEFAULT, keaAccessPlist);

//////////// CREATE GLOBAL HEADER ////////////////
keaImgH5File->createGroup( KEA_DATASETNAME_HEADER );
Expand Down

0 comments on commit 9ac3c92

Please sign in to comment.