Using the IlvRasterCADRGReader class to create images

Creating the reader

To create the CADRG Raster reader:
  • Use the IlvRasterCADRGReader class:
    IlvRasterCADRGReader imageReader = new IlvRasterCADRGReader();
    

Working with coverages

To use the CADRGCoverage class:
  1. Read the CADRG table of contents:
    IlvCADRGTocReader tocReader = new IlvCADRGTocReader(tocFileName);
    
  2. Retrieve the CADRG coverages you require:
    IlvCADRGCoverage coverages[]= tocReader.getCoverages();
    
To provide better control over the displayed data, you can use more than one IlvRasterCADRGReader and arrange coverages in different layers.

Organizing layers

To organize layers so that they contain coverages of the same resolution:
  1. Use the IlvCADRGCoverageList:
    IlvCADRGCoverageList list = new IlvCADRGCoverageList();
    list.addCoverages(tocFileName, tocReader.getCoverages());
    Integer scales[] = list.getOrderedScaleList();
    String scaleDesc[] = list.getOrderedScaleDescription();
    IlvCADRGCoverage coverages[] = list.getCoverageList(scales[i]);
    
  2. Retrieve all the coverages of the same resolution and add the coverages you want to display to the raster reader. For example:
    for(int iCov=0;iCov<coverages.length;iCov++) {
      imageReader.addCADRGCoverage(coverages[iCov]);
    }
    

Creating a data source

To create a data sourceand link it with the manager properties:
  • Define and insert the data source into the data source tree:
    IlvMapDataSource imageDataSource =
      IlvRasterDataSourceFactory.buildTiledImageDataSource(manager,imageReader,
        true,true,null);
    IlvMapDataSourceModel dataSourceModel =
      IlvMapDataSourceProperty.GetMapDataSourceModel(manager);
    dataSourceModel.insert(imageDataSource);
    

Reading the data

To start reading your data:
  • Start your data source:
    dataSourceModel.start();
    
Starting the data source creates the necessary tiled layers, tile managers and IlvRasterIcon instances to manage pixel-on-demand and progressive display of the geo-referenced image.
For further information, see: Raster data sources