MapInfo Pro

Raster Rendering Deep Dive – Part 4 – Image Layers

  • 1.  Raster Rendering Deep Dive – Part 4 – Image Layers

    Pitney Bowes
    Posted 9 days ago
    Edited by Sam Roberts yesterday

    The previous articles demonstrated default algorithms, LUTColor and RGBColor layers. This article demonstrates the capabilities of Image layer.

    Previous article - Raster Rendering Deep Dive – Part 3 – RGBColor Layers

    The Image layer type makes it easy to get color images rendered without any need to think about data transforms or color look-up tables. Generally, the color data is copied from the source raster through the rendering pipeline without modification. However, intensity and opacity components can change the pixel color to provide hill shading and transparency modulation. Also, color space transformations can be used, like converting to greyscale.

    The Image component must be connected to a raster source band that contains a color data type. That data type might be a single color component like red or blue or grey, or it might be a composite color data type like RGB or RGBA. It may be in a different color space like HSL.

    Rasters that have a color data type are likely to be images in formats like ECW, JPEG2000 or TIFF and the raster field type is likely to be "Image" or "Image Palette". Often a "Classified" field in a raster will have a color band and so the Image layer is often useful for rendering classified rasters. Also, "Continuous" fields in raster formats like MRR can also contain color data types.

    This example renders the US National Land Cover dataset – a 30 metre resolution classified raster that contains color as an RGBA band. The first algorithm simply displays the classified raster. The second algorithm drapes the classified raster over a global terrain raster at 3 arc-second resolution (about 90 metre) and displays in a geodetic coordinate system. I have included some images and a closer view of the North-East.

    <?xml version="1.0" encoding="UTF-8"?>
    <RenderAlgorithm Version="1.0" Enable="True">
    	<Name>Image Layer Algorithm</Name>
    	<Description>Image layer from classified land cover</Description>
    	<Raster>
    		<Name>Raster01</Name>
    		<File>F:\Data\OpenSource\USA\NationalLandCover2011\NLCD_ContinentalUSA_2011_ed_2014_10_10.mrr</File>
    	</Raster>
    	<Layer Type = "Image" Name = "Global Landcover">
    		<Component Type = "Image" Enable = "TRUE">
    			<Raster Name = "Raster01" Field = "0" Band = "2"/>
    		</Component>
    	</Layer>
    </RenderAlgorithm>
    

    USA National Land Cover

    <?xml version="1.0" encoding="UTF-8"?>
    <RenderAlgorithm Version="1.0" Enable="True">
    	<Name>Image Layer Algorithm</Name>
    	<Description>Image layer from classified land cover and terrain</Description>
    	<ValidCellByComponentRule>All</ValidCellByComponentRule>
    	<CoordinateSystem>CoordSys Earth Projection 1, 104</CoordinateSystem>
    	<Raster>
    		<Name>Raster01</Name>
    		<File>F:\Data\OpenSource\USA\NationalLandCover2011\NLCD_ContinentalUSA_2011_ed_2014_10_10.mrr</File>
    	</Raster>
    	<Raster>
    		<Name>Raster02</Name>
    		<File>F:\Data\OpenSource\Global\Terrain\CGIAR_SRTM_3as\CGIAR_SRTM_3as.mrr</File>
    	</Raster>
    	<Layer Type = "Image" Name = "Global Landcover">
    		<Component Type = "Image" Enable = "TRUE">
    			<Raster Name = "Raster01" Field = "0" Band = "2"/>
    		</Component>
    		<Component Type="Intensity" Enable="True">
    			<Raster Name="Raster02"/>
    		</Component>
    	</Layer>
    </RenderAlgorithm>

    USA National Land Cover Drape

    USA National Land Cover Drape - North East


    For now, this concludes my series on articles on the new raster rendering engine. The engine is a work in progress and new features may be added over time. In addition to the layer properties that have already been discussed, there are a number of more advanced topics which could form the subject of future articles. These topics might include -

    • Raster sources – advanced preference properties for opening and managing rasters, using sources that refer to multiple source rasters.
    • Data conditioning – applying rules to source data to clean it prior to rendering it.
    • Data transforms – the rich variety of transforms that can be created from statistics, as well as user defined transforms.
    • Color tables – how to specify them manually, what file formats that are supported, what formats support both color and data information.
    • Specifying Field, Band, Time and Event information to select what data is rendered.
    • Applying properties at different levels of scope – which properties can be specified at the algorithm, layer and component levels of scope and how they are applied.
    • Pixel buffer properties – controlling background colors and rendering invalid pixels.
    • Coordinate systems – Specifying and applying to components, layers and the algorithm.
    • Blending layers – using layer opacity and different blending algorithms to achieve different effects.
    • Interpolation – using it, avoiding it, controlling it and applying it to color and intensity components.
    • Balancing the level of color intensity and shadow depth in a drape.
    • Using the "ValidCellByComponent" rule to control pixel validation and applications of multi-phase rendering.
    • Layer opacity – implementing opacity (transparency) modulation and understanding opacity transforms and opacity color tables.
    • Other advanced topics like color space transformations, hill shading and color transform properties.

    Please leave a comment if you are interested in exploring any of these topics further, or if you have any other queries about the raster rendering engine.

     



    ------------------------------
    Sam Roberts
    Engineer, MapInfo Pro Advanced (Raster)
    Australia
    ------------------------------

    Attachment(s)

    xml
    Image_Layer_01.xml   543B 1 version
    xml
    Image_Layer_02.xml   910B 1 version