MapWinGIS:ShapeNetwork RasterizeD8
From MapWindow GIS
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
















