public void CanCreateBuffer() { IPolygon original = GeometryFactory.CreatePolygon(100, 100, 150, 200); IPolygon buffer = GeometryFactory.CreateBuffer(original, 100); Assert.AreEqual(250, buffer.Envelope.Width, 0.01); Assert.AreEqual(300, buffer.Envelope.Height, 0.01); }
public void MeasureCreateBufferPerformance() { const int iterations = 100; IEnumerable <IGeometry> sources = GetBufferInput(iterations); var watch = new Stopwatch(); watch.Start(); foreach (IGeometry source in sources) { GeometryFactory.CreateBuffer(source, 10); } watch.Stop(); Console.Out.WriteLine("CreateBuffer: {0:N2} ms per geometry", (double)watch.ElapsedMilliseconds / iterations); }