Introduction to Algorithms

General

An algorithm is a set of processing steps that transform your raw raster data into a form suitable for viewing or printing.   This set of steps is defined in an algorithm file, which is a text file with an .alg extension.   You can think of an .alg file as being like a MapInfo .tab file, but for raster imagery.

Algorithm files can be shared between MapImagery, MapImagery Professional, ER Mapper, ER Viewer and a whole range of other free plug-ins for other GIS products, which share the ER Mapper raster processing engine.

A key aspect of the algorithm concept is that it separates your raster data from the processing techniques used to manipulate that data.   This makes it easy to apply the same processing techniques to a different set of data, saves on disk space, and is also logically much cleaner as your original data in its original form is preserved.

Example .alg File

Algorithm Begin
    Version        = "6.0"
    Name        = "Average"
    Description    = "SPOT Panchromatic 10 meter"
    Author        = "MapImagery"
    Comments    = "This filter takes an average of the cells in the filter box. The result is a blurring, or averaging, of the image."
    DisplayMode    = PSEUDO
    LastUpdated    = Fri Jul 7 07:31:49 GMT 2000
    LookupTable    = "greyscale"
    BackGroundColourSet    = No
    BackGroundColour    = 0,0,0
    ConvertToGreyscale    = No
    CoordinateSpace Begin
        Datum         = "NAD27"
        Projection    = "NUTM11"
        CoordinateType    = EN
        Units         = "METERS"
        Rotation    = 0:0:0.0
    CoordinateSpace End
    TopLeftCorner Begin
        Eastings    = 475900.9083925
        Northings    = 3628704.674176
    TopLeftCorner End
    BottomRightCorner Begin
        Eastings    = 490900.9083925
        Northings    = 3613704.674176
    BottomRightCorner End
    MosaicType    = Overlay
    Stream Begin
        Type         = Pseudo
        Dataset         = "../../Shared_Data/SPOT_Pan.ers"
        DoStaticShade    = No
        SunAzimuth    = 45:0:0.0
        SunAngle    = 45:0:0.0
        StreamInput Begin
            StreamInputID     = 1
        StreamInput End
        Formula Begin
            Description     = "Default Formula"
            Formula         = "INPUT1"
            FormulaArg Begin
                StreamInput     = 1
                BandNumber     = 1
                BandId Begin
                    Value         = "0.650_um"
                BandId End
            FormulaArg End
        Formula End
        Kernel Begin
            Type         = Convolution
            Directory     = "filters_lowpass"
            Name         = "avg5"
            Description     = "5x5 Average filter"
            Rows         = 5
            Columns         = 5
            OKOnSubsampledData     = Yes
            Array         = {
                1     1    1    1    1
                1     1    1    1    1
                1     1    1    1    1
                1     1    1    1    1
                1     1    1    1    1
            }
            ScaleFactor     = 25
        Kernel End
        Transform Begin
            Type         = Linear
            MinimumInputValue     = 0
            MaximumInputValue     = 255
            MinimumOutputValue     = 0
            MaximumOutputValue     = 255
            LinearDef Begin
                NumberOfPoints     = 4
                Points         = {
                    0.000000     0.000000   
                    0.133333     0.000000   
                    0.600000     1.000000   
                    1.000000     1.000000   
                }
            LinearDef End
            DoInRealtime     = No
        Transform End
    Stream End
Algorithm End