Generates a rectangular buffer ArcEngine

Here is certainly generate a buffer is generated based on the point, saying that the buffer is actually generated in accordance with point generating surface. Specific ideas are as follows:
first acquires coordinates of the four vertices to generate a rectangular buffers based on the dot, then these four points to obtain a so-called generation plane rectangular buffer.

// first acquires a buffer points to be generated
the IPoint pPoint new new PointClass = ();
pPoint.X = cPointList [I] .point.X;
pPoint.Y = cPointList [I] .point.Y;
// buffer gets generated the coordinates of four vertices region
IPointCollection new new MultipointClass of pPC = ();
for (int J = 0; J <. 4; J ++)
{
the IPoint pPoint1 new new PointClass = ();
IF (J == 0)
{
pPoint1.X = pPoint .X - 2.55;
pPoint1.Y pPoint.Y = - 2.55;
}
IF (J ==. 1)
{
pPoint1.X pPoint.X = - 2.55;
pPoint1.Y pPoint.Y = + 2.55;
} IF (J == 2)
{
pPoint1.X pPoint.X = + 2.55;
pPoint1.Y pPoint.Y = + 2.55;
} IF (J ==. 3)
{
pPoint1.X pPoint.X = + 2.55;
pPoint1.Y = pPoint.Y - 2.55;
}
pPC.AddPoint(pPoint1);
}
IGeometryCollection pGeometryCollection = new PolygonClass();
Ring ring = new RingClass();
object missing = Type.Missing;
ring.AddPointCollection(Points);
pGeometryCollection.AddGeometry(ring as IGeometry, ref missing, ref missing);
IPolygon polyGonGeo = pGeometryCollection as IPolygon;
polyGonGeo.Close();
polyGonGeo.SimplifyPreserveFromTo();
pGeo =polyGonGeo as IGeometry;
//创建要素
pFeatureBuffer = pFeaClaPolygon.CreateFeatureBuffer();
pFeatureBuffer.Shape = pGeo;
1
2
3
4
5
6
7
8
9
10
. 11
12 is
13 is
14
15
16
. 17
18 is
. 19
20 is
21 is
22 is
23 is
24
25
26 is
27
28
29
30
31 is
32
33 is
34 is
35
36
37 [
38 is
39
40
41 is
the results of FIG: below shows the results point to generate a final rectangular buffer.

This is a graphical after integration.


Of course, during the time required input vertex coordinates in the order, otherwise it will lower this happens:

--------------------- 

Guess you like

Origin www.cnblogs.com/ly570/p/10989755.html