Public Member Functions | Properties
ShapeNetwork Class Reference

Represents a network built from the polyline shapefile. More...

List of all members.

Public Member Functions

int Build (Shapefile Shapefile, int ShapeIndex, int FinalPointIndex, double Tolerance, AmbiguityResolution ar, ICallback cBack)
 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.
bool Close ()
 Closes the shape network.
bool DeleteShape (int ShapeIndex)
 Deletes a shape from the shape network.
int get_AmbigShapeIndex (int Index)
 Gets the shape index of an ambiguous shape in the shape network.
double get_DistanceToOutlet (int PointIndex)
 Gets the distance from the specified point in the current shape to the outlet point in the shape network.
string get_ErrorMsg (int ErrorCode)
 Retrieves the error message associated with the specified error code.
bool MoveDown ()
 Moves the current shape pointer down the network by one link.
bool MoveTo (int ShapeIndex)
 Moves the current shape pointer to the shape specified by the shape index.
bool MoveToOutlet ()
 Moves the current shape pointer to the outlet shape in the shape network.
bool MoveUp (int UpIndex)
 Moves the current shape pointer up the shape network, taking the specified path.
bool Open (Shapefile sf, ICallback cBack)
 Opens a shape network.
Grid RasterizeD8 (bool UseNetworkBounds, GridHeader Header, double Cellsize, ICallback cBack)
 Rasterizes the network into a D8 grid.

Properties

Shape CurrentShape [get]
 Gets the current shape object in the shape network.
int CurrentShapeIndex [get]
 Gets the index of the current shape in the shape network.
ICallback GlobalCallback [get, set]
 The global callback is the interface used by MapWinGIS to pass progress and error events to interested applications.
string Key [get, set]
 The key may be used by the programmer to store any string data associated with the object.
int LastErrorCode [get]
 Retrieves the last error generated in the object.
int NetworkSize [get]
 Gets the number of shapes in the shape network.
int NumDirectUps [get]
 Gets the number of upstream shapes in the network before the next fork.
int ParentIndex [get, set]
 Gets the index of the parent of the current shape. If the current shape is the outlet shape in the shape network, -1 will be returned.
Shapefile Shapefile [get]
 Gets the shapefile used to create the network.

Detailed Description

Represents a network built from the polyline shapefile.

A shape network is created from the shapes in a polyline shapefile which allows you to traverse the shapefile simulating water flowing in a watershed to a single outlet. To create a shape network from a polyline shapefile, first choose an outlet shape from the shapes in the shapefile. Next, choose an outlet point within the specified outlet shape. Finally, you need to select a tolerance value. The tolerance is used to determine whether to include a shape in the shape network if it is not connected to the network. Using this starting criteria, a shape network can be created from the polyline shapefile.


Member Function Documentation

int ShapeNetwork.Build ( Shapefile  Shapefile,
int  ShapeIndex,
int  FinalPointIndex,
double  Tolerance,
AmbiguityResolution  ar,
ICallback  cBack 
)

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.

Parameters:
ShapefileThe shapefile to be used to create the shape network.
ShapeIndexThe index of the shape in the specified shapefile to be used as the outlet shape for the shape network
FinalPointIndexThe point index of the point in the specified outlet shape to be used as the outlet point for the shape network.
ToleranceThe tolerance used to find disconnected segments to merge into the network.
arThe ambiguity resolution method used to resolve any ambiguity while building the shape network. Distance to outlet is the only ambiguity resolution method implemented.
cBackOptional. The ICallback object which will receive progress and error messages during the creation of the shape newtwork.
Returns:
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.

Closes the shape network.

Returns:
A boolean value representing the success or failure of closing the shape network.
bool ShapeNetwork.DeleteShape ( int  ShapeIndex)

Deletes a shape from the shape network.

Parameters:
ShapeIndexThe index of the shape to be deleted from the shape network.
Returns:
A boolean value representing the success or failure of deleting the shape from the shape network.

Gets the shape index of an ambiguous shape in the shape network.

The first ambiguous shape is at index 0. If there are no ambiguous shapes, AmbigShapeIndex(0) will return -1. If AmbigShapeIndex returns -1 and the index you specified isn't 0, it means there are no more ambiguous shapes in the shape network.

Parameters:
IndexThe index into the ambiguous shapes in the shape network.
Returns:
The shape index of the ambiguous shape. Returns -1 if there isn't an ambiguous shape at the specified ambiguous shape index.
double ShapeNetwork.get_DistanceToOutlet ( int  PointIndex)

Gets the distance from the specified point in the current shape to the outlet point in the shape network.

Parameters:
PointIndexThe index of a point in the current shape.
Returns:
The distance from the specified point in the current shape to the outlet point in the shape network.
string ShapeNetwork.get_ErrorMsg ( int  ErrorCode)

Retrieves the error message associated with the specified error code.

Parameters:
ErrorCodeThe error code for which the error message is required.
Returns:
The error message description for the specified error code.

Moves the current shape pointer down the network by one link.

Returns:
A boolean value representing the success or failure of moving the current shape pointer down the shape network by one link.
bool ShapeNetwork.MoveTo ( int  ShapeIndex)

Moves the current shape pointer to the shape specified by the shape index.

Parameters:
ShapeIndexThe shape index of the shape in the network to move the current shape pointer to.
Returns:
A boolean value representing the success or failure of moving the current shape pointer to the specified shape.

Moves the current shape pointer to the outlet shape in the shape network.

Returns:
A boolean value representing the success or failure of moving the current shape pointer to the outlet shape in the shape network.
bool ShapeNetwork.MoveUp ( int  UpIndex)

Moves the current shape pointer up the shape network, taking the specified path.

Parameters:
UpIndexThe index of the shape in the shape network to use as the upstream path. This is necessary because a node may have more than one upstream path.
Returns:
A boolean value representing the success or failure of moving the current shape pointer up in the shape network.
bool ShapeNetwork.Open ( Shapefile  sf,
ICallback  cBack 
)

Opens a shape network.

Parameters:
sfThe shapefile object to open as a shape network.
cBackOptional. ICallback object which will receive progress and error messages while the shape network is opened.
Returns:
A boolean value representing the success or failure of opening the shape network
Grid ShapeNetwork.RasterizeD8 ( bool  UseNetworkBounds,
GridHeader  Header,
double  Cellsize,
ICallback  cBack 
)

Rasterizes the network into a D8 grid.

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

Property Documentation

Gets the current shape object in the shape network.

Gets the index of the current shape in the shape network.

The global callback is the interface used by MapWinGIS to pass progress and error events to interested applications.

string ShapeNetwork.Key [get, set]

The key may be used by the programmer to store any string data associated with the object.

Retrieves the last error generated in the object.

Gets the number of shapes in the shape network.

Gets the number of upstream shapes in the network before the next fork.

int ShapeNetwork.ParentIndex [get, set]

Gets the index of the parent of the current shape. If the current shape is the outlet shape in the shape network, -1 will be returned.

Gets the shapefile used to create the network.

 All Classes Files Functions Enumerations Properties