MapWinGIS:Utils GridToShapefile

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

GridToShapefile

Creates a new shapefile from the grid. Note: It is important that the flow grid is used when there are any ambiguous parts of the grid. Ambiguity Example

See also Grid and Shapefile


VB.NET Usage

Function GridToShapefile(Grid As MapWinGIS.Grid, Optional ConnectionGrid As MapWinGIS.Grid, Optional cBack As MapWinGIS.ICallback) As MapWinGIS.Shapefile

            Parameters

Grid

The grid to be converted to a shapefile.
ConnectionGrid Optional. The flow grid that is used to resolve any ambiguity. Without this flow grid the output results are somewhat unpredictable.
cBack Optional. The ICallback object which will receive progress and error messages while the grid is being converted to a shapefile.
ReturnValue The new shapefile created from the grid.

Sample Code

    Private Sub GridToShapefile()
        Dim grid As New MapWinGIS.Grid(), flowgrid As New MapWinGIS.Grid()
        Dim utils As New MapWinGIS.Utils()
        Dim sf As New MapWinGIS.Shapefile()
        'Open a grid
        grid.Open("C:\test.asc")
        'Open the flow grid
        grid.Open("C:\test_flow.asc")
        'Create a new shapefile from the grid
        sf = utils.GridToShapefile(grid, flowgrid, Me)
    End Sub
  

VB 6 Usage
Function GridToShapefile(Grid As Grid, Optional ConnectionGrid As Grid, Optional cBack As ICallback) As Shapefile
            Parameters

Grid

The grid to be converted to a shapefile.
ConnectionGrid Optional. The flow grid that is used to resolve any ambiguity. Without this flow grid the output results are somewhat unpredictable.
cBack Optional. The ICallback object which will receive progress and error messages while the grid is being converted to a shapefile.
ReturnValue The new shapefile created from the grid.

Sample Code

    Private Sub GridToShapefile()
        Dim grid As New MapWinGIS.grid, flowgrid As New MapWinGIS.grid
        Dim utils As New MapWinGIS.utils
        Dim sf As New MapWinGIS.Shapefile
        'Open a grid
        grid.Open ("C:\test.asc")
        'Open the flow grid
        grid.Open ("C:\test_flow.asc")
        'Create a new shapefile from the grid
        Set sf = utils.GridToShapefile(grid, flowgrid, Me)
    End Sub

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

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