ArcGIS Engine analysis of spatial buffer analysis realization

Analysis results buffer (BufferAnalysis) is a planar element - i.e. the buffer element , feature point, line and polygon-shaped elements, after being treated analysis buffer to produce a buffer area around them, i.e., the new region the planar elements is generated.

In the direction of the buffer, and linear feature point feature buffer only outwardly, planar elements may be bidirectional buffer - Buffer outwardly and inwardly buffer .

In ArcGIS Engine, the buffer was analyzed by ITopologicalOperator.Buffer (double Distance) is achieved, the function's return value IGeometry (Table 5-12). Wherein the input parameter is timing out buffer, the buffer is negative inwardly.

 

The basic idea is to achieve a buffer analysis:

1, from a buffer

2, call ITopologicalOperator.Buffer () method to generate a buffer

3, add a buffer to axMapControl in.

// 
// Summary:
 //      Constructs A Polygon The locus of Points that IS AT A Distance Within last less or equal
 //      . A specified to the this Geometry Distance from
 //        Construct a polygon, the polygon geometry this distance is less than or equal to the specified track point distance. 
Buffer IGeometry ( Double Distance);

Parameter (1) Buffer Method
Bulfer method of carrying only a single argument: distance, which is provided to a buffer distance. Digital input buffer is positive outwardly; inwardly buffer is negative (only planar objects).


The basic idea (2) function Buffer
Buffer methods did not produce a new class feature (Feature Class), because the return value of the method Buffer lGeometry, only the geometry of the element, does not carry any element property characteristics.

Therefore, in the ArcGIS Engine, Buffer feature object does not lead to a direct result buffer.

Bufer shows the trigger button event, as shown:

 

Buffer analysis function: BufferArea (double BuffDistance)

///  <Summary> 
/// buffer analysis function
 ///  </ Summary> 
///  <param name = "BuffDistance"> Buffer Distance </ param> 
Private  void BufferArea ( Double BuffDistance) 
{ 
    // a master map add buffer objects 
    IGraphicsContainer GraphicsContainer = axMapControl1.Map aS IGraphicsContainer;
     // remaining before deleting all of the elements 
    graphicsContainer.DeleteAllElements ();
     // select the index value of the layer 0 
    ILayer layer = axMapControl1.get_Layer ( 0 );
     / / this loop is used to find the layer named LayerName index layer 
    / * 
    the ILayer layer = null;
    for (int I = 0; I <axMapControl1.LayerCount; I ++) 
    { 
        IF (axMapControl1.get_Layer (I) .Name.Equals ( "Layer-the Name")) 
        { 
            Layer = axMapControl1.get_Layer (I); 
            BREAK; 
        } 
    } 
    * / 
    // the layer named LayerName layer turned into a strong feature selection set 
    IFeatureSelection pFtSel = (IFeatureLayer) layer aS IFeatureSelection;
     // to all elements LayerName layer named layers added selections 
    pFtSel.SelectFeatures ( null , esriSelectionResultEnum.esriSelectionResultNew, false ); 

    ICursor pCursor; 
    // get traverse the selection set of all elements of cursors 
    pFtSel.SelectionSet.Search ( null, False , OUT pCursor); 
    IFeatureCursor pFtCursor = pCursor AS IFeatureCursor; 
    IFeature PFT = pFtCursor.NextFeature ();
     // loop through all the elements of all the selection set, one by one the elements to create a buffer 
    the while ! (PFT = null ) 
    { 
        // will feature geometric object (pFt.Shape) turn into strong ITopologicalOperator
         // pFt.Shape is the creation of an object buffer 
        ITopologicalOperator topologicalOperator = pFt.Shape aS ITopologicalOperator;
         // NOTE: BuffDIstance timing input buffer outwardly negative inward buffer 
        the IPolygon Polygon = topologicalOperator.Buffer (BuffDistance) ASThe IPolygon;
         // instantiated to load the buffer elements 
        IElement Element = new new PolygonElement ();
         // a polygonal geometric elements assigned 
        element.Geometry = Polygon;
         // show each 
        graphicsContainer.AddElement (Element, 0 );
         // points to the next a 
        PFT = pFtCursor.NextFeature (); 
    } 
    // here clear the selection set, so as a result the buffer element highlighted confused with each other 
    pFtSel.Clear ();
     // refresh axMapControl1 
    axMapControl1.Refresh (); 
}  

 

The core buffer analysis function Summary:

 

 

Thanks for watching! I am a novice GIS secondary development, if there is something wrong, please forgive me!

 

Guess you like

Origin www.cnblogs.com/edcoder/p/11797487.html