Exemplo n.º 1
0
 public void test1()
 {
     Assert.IsTrue(PointLocation.IsOnLine(new Coordinate(10, 10),
                                          new Coordinate[] { new Coordinate(0, 10), new Coordinate(20, 10) }));
     Assert.IsTrue(!PointLocation.IsOnLine(new Coordinate(30, 10),
                                           new Coordinate[] { new Coordinate(0, 10), new Coordinate(20, 10) }));
 }
        private void CheckOnLine(double x, double y, string wktLine, bool expected)
        {
            var line = (LineString)this.Read(wktLine);

            Assert.That(PointLocation.IsOnLine(new Coordinate(x, y), line.Coordinates), Is.EqualTo(expected));
            Assert.That(PointLocation.IsOnLine(new Coordinate(x, y), line.CoordinateSequence), Is.EqualTo(expected));
        }
        void CheckOnLine(double x, double y, string wktLine, bool expected)
        {
            var line = (LineString)Read(wktLine);

            Assert.AreEqual(expected, PointLocation.IsOnLine(new Coordinate(x, y), line.Coordinates));
            Assert.AreEqual(expected, PointLocation.IsOnLine(new Coordinate(x, y), line.CoordinateSequence));
        }
Exemplo n.º 4
0
        public void TestA()
        {
            var p1 = new Coordinate(-123456789, -40);
            var p2 = new Coordinate(381039468754763d, 123456789);
            var q  = new Coordinate(0, 0);
            var l  = new GeometryFactory().CreateLineString(new Coordinate[] { p1, p2 });
            var p  = new GeometryFactory().CreatePoint(q);

            Assert.AreEqual(false, l.Intersects(p));
            Assert.AreEqual(false, PointLocation.IsOnLine(q, new Coordinate[] { p1, p2 }));
            Assert.AreEqual(OrientationIndex.Clockwise, Orientation.Index(p1, p2, q));
        }