MapWinGIS:Utils GridMerge

This is a back-up of the WIKI.
Not all links might work
We're working on a new wiki.

Main Page | Recent changes | View source | Page history | Log in / create account |

Printable version | Disclaimers | Privacy policy

GridMerge

Merges multiple grids into a single output grid.
See also GridFileType and Grid


VB.NET Usage

Function GridMerge(Grids As Object, MergeFilename As String, Optional InRam As Boolean, Optional GrdFileType As MapWinGIS.GridFileType, Optional cBack As MapWinGIS.ICallback) As MapWinGIS.Grid

            Parameters

Grids

An array of grid objects to be merged into one grid.
MergeFilename The filename to use for the new merged grid.
InRam Optional. A boolean value representing whether to create the merged grid in RAM or on disk.
GrdFileType Optional. The file type of the new merged grid.
cBack Optional. The ICallback object which will receive progress and error messages while the grids are being merged.
ReturnValue The new merged grid.

Sample Code

    Private Sub GridsMerge()
        Dim grids(2) As MapWinGIS.Grid
        Dim grid1 As New MapWinGIS.Grid(), grid2 As New MapWinGIS.Grid(), grid3 As New MapWinGIS.Grid()
        Dim utils As New MapWinGIS.Utils()
        'Open the first grid
        grid1.Open("C:\grid1.asc")
        'Open the second grid
        grid2.Open("C:\grid2.asc")
        'Set the first grid in the array
        grids(0) = grid1
        'Set the second grid in the array
        grids(1) = grid2
        'Merge grid1 and grid2 by passing the array containing them to the merge function , putting the new array in grid3
        grid3 = utils.GridMerge(grids, "C:\merged_grid.asc")
    End Sub
  

VB 6 Usage
Function GridMerge(Grids As Object, MergeFilename As String, Optional InRam As Boolean, Optional GrdFileType As GridFileType, Optional cBack As ICallback) As Grid
            Parameters

Grids

An array of grid objects to be merged into one grid.
MergeFilename The filename to use for the new merged grid.
InRam Optional. A boolean value representing whether to create the merged grid in RAM or on disk.
GrdFileType Optional. The file type of the new merged grid.
cBack Optional. The ICallback object which will receive progress and error messages while the grids are being merged.
ReturnValue The new merged grid.

Sample Code

    Private Sub GridsMerge()
        Dim grids(2) As MapWinGIS.grid
        Dim grid1 As New MapWinGIS.grid, grid2 As New MapWinGIS.grid, grid3 As New MapWinGIS.grid
        Dim utils As New MapWinGIS.utils
        'Open the first grid
        grid1.Open ("C:\grid1.asc")
        'Open the second grid
        grid2.Open ("C:\grid2.asc")
        'Set the first grid in the array
        Set grids(0) = grid1
        'Set the second grid in the array
        Set grids(1) = grid2
        'Merge grid1 and grid2 by passing the array containing them to the merge function, putting the new array in grid3
        Set grid3 = utils.GridMerge(grids, "C:\merged_grid.asc")
    End Sub

Retrieved from "http://mapwindow.org/wiki/index.php/MapWinGIS:Utils_GridMerge"

This page has been accessed 1,289 times. This page was last modified on 9 November 2005, at 17:36.