public void Test1() { var seq = _factory.CoordinateSequenceFactory.Create(3, Ordinates.XYZM); seq.SetOrdinate(0, Ordinate.X, 0); seq.SetOrdinate(0, Ordinate.Y, 0); seq.SetOrdinate(0, Ordinate.Z, 0); seq.SetOrdinate(0, Ordinate.M, 0); seq.SetOrdinate(1, Ordinate.X, 1000); seq.SetOrdinate(1, Ordinate.Y, 0); seq.SetOrdinate(1, Ordinate.Z, 0); seq.SetOrdinate(1, Ordinate.M, 100); seq.SetOrdinate(2, Ordinate.X, 2000); seq.SetOrdinate(2, Ordinate.Y, 0); seq.SetOrdinate(2, Ordinate.Z, 0); seq.SetOrdinate(2, Ordinate.M, 0); var l = _factory.CreateLineString(seq); var lmf = new LinestringMeasureFilter(Interval.Create(25, 75)); l.Apply(lmf); Assert.IsTrue(lmf.Filtered.Count == 2); var lf = (ILineString)lmf.Filtered[0]; Assert.AreEqual(250, lf.StartPoint.X, 1e-7); Assert.AreEqual(750, lf.EndPoint.X, 1e-7); lf = (ILineString)lmf.Filtered[1]; Assert.AreEqual(1250, lf.StartPoint.X, 1e-7); Assert.AreEqual(1750, lf.EndPoint.X, 1e-7); }
public void Test1() { var seq = _factory.CoordinateSequenceFactory.Create(3, Ordinates.XYZM); seq.SetOrdinate(0, Ordinate.X, 0); seq.SetOrdinate(0, Ordinate.Y, 0); seq.SetOrdinate(0, Ordinate.Z, 0); seq.SetOrdinate(0, Ordinate.M, 0); seq.SetOrdinate(1, Ordinate.X, 1000); seq.SetOrdinate(1, Ordinate.Y, 0); seq.SetOrdinate(1, Ordinate.Z, 0); seq.SetOrdinate(1, Ordinate.M, 100); seq.SetOrdinate(2, Ordinate.X, 2000); seq.SetOrdinate(2, Ordinate.Y, 0); seq.SetOrdinate(2, Ordinate.Z, 0); seq.SetOrdinate(2, Ordinate.M, 0); var l = _factory.CreateLineString(seq); var lmf = new LinestringMeasureFilter(Interval.Create(25, 75)); l.Apply(lmf); Assert.IsTrue(lmf.Filtered.Count == 2); var lf = (LineString)lmf.Filtered[0]; Assert.AreEqual(250, lf.StartPoint.X, 1e-7); Assert.AreEqual(750, lf.EndPoint.X, 1e-7); lf = (LineString)lmf.Filtered[1]; Assert.AreEqual(1250, lf.StartPoint.X, 1e-7); Assert.AreEqual(1750, lf.EndPoint.X, 1e-7); }