- 积分
- 797
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-8-1
- 最后登录
- 1970-1-1

|

楼主 |
发表于 2013-3-7 22:19:42
|
显示全部楼层
使用最新的文件,仍然存在这个问题。完整代码
string strShapeFolder = System.IO.Path.GetDirectoryName(sShapeFullName);
string strShapeFile = System.IO.Path.GetFileName(sShapeFullName);
//New layer
VectorLayer aLayer = new VectorLayer(ShapeTypes.Polyline);
aLayer.LayerName = strShapeFile;
aLayer.LegendScheme = LegendManage.CreateSingleSymbolLegendScheme(ShapeTypes.Polyline, Color.Black, 1);
//aLayer.LegendScheme = LegendManage.CreateUniqValueLegendScheme(
aLayer.Visible = true;
//Add fields
aLayer.EditAddField("Type", typeof(string));
aLayer.EditAddField("Value", typeof(double));
//Add shape
for (int i = 0; i < _contourLines.Count; i++)
{
PolylineShape aPL = new PolylineShape();
for (int j = 0; j < _contourLines[i].PointList.Count; j++)
{
MeteoInfoC.PointD aPoint = new MeteoInfoC.PointD();
aPoint.X = _contourLines[i].PointList[j].X;
aPoint.Y = _contourLines[i].PointList[j].Y;
aPL.Points.Add(aPoint);
}
int shapeNum = aLayer.ShapeNum;
if (aLayer.EditInsertShape(aPL, shapeNum))
{
//Edit record value
aLayer.EditCellValue("Type", shapeNum, _contourLines[i].Type);
aLayer.EditCellValue("Value", shapeNum, _contourLines[i].Value);
}
}
m_MainMapView.AddLayer(aLayer);
m_MainMapView.Refresh();
其中, _contourLines为wContour生成的等值线。我所用的数据为模式输出的网格数据,量比较大。
|
|