My environment is win2003 ,arcsever9.3(c#) ,vs2008, sde(sqlserver2005) My data is string strpoint1 = "110.487339726558,31.3602083855353,0 110.491448987015,31.3577775549622,0 110.487571233632,31.3549994637781,0 110.484619511243,31.3555782323626,0 110.487339726558,31.3602083855353,0"; string strpoint2 = "110.48728184889,31.358356324446,0 110.486934587379,31.3569094016358,0 110.488323633421,31.3572566631463,0 110.48728184889,31.358356324446,0"; I want to create one donut featureclass in sde polygon layer in ao (adf) by above data(2 strings)? (I expains about 2 strings , and strpoint1 contains strpoint2. Now I want get one donut(strpoint1 -strpoint2)) Who can help me ?
// Add donut hole PolygonA to PolygonB (IPolygon) AddHole(polygonB, polygonA); // PolygonA is wholly contained by PolygonB
// Outer poly graphic ESRI.ArcGIS.ADF.Web.Display.Graphics.GraphicElement ge = new ESRI.ArcGIS.ADF.Web.Display.Graphics.GraphicElement(); ge.Symbol = sfSymOutside;// A simple fill symbol defined elsewhere
// Add donut graphic to the map ESRI.ArcGIS.ADF.Web.Geometry.Polygon pTemp = ConvertIPolygonToWebPolygon((IPolygon)polygonB); // Must be converted in the ArcGIS Server world ge.Geometry = (ESRI.ArcGIS.ADF.Web.Geometry.Geometry)pTemp; ((ESRI.ArcGIS.ADF.Web.Display.Graphics.ElementGraphicsLayer)GResource.Graphics.Tables["myLayer"]).Add(ge); }
for (int i = 0; i < new_adf_points.Length - 1; i++) { new_adf_pointcollection.Add(new_adf_points); } ESRI.ArcGIS.ADF.Web.Geometry.Ring new_adf_ring = new ESRI.ArcGIS.ADF.Web.Geometry.Ring();
new_adf_ring.Points = new_adf_pointcollection;
ESRI.ArcGIS.ADF.Web.Geometry.RingCollection new_adf_ringcollection = new ESRI.ArcGIS.ADF.Web.Geometry.RingCollection(); new_adf_ringcollection.Add(new_adf_ring);
ESRI.ArcGIS.ADF.Web.Geometry.Polygon new_adf_polygon = new ESRI.ArcGIS.ADF.Web.Geometry.Polygon(); new_adf_polygon.Rings = new_adf_ringcollection;
return new_adf_polygon; } codes above don't run wrong but it can't get ideal results Error points are 1 if (((IRelationalOperator)(polygonA)).Within(polygonB)) useless�? 2polygonB aren't donut and it is one common polygon )