MapWinGIS:ShapeNetwork Build

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

Build

Builds a shape network from the specified line shapefile using the shape index to determine which shape in the shapefile is to be used as the outlet shape.
See also Shapefile and AmbiguityResolution


VB.NET Usage

Function Build(Shapefile As MapWinGIS.Shapefile, ShapeIndex As Integer, FinalPointIndex As Integer, Tolerance As Double, ar As MapWinGIS.AmbiguityResolution, Optional cBack As MapWinGIS.ICallback) As Integer

            Parameters

Shapefile

The shapefile to be used to create the shape network.
ShapeIndex The index of the shape in the specified shapefile to be used as the outlet shape for the shape network.
FinalPointIndex The point index of the point in the specified outlet shape to be used as the outlet point for the shape network.
Tolerance The tolerance used to find disconnected segments to merge into the network.
ar The ambiguity resolution method used to resolve any ambiguity while building the shape network. Distance to outlet is the only ambiguity resolution method implemented at this time.
cBack Optional. The ICallback object which will receive progress and error messages during the creation of the shape network.
ReturnValue The success or failure of building the shape network. If a non-zero integer is returned, the shape network build was successful. If a zero is returned, the shape network build was not successful.

Sample Code

    Private Sub BuildNetwork()
        Dim sf As New MapWinGIS.Shapefile()
        Dim shapenetwork As New MapWinGIS.ShapeNetwork()
        Dim result As Integer, hndl 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)
    End Sub
  

VB 6 Usage
Function Build(Shapefile As Shapefile, ShapeIndex As Long, FinalPointIndex As Long, Tolerance As Double, ar As AmbiguityResolution, cBack As ICallback) As Long
            Parameters

Shapefile

The shapefile to be used to create the shape network.
ShapeIndex The index of the shape in the specified shapefile to be used as the outlet shape for the shape network.
FinalPointIndex The point index of the point in the specified outlet shape to be used as the outlet point for the shape network.
Tolerance The tolerance used to find disconnected segments to merge into the network.
ar The ambiguity resolution method used to resolve any ambiguity while building the shape network. Distance to outlet is the only ambiguity resolution method implemented at this time.
cBack The ICallback object which will receive progress and error messages during the creation of the shape network.
ReturnValue The success or failure of building the shape network. If a non-zero integer is returned, the shape network build was successful. If a zero is returned, the shape network build was not successful.

Sample Code

    Private Sub BuildNetwork()
        Dim sf As New MapWinGIS.Shapefile
        Dim shapenetwork As New MapWinGIS.shapenetwork
        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)
    End Sub

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

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