Opened 7 months ago

Closed 7 months ago

#7100 closed defect (fixed)

PCIDSK(pix) overviews size order

Reported by: liminlu0314 Owned by: warmerdam
Priority: normal Milestone:
Component: GDAL_Raster Version: svn-trunk
Severity: normal Keywords:


When use gdal to get the overviews of the pix image, the overviews size is not arranged in order.The information output using gdalinfo is as follows:

gdalinfo.exe E:\Out\GF2\oGF2_PMS1_E112.7_N29.1_20161209_L1A0002028107-PAN1.pix 
Driver: PCIDSK/PCIDSK Database File 
Files: E:\Out\GF2\oGF2_PMS1_E112.7_N29.1_20161209_L1A0002028107-PAN1.pix 
Size is 17378, 14341 
Coordinate System is: 
        SPHEROID["WGS 84",6378137,298.257223563, 
Origin = (112.532292000000000,29.182410000000001) 
Pixel Size = (0.000018000000000,-0.000018000000000) 
Corner Coordinates: 
Upper Left  ( 112.5322920,  29.1824100) (112d31'56.25"E, 29d10'56.68"N) 
Lower Left  ( 112.5322920,  28.9242720) (112d31'56.25"E, 28d55'27.38"N) 
Upper Right ( 112.8450960,  29.1824100) (112d50'42.35"E, 29d10'56.68"N) 
Lower Right ( 112.8450960,  28.9242720) (112d50'42.35"E, 28d55'27.38"N) 
Center      ( 112.6886940,  29.0533410) (112d41'19.30"E, 29d 3'12.03"N) 
Band 1 Block=256x256 Type=UInt16, ColorInterp=Undefined 
  Description = GF2_PMS1_E112.7_N29.1_20161209_L1A0002028107-PAN1 
  Overviews: 135x112, 1086x896, 8689x7170, 543x448, 4344x3585, 271x224, 2172x1792 

But for tif or img file, the overviews is arranged in order of size. Overviews: 8689x7170, 4344x3585, 2172x1792, 1086x896, 543x448, 271x224, 135x112

Change History (6)

comment:1 Changed 7 months ago by liminlu0314

Modify the file in variable keys again according to the digital order to solve this problem.

add the following sort function

        std::vector<std::string> keys = GetMetadataKeys();
	std::sort(keys.begin(), keys.end(), comp); //added

and add the sort comparison function as follows

bool comp(const std::string &first, const std::string &second)
	int nFirst = atoi(first.c_str() + 10);
	int nSecond = atoi(second.c_str() + 10);
	return nFirst < nSecond;	//ascending order

comment:2 Changed 7 months ago by Even Rouault

Do you have a sample dataset to point to ?

comment:3 Changed 7 months ago by liminlu0314

The image file is large (about 40MB). Please download it from the link below. Thank you.

comment:4 Changed 7 months ago by Even Rouault

The link doesn't appear to work for me

comment:5 Changed 7 months ago by liminlu0314

Sorry about that, you can download it from new link

comment:6 Changed 7 months ago by Even Rouault

Resolution: fixed
Status: newclosed

In 40573:

PCIDSK SDK: sort overviews (patch by liminlu0314, fixes #7100)

Note: See TracTickets for help on using tickets.