本文整理汇总了C#中IFeatureSet.get_CellValue方法的典型用法代码示例。如果您正苦于以下问题:C# IFeatureSet.get_CellValue方法的具体用法?C# IFeatureSet.get_CellValue怎么用?C# IFeatureSet.get_CellValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IFeatureSet
的用法示例。
在下文中一共展示了IFeatureSet.get_CellValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: buildMergeDownstreamUpStream
private static void buildMergeDownstreamUpStream(IFeatureSet newshed, int IDFieldNum, int LinksFieldNum, int DSFieldNum, int USFieldNum1, int USFieldNum2)
{
for (int i = 0; i <= newshed.NumRows() - 1; i++)
{
string currDSField = newshed.get_CellValue(DSFieldNum, i).ToString();
if (currDSField != "-1")
{
for (int j = 0; j <= newshed.NumRows() - 1; j++)
{
string links = newshed.get_CellValue(LinksFieldNum, j).ToString();
string[] split = links.Split(',');
for (int k = 0; k <= split.Length - 1; k++)
{
if (split[k].Trim() == currDSField)
{
newshed.EditCellValue(DSFieldNum, i, newshed.get_CellValue(IDFieldNum, j));
string upstream1 = newshed.get_CellValue(USFieldNum1, j).ToString();
if (upstream1 == "-1")
{
newshed.EditCellValue(USFieldNum1, j, newshed.get_CellValue(IDFieldNum, i));
}
else
{
newshed.EditCellValue(USFieldNum2, j, newshed.get_CellValue(IDFieldNum, i));
}
break;
}
}
}
}
}
}
示例2: getDrainageFromSubbasin
//.........这里部分代码省略.........
// numPoints = shp.numPoints;
// shp.InsertPoint(pt, numPoints);
// pt = new MapWinGIS.Point();
// pt.x = ext.xMin;
// pt.y = ext.yMax;
// // CWG 24/4/11 add final point to close shape
// pt = new MapWinGIS.Point();
// pt.x = ext.xMin;
// pt.y = ext.yMax;
// numPoints = shp.numPoints;
// shp.InsertPoint(pt, numPoints);
// return shp;
// }
// private static MapWinGIS.Extents getGridExtents(Raster g)
// {
// MapWinGIS.Extents ext = new MapWinGIS.Extents();
// RasterHeader head;
// double centerX;
// double centerY;
// double yHalf;
// double xHalf;
// double xMin;
// double xMax;
// double yMin;
// double yMax;
// // This is fine for speed, but remember this is a reference-copied header
// head = g.Header;
// xHalf = head.dX / 2;
// yHalf = head.dY / 2;
// g.CellToProj(0, 0, out centerX, out centerY);
// xMin = centerX - xHalf;
// yMax = centerY + yHalf;
// g.CellToProj(head.NumberCols - 1, head.NumberRows - 1, out centerX, out centerY);
// xMax = centerX + xHalf;
// yMin = centerY - yHalf;
// ext.SetBounds(xMin, yMin, 0, xMax, yMax, 0);
// return ext;
// }
// #endregion
// #region Binary trees for modelling drainage
/// <summary>
/// Build drainage tree recursively upstream from outlet or reservoir,
/// stopping at inlet, outlet, or reservoir (ignoring point sources)
/// </summary>
/// <param name="shed"></param>
/// <param name="outlets"></param>
/// <param name="haveOutletsShapefile">if this is false any dsnode not -1 stops the tree </param>
/// <param name="isRoot">Flag to avoid stopping on root node, which is an outlet or reservoir</param>
/// <param name="sindx"></param>
/// <param name="dsNodeFieldNum"></param>
/// <param name="us1FieldNum"></param>
/// <param name="us2FieldNum"></param>
/// <returns></returns>
private static BinTree getDrainageFromSubbasin(IFeatureSet shed, IFeatureSet outlets,
bool haveOutletsShapefile, bool isRoot, int sindx,
int dsNodeFieldNum, int us1FieldNum, int us2FieldNum)
{
int nodeID;
int leftID;
int rightID;
int Idx;
BinTree left = null;
BinTree right = null;
nodeID = int.Parse(shed.get_CellValue(dsNodeFieldNum, sindx).ToString());
if ((!isRoot) && (nodeID != -1))
{
if (!haveOutletsShapefile)
{
return null;
}
if (getDSNodeType(outlets, nodeID) != DSNode.PointSource)
{
return null;
}
}
leftID = int.Parse(shed.get_CellValue(us1FieldNum, sindx).ToString());
rightID = int.Parse(shed.get_CellValue(us2FieldNum, sindx).ToString());
if (leftID != -1)
{
Idx = GetBasinIndexByID(shed, leftID);
if (Idx != -1)
{
left = getDrainageFromSubbasin(shed, outlets, haveOutletsShapefile, false, Idx, dsNodeFieldNum, us1FieldNum, us2FieldNum);
}
}
if (rightID != -1)
{
Idx = GetBasinIndexByID(shed, rightID);
if (Idx != -1)
{
right = getDrainageFromSubbasin(shed, outlets, haveOutletsShapefile, false, Idx, dsNodeFieldNum, us1FieldNum, us2FieldNum);
}
}
return new BinTree(sindx, left, right);
}
示例3: GetWshedFromStreamLink
private static int GetWshedFromStreamLink(int streamLink, IFeatureSet streamShape, IFeatureSet shedShape)
{
int streamindx;
const int LinkIDField = 0;
const int WaterShedIDField = 13;
for (streamindx = 0; streamindx <= streamShape.NumRows() - 1; streamindx++)
{
if (int.Parse(streamShape.get_CellValue(LinkIDField, streamindx).ToString()) == streamLink)
{
return int.Parse(streamShape.get_CellValue(WaterShedIDField, streamindx).ToString());
}
}
return -1;
}