ArcGIS 9.0绘制扇形
终极管理员 知识笔记 130阅读
我写的不多这是互联网上最好的编码的一个问题.如果你愿意的话,请告诉我们。IFeatureClassfeatureClass=GetLayerByName(摄像头的)。FeatureClassIFeaturefeatureForDrawIFeatureCursortmpcur=Base .QueryElement(featureClass,' ');while(true){ featureForDraw=tmp cur .然后功能) ;0,1)'//ob tener Objektif(featureForDraw!=null){ ISimpleFillSymbolpointSymbol=newSimpleFillSymbolClass();点符号风格=ESRI。ArcGIS。display . esrisimplefillstyle . esrisfsnull;点符号。颜色=基础GetRGBColor(255,0,0);ILINESymbollinesymbol=newSimpleLineSymbolClass();线条符号宽度=1.1;线条符号颜色=基础GetRGBColo的
r(255,0,0);pointSymbol.Outline=linesymbol;
IPoint p=featureForDraw.ShapeCopy as IPoint;
//这里用了属性查询,用到前面得到的对象的主字段值。
//IRubberBand pRubberBand=new RubberCircleClass();
ESRI.ArcGIS.Geometry.IConstructCircularArc con=new CircularArcClass();
double FW=40.0;
double zj=0.01; //直径
double jd=1.414;
string _fw=featureForDraw.get_Value(featureForDraw.Fields.FindField("SP_ANGLE")).ToString().Trim();
if(_fw!=string.Empty)
{
FW=double.Parse(_fw);
}
string _zj=featureForDraw.get_Value(featureForDraw.Fields.FindField("BOUND")).ToString().Trim();
if(_zj!=string.Empty)
{
zj=double.Parse(_zj);
}
try
{
//con.ConstructCircle(p,System.Convert.ToDouble(bound_str)/2000,false);
ESRI.ArcGIS.Geometry.ICircularArc cir=new CircularArcClass();
cir=con as ICircularArc;
//重点
cir.PutCoordsByAngle(p,FW*Math.PI/180,40*Math.PI/180,zj);
IPoint 起始点=cir.FromPoint;
IPoint 结束点=cir.ToPoint;
ILine line=new LineClass();
ILine line1=new LineClass();
line.PutCoords(p,起始点);
line1.PutCoords(结束点,p);
ISegmentCollection polygon = new PolygonClass();
object Missing = Type.Missing;
polygon.AddSegment(line as ISegment,ref Missing,ref Missing);
polygon.AddSegment(cir as ISegment,ref Missing,ref Missing);
polygon.AddSegment(line1 as ISegment,ref Missing,ref Missing);
IGeometry geometry =polygon as IGeometry;
object tmpSymbol=(object)pointSymbol;
axMapControl1.DrawShape (geometry,ref tmpSymbol);
}
catch
{
}
}
else
{
break;
}
}
}
catch(Exception ex)
{
System.Console.WriteLine(ex.Message);
}

程序猿们,我也跟风开了网店,主要经营土特产,云南核桃,四川正宗土鸡蛋鸡蛋。有需要的就支持一下小店哈 七彩山川美食()

标签: