MapWindow Home
Search MapWindow.org


  • Home
    • Download
    • Why MW
    • FAQ
    • Contact
  • Products
    • MapWindow
    • ActiveX
    • Plug-ins
  • Software Dev
    • Sample Code
    • Scripts
    • Source
    • Bugs
    • Support
    • Languages
  • Site Tools
    • Forums
    • Tutorials
    • Mailing Lists
    • Team
    • Site Stats
    • Links
  • Get Stuff
    • Buy a CD
    • Buy a T-Shirt
    • MW Book
    • ActiveX Book
    • Donate
    • Buy Support
  • Documentation
    • MWGIS App. User Guide
    • GISTools User Guide
    • MW Plug-ins Dev. Guide
    • MWGIS ActiveX Dev. Guide
    • MWGeoProc Dev. Guide

MapWinGIS:ShapeNetwork RasterizeD8

From MapWindow GIS

Jump to: navigation, search

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://www.mapwindow.org/wiki/index.php/MapWinGIS:ShapeNetwork_RasterizeD8"
Views
  • Page
  • Discussion
  • View source
  • History
Personal tools
  • Log in / create account
  • What links here
  • Related changes
  • Upload file
  • Special pages
  • Printable version
  • Permanent link

Geospatial Software Lab

Copyright © 2008 - MapWindow Open Source Team
( last updated: December 03 2008.)
Home | Donate | Download | MapWindow GIS Desktop | MapWinGIS.ocx | Plug-ins | Contact | Lists | Bugs | Sample Code | Documentation
Code Repository | Open Source License | Discussion Forum | Wiki | Join the Team | Site Statistics | Links