示例#1
0
        /// <summary>
        /// This code demonstrates how to use DotSpatial.Analysis.Buffer.AddBuffer.
        /// </summary>
        /// <param name="fileName">Path of your shapefile (e.g. C:\myShapefile.shp).</param>
        public static void AnalysisBufferAddBuffer(string fileName)
        {
            // Pass in the file path of the shapefile that will be opened
            IFeatureSet fs = FeatureSet.Open(fileName);

            // create an output feature set of the same feature type
            IFeatureSet fs2 = new FeatureSet(fs.FeatureType);

            // buffer the features of the first feature set by 10 and add them to the output feature set
            Buffer.AddBuffer(fs, 10, fs2);
        }
示例#2
0
 private void AllocateAllBuffers(int bufferSize, int buffers)
 {
     FreeAllBuffers();
     if (buffers > 0)
     {
         _buffers = new Buffer(_wave, bufferSize);
         _buffers.AddBuffer();
         var prevBuffer = _buffers;
         try
         {
             for (int bufferIndex = 1; bufferIndex < buffers; bufferIndex++)
             {
                 var buffer = new Buffer(_wave, bufferSize);
                 buffer.AddBuffer();
                 prevBuffer.Next = buffer;
                 prevBuffer      = buffer;
             }
         }
         finally { prevBuffer.Next = _buffers; }
         _currentBuffer = _buffers;
     }
 }