[gdal-dev] CADRG subdataset access help

Even Rouault even.rouault at mines-paris.org
Fri Jul 25 15:42:42 EDT 2008


Not so difficult.
Example taken from the GDAL autotest suite:

$ gdalinfo A.TOC
Driver: RPFTOC/Raster Product Format TOC format
Files: A.TOC
Size is 1536, 1536
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        TOWGS84[0,0,0,0,0,0,0],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.0174532925199433,
        AUTHORITY["EPSG","9108"]],
    AXIS["Lat",NORTH],
    AXIS["Long",EAST],
    AUTHORITY["EPSG","4326"]]
Origin = (1.999941600000000,36.000117500000002)
Pixel Size = (0.001783387630208,-0.001346181640625)
Subdatasets:
  SUBDATASET_1_NAME=NITF_TOC_ENTRY:CADRG_ONC_1,000,000_2_0:A.TOC
  SUBDATASET_1_DESC=CADRG:ONC:Operational Navigation Chart:1,000,000:2:0
Corner Coordinates:
Upper Left  (   1.9999416,  36.0001175) (  1d59'59.79"E, 36d 0'0.42"N)
Lower Left  (   1.9999416,  33.9323825) (  1d59'59.79"E, 33d55'56.58"N)
Upper Right (   4.7392250,  36.0001175) (  4d44'21.21"E, 36d 0'0.42"N)
Lower Right (   4.7392250,  33.9323825) (  4d44'21.21"E, 33d55'56.58"N)
Center      (   3.3695833,  34.9662500) (  3d22'10.50"E, 34d57'58.50"N)

You can use the above value of SUBDATASET_1_NAME as the name for any GDALOpen 
call, so a gdalinfo on it gives what you want :

$ gdalinfo -noct NITF_TOC_ENTRY:CADRG_ONC_1,000,000_2_0:A.TOC
Driver: RPFTOC/Raster Product Format TOC format
Files: none associated
Size is 1536, 1536
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        TOWGS84[0,0,0,0,0,0,0],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.0174532925199433,
        AUTHORITY["EPSG","9108"]],
    AXIS["Lat",NORTH],
    AXIS["Long",EAST],
    AUTHORITY["EPSG","4326"]]
Origin = (1.999941600000000,36.000117500000002)
Pixel Size = (0.001783387630208,-0.001346181640625)
Metadata:
  FILENAME_0=./RPFTOC01.ON2
  NITF_SCALE=1,000,000
  NITF_SERIES_ABBREVIATION=ONC
  NITF_SERIES_NAME=Operational Navigation Chart
Corner Coordinates:
Upper Left  (   1.9999416,  36.0001175) (  1d59'59.79"E, 36d 0'0.42"N)
Lower Left  (   1.9999416,  33.9323825) (  1d59'59.79"E, 33d55'56.58"N)
Upper Right (   4.7392250,  36.0001175) (  4d44'21.21"E, 36d 0'0.42"N)
Lower Right (   4.7392250,  33.9323825) (  4d44'21.21"E, 33d55'56.58"N)
Center      (   3.3695833,  34.9662500) (  3d22'10.50"E, 34d57'58.50"N)
Band 1 Block=128x128 Type=Byte, ColorInterp=Palette
  NoData Value=216
  Color Table (RGB with 217 entries)



Le Friday 25 July 2008 21:09:35 Christiaan Janssen, vous avez écrit :
> How exactly does one go about accessing the raster data in an format that
> contains subdatasets like CADRG? Any help would be greatly appreciated.
>
> Christiaan
>
> _______________________________________________
> 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