static void RunBuffer(IGeometry g, double dist)
        {
            var buf       = g.Buffer(dist);
            var validator = new BufferResultValidator(g, dist, buf);

            if (!validator.IsValid())
            {
                String msg = validator.ErrorMessage;

                Console.WriteLine(msg);
                Console.WriteLine(WKTWriter.ToPoint(validator.ErrorLocation));
                Console.WriteLine(g);
            }
            Assert.IsTrue(validator.IsValid());
        }
Exemplo n.º 2
0
        public static IGeometry BufferValidatedGeom(IGeometry g, double distance)
        {
            var buf       = g.Buffer(distance);
            var validator = new BufferResultValidator(g, distance, buf);
            var isValid   = validator.IsValid();

            return(validator.ErrorIndicator);
        }
        private static void CheckDistance(IGeometry geom, double distance, IGeometry buffer)
        {
            var bufValidator = new BufferResultValidator(geom, distance, buffer);

            if (!bufValidator.IsValid())
            {
                var errorMsg = bufValidator.ErrorMessage;
                var errorLoc = bufValidator.ErrorLocation;
                ReportError(errorMsg, errorLoc);
            }
        }
        void RunTest(String wkt, double dist)
        {
            IGeometry             g         = rdr.Read(wkt);
            IGeometry             buf       = g.Buffer(dist);
            BufferResultValidator validator = new BufferResultValidator(g, dist, buf);

            if (!validator.IsValid())
            {
                String msg = validator.ErrorMessage;

                Console.WriteLine(msg);
                var errorLocation = validator.ErrorLocation;
                if (errorLocation != null)
                {
                    Console.WriteLine(WKTWriter.ToPoint(errorLocation));
                }
                Assert.Fail("The buffer result was not valid");
            }
            Assert.IsTrue(validator.IsValid());
        }
Exemplo n.º 5
0
        void RunTest(string wkt, double dist)
        {
            var g         = rdr.Read(wkt);
            var buf       = g.Buffer(dist);
            var validator = new BufferResultValidator(g, dist, buf);

            if (!validator.IsValid())
            {
                string msg = validator.ErrorMessage;

                //TestContext.WriteLine(msg);
                var errorLocation = validator.ErrorLocation;
                if (errorLocation != null)
                {
                    //TestContext.WriteLine(WKTWriter.ToPoint(errorLocation));
                }
                Assert.Fail("The buffer result was not valid");
            }
            Assert.IsTrue(validator.IsValid());
        }
Exemplo n.º 6
0
 private void AddBufferResultValidatorTest()
 {
     AddTest(new TestCase("Buffer result validator", 20)
     {
         TestMethod = () =>
         {
             if (GetOriginal() is GeometryCollection)
             {
                 return;
             }
             Assert.IsTrue(
                 BufferResultValidator.IsValid(GetOriginal(), _bufferDistance, GetBuffer()),
                 Supplement("BufferResultValidator failure"));
         }
     });
 }