MapWinGIS:ShapeNetwork RasterizeD8

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

RasterizeD8

Rasterizes the network into a D8 grid.
See also GridHeader and Grid


VB.NET Usage

Function RasterizeD8(UseNetworkBounds As Boolean, Optional Header As MapWinGIS.GridHeader, Optional Cellsize As Double, Optional cBack As MapWinGIS.ICallback) As MapWinGIS.Grid

            Parameters

UseNetworkBounds

A boolean value representing whether the shape network bounds will be used as the only bounds for the D8 grid or not.
Header Optional. A grid header to use to create the new grid.
Cellsize Optional. The cell size to use in creating the D8 grid.
cBack Optional. The ICallback object which will receive progress and error messages when the grid is being created.
ReturnValue Optional. The rasterized Grid representing the shape network.

Sample Code

    Private Sub RasterizeD8()
        Dim sf As New MapWinGIS.Shapefile()
        Dim shapenetwork As New MapWinGIS.ShapeNetwork()
        Dim grid As New MapWinGIS.Grid()
        Dim result As Integer
        'Open a line shapefile
        sf.Open("C:\test.shp")
        'Build a shape network from the shapefile using shape 0
         as the outlet shape and point 0 in shape 0 as the outlet point
        result = shapenetwork.Build(sf, 0, 0, 10, MapWinGIS.AmbiguityResolution.DISTANCE_TO_OUTLET)
        'Get a rasterized D8 grid from the shape network
        grid = shapenetwork.RasterizeD8(True)
    End Sub
  

VB 6 Usage
Function RasterizeD8(UseNetworkBounds As Boolean, Header As GridHeader, Cellsize As Double, cBack As ICallback) As Grid
            Parameters

UseNetworkBounds

A boolean value representing whether the shape network bounds will be used as the only bounds for the D8 grid or not.
Header Optional. A grid header to use to create the new grid.
Cellsize Optional. The cell size to use in creating the D8 grid.
cBack Optional. The ICallback object which will receive progress and error messages when the grid is being created.
ReturnValue Optional. The rasterized Grid representing the shape network.

Sample Code

    Private Sub RasterizeD8()
        Dim sf As New MapWinGIS.Shapefile
        Dim shapenetwork As New MapWinGIS.shapenetwork
        Dim grid As New MapWinGIS.grid
        Dim result As Long
        'Open a line shapefile
        sf.Open ("C:\test.shp")
        'Build a shape network from the shapefile using shape 0
         as the outlet shape and point 0 in shape 0 as the outlet point
        result = shapenetwork.Build(sf, 0, 0, 10, MapWinGIS.AmbiguityResolution.DISTANCE_TO_OUTLET)
        'Get a rasterized D8 grid from the shape network
        Set grid = shapenetwork.RasterizeD8(True)
    End Sub

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

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