[gdal-dev] Display ADRG data with multiple subdatasets

Ayhan TEKGÜL ayhan.tekgul at netcad.com.tr
Sun Dec 27 05:54:55 EST 2009


Hi Even,

When I check gdalinfo for transh01.thf file, the result is,
-------------------------------------------------------
Driver: ADRG/ARC Digitized Raster Graphics
Files: transh01.thf
Size is 13696, 2944
Coordinate System is:
GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 
84",6378137,298.257223563]],
    PRIMEM["Greenwich",0], UNIT["degree",0.0174532925199433], 
AUTHORITY["EPSG","4326"]]
Origin = (-10.588233333333333,52.738852777777780)
Pixel Size = (0.005908613445378,-0.004478503184713)
Band number: 3
Metadata:
  ADRG_SCA=5000000
  ADRG_NAM=GNUR0102
Corner Coordinates:
Upper Left  ( -10.5882333,  52.7388528) ( 10d35'17.64"W, 52d44'19.87"N)
Lower Left  ( -10.5882333,  39.5541394) ( 10d35'17.64"W, 39d33'14.90"N)
Upper Right (  70.3361364,  52.7388528) ( 70d20'10.09"E, 52d44'19.87"N)
Lower Right (  70.3361364,  39.5541394) ( 70d20'10.09"E, 39d33'14.90"N)
Center      (  29.8739515,  46.1464961) ( 29d52'26.23"E, 46d 8'47.39"N)
Band 1 Block=128x128 Type=Byte, ColorInterp=Red
  NoData Value=0
Band 2 Block=128x128 Type=Byte, ColorInterp=Green
  NoData Value=0
Band 3 Block=128x128 Type=Byte, ColorInterp=Blue
  NoData Value=0
------------------------------------------------------------------------------------

When I check gdalinfo for gnur0101.gen file, the result is,
-----------------------------------------------------------------------------------
Driver: ADRG/ARC Digitized Raster Graphics
Files: gnur0101.gen
Size is 13696, 2944
Coordinate System is:
GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 
84",6378137,298.257223563]],
    PRIMEM["Greenwich",0], UNIT["degree",0.0174532925199433], 
AUTHORITY["EPSG","4326"]]
Origin = (-10.588233333333333,52.738852777777780)
Pixel Size = (0.005908613445378,-0.004478503184713)
Band number: 3
Metadata:
  ADRG_SCA=5000000
  ADRG_NAM=GNUR0102
Corner Coordinates:
Upper Left  ( -10.5882333,  52.7388528) ( 10d35'17.64"W, 52d44'19.87"N)
Lower Left  ( -10.5882333,  39.5541394) ( 10d35'17.64"W, 39d33'14.90"N)
Upper Right (  70.3361364,  52.7388528) ( 70d20'10.09"E, 52d44'19.87"N)
Lower Right (  70.3361364,  39.5541394) ( 70d20'10.09"E, 39d33'14.90"N)
Center      (  29.8739515,  46.1464961) ( 29d52'26.23"E, 46d 8'47.39"N)
Band 1 Block=128x128 Type=Byte, ColorInterp=Red
  NoData Value=0
Band 2 Block=128x128 Type=Byte, ColorInterp=Green
  NoData Value=0
Band 3 Block=128x128 Type=Byte, ColorInterp=Blue
  NoData Value=0
--------------------------------------------------------------------------------------

There are 4 subdatasets, but gdalinfo shows just the first one in metadata 
as ADRG_NAM=GNUR0102 with size 13696, 2944

In ADRGDataset::GetGENListFromTHF function of adrgdataset.cpp file, I tried 
to catch IMG files and add to fileNames. Then gdalinfo showed all the img 
files in subdatasets metadata.

But this time GDALGetRasterCount gives 0 band. Because in ADRGDataset::Open 
function, when count of fileNames is bigger than 1, all fileNames[i] are 
being added as subdatasets to poDS and poDS returns without nBands are set.

As I understand that, when subdatasets exist, subdataset files should be 
handled separately. But gdalinfo does not recognize the subdataset files 
(xxx.img).

So maybe I should handle the adrg data, which has multiple subdatasets, by 
my own code. But this is not a convenient way of reading adrg data.

Best regards...

Ayhan TEKGÜL

----- Original Message ----- 
From: "Even Rouault" <even.rouault at mines-paris.org>
To: "Ayhan TEKGÜL" <ayhan.tekgul at netcad.com.tr>
Cc: <gdal-dev at lists.osgeo.org>
Sent: Saturday, December 26, 2009 8:10 PM
Subject: Re: [gdal-dev] Display ADRG data with multiple subdatasets


> Ayhan,
>
> the driver has support for ADRG subdatasets (although I'm not 100% 
> positive this has been tested). Theoretically, if you do a gdalinfo on the 
> .THF file and it has several subdatasets, they should be listed. But 
> basically the list is just the list of related .GEN files, so you can 
> directly do gdalinfo on the .GEN files.
>
> Best regards,
>
> Even
>
> Ayhan TEKGÜL a écrit :
>> Hi, all;
>>  I am using gdal-1.5.0 to display ADRG data. But when ADRG data has 
>> multiple subdatasets, I can display just one image.
>>  I have tried to search the wiki and gdal-dev archives, but I cannot get 
>> any similar problem with this issue or solution to this problem. (Maybe I 
>> have missed.)
>>  Is there anybody who knows to display adrg data with multiple 
>> subdatasets?
>>  Best regards...
>>  Ayhan TEKGÜL
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
> 



More information about the gdal-dev mailing list