本文整理汇总了C#中DotSpatial.Data.FeatureSet.Save方法的典型用法代码示例。如果您正苦于以下问题:C# FeatureSet.Save方法的具体用法?C# FeatureSet.Save怎么用?C# FeatureSet.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DotSpatial.Data.FeatureSet
的用法示例。
在下文中一共展示了FeatureSet.Save方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuildJoinedBasins
//.........这里部分代码省略.........
shapeIdxList.Clear();
if (drainage != null)
{
char[] sep = { ',' };
var idxs = drainage.ToString().Split(sep);
for (var i = 0; i < idxs.Length; i++)
{
shapeIdxList.Add(idxs[i]);
}
}
if (shapeIdxList.Count != 0)
{
IFeature mergeShape;
string strLinks;
if (shapeIdxList.Count == 1)
{
mergeShape = shed.get_Shape(int.Parse(shapeIdxList[0].ToString()));
strLinks = shed.get_CellValue(0, int.Parse(shapeIdxList[0].ToString())).ToString();
}
else
{
strLinks = shed.get_CellValue(0, int.Parse(shapeIdxList[0].ToString())).ToString();
for (int i = 1; i <= shapeIdxList.Count - 1; i++)
{
strLinks = strLinks + ", " + shed.get_CellValue(0, int.Parse(shapeIdxList[i].ToString()));
}
DateTime time = DateTime.Now;
mergeShape = mergeBasinsByDrainage(shed, drainage);
var elapsed = DateTime.Now.Subtract(time);
Trace.WriteLine("Made merged watershed of " + shapeIdxList.Count +
" subbasins in " + elapsed.TotalSeconds.ToString("F1") + " seconds");
}
// Check merged shape for single part and clockwise
if (mergeShape.NumGeometries > 1)
{
Trace.WriteLine("Merged polygon has " + mergeShape.NumGeometries + " parts");
}
else
{
var area = SignedArea(mergeShape);
if (area < 0)
{
Trace.WriteLine("Needed to reverse merged polygon");
mergeShape = ReverseShape(mergeShape);
}
}
var currshpidx = newShed.NumRows();
newShed.AddFeature(mergeShape);
newShed.EditCellValue(idfieldnum, currshpidx, currshpidx);
newShed.EditCellValue(linkfieldnum, currshpidx, strLinks);
newShed.EditCellValue(outletfieldnum, currshpidx, dsNodeVal);
if (int.Parse(shed.get_CellValue(dsShedFieldNum, sindx).ToString()) != -1)
{
newShed.EditCellValue(dswsfieldnum, currshpidx, shed.get_CellValue(dsShedFieldNum, sindx));
}
else
{
newShed.EditCellValue(dswsfieldnum, currshpidx, -1);
}
newShed.EditCellValue(uswsfieldnum1, currshpidx, -1);
newShed.EditCellValue(uswsfieldnum2, currshpidx, -1);
if (dsNodeType == DSNode.Reservoir)
{
newShed.EditCellValue(reservoirfieldnum, currshpidx, 1);
}
else
{
newShed.EditCellValue(reservoirfieldnum, currshpidx, 0);
}
}
}
}
buildMergeDownstreamUpStream(newShed, idfieldnum, linkfieldnum, dswsfieldnum, uswsfieldnum1, uswsfieldnum2);
newShed.Projection = shed.Projection;
shed.Close();
newShed.Save();
newShed.Close();
if (outletsShapePath != string.Empty)
{
outlets.Close();
}
if (callback != null)
{
callback.Progress(string.Empty, 0, string.Empty);
}
return true;
}