本文整理汇总了C#中DotSpatial.Data.FeatureSet.NumRows方法的典型用法代码示例。如果您正苦于以下问题:C# FeatureSet.NumRows方法的具体用法?C# FeatureSet.NumRows怎么用?C# FeatureSet.NumRows使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DotSpatial.Data.FeatureSet
的用法示例。
在下文中一共展示了FeatureSet.NumRows方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildJoinedBasins
/// <summary>
/// Overload of BuildJoinedBasins that takes an outlets shape path used for Inlets resolution. If no outlets/inlets path given, it will treat all points as outlets
/// </summary>
// 2/11/09 rewritten by Chris George to dramatically improve speed:
// (a) use utils.ClipPolygon instead of SpatialOperations.MergeShapes
// (b) create a binary tree modeling the drainage pattern of the subbasins
// (b) merge "upstream-first" using the drainage tree so that each merge combines abutting polygons
public static bool BuildJoinedBasins(string subBasinShapePath, string outletsShapePath, string joinBasinShapeResultPath, IProgressHandler callback)
{
var shapeIdxList = new ArrayList();
BinTree drainage;
IFeatureSet outlets = null;
if (outletsShapePath != string.Empty)
{
outlets = FeatureSet.Open(outletsShapePath);
}
var shed = FeatureSet.Open(subBasinShapePath);
var dsNodeFieldNum = -1;
var dsShedFieldNum = -1;
var us1FieldNum = -1;
var us2FieldNum = -1;
for (var i = 0; i < shed.DataTable.Columns.Count; i++)
{
switch (shed.DataTable.Columns[i].ColumnName.ToUpper())
{
case "DSNODEID":
dsNodeFieldNum = i;
break;
case "DSWSID":
dsShedFieldNum = i;
break;
case "US1WSID":
us1FieldNum = i;
break;
case "US2WSID":
us2FieldNum = i;
break;
}
}
//DataManagement.DeleteShapefile(joinBasinShapeResultPath);
var newShed = new FeatureSet();
newShed.FeatureType = FeatureType.Polygon;
newShed.Filename = joinBasinShapeResultPath;
var idfieldnum = AddField(newShed, "MWShapeID", typeof(int));
var linkfieldnum = AddField(newShed, "LinkIDs", typeof(string));
var outletfieldnum = AddField(newShed, "OutletID", typeof(int));
var dswsfieldnum = AddField(newShed, "DSWSID", typeof(int));
var uswsfieldnum1 = AddField(newShed, "USWSID1", typeof(int));
var uswsfieldnum2 = AddField(newShed, "USWSID2", typeof(int));
var reservoirfieldnum = AddField(newShed, "Reservoir", typeof(int));
var oldperc = 0;
for (var sindx = 0; sindx < shed.NumRows(); sindx++)
{
if (shed.NumRows() > 1)
{
var newperc = Convert.ToInt32((Convert.ToDouble(sindx) / Convert.ToDouble(shed.NumRows())) * 100);
if (newperc > oldperc)
{
if (callback != null)
{
callback.Progress("Status", newperc, "Merging Watersheds to Outlets/Inlets");
}
oldperc = newperc;
}
}
DSNode dsNodeType = DSNode.Outlet;
var dsNodeVal = int.Parse(shed.get_CellValue(dsNodeFieldNum, sindx).ToString());
if (dsNodeVal > -1)
{
// an outlet, inlet, reservoir or point source
if (outletsShapePath == string.Empty)
{
// assume this is an outlet
drainage = getDrainageFromSubbasin(shed, outlets, false, true, sindx, dsNodeFieldNum, us1FieldNum, us2FieldNum);
}
else
{
dsNodeType = getDSNodeType(outlets, dsNodeVal);
if ((dsNodeType == DSNode.Outlet) || (dsNodeType == DSNode.Reservoir))
{
if (isUpstreamOfInlet(shed, outlets, sindx))
{
drainage = null;
}
else
{
drainage = getDrainageFromSubbasin(shed, outlets, true, true, sindx, dsNodeFieldNum, us1FieldNum, us2FieldNum);
}
}
//.........这里部分代码省略.........