Пример #1
0
 /// <summary>
 /// This is where all the work of snapping to hot pixels gets done
 /// (in a very inefficient brute-force way).
 /// </summary>
 private void SnapSegment(Coordinate p0, Coordinate p1, NodedSegmentString ss, int segIndex)
 {
     foreach (var hp in _hotPixels)
     {
         if (hp.Intersects(p0, p1))
         {
             ss.AddIntersection(hp.Coordinate, segIndex);
         }
     }
 }
Пример #2
0
        private void CheckNoding(string wktLine, string wktNodes, int[] segmentIndex, string wktExpected)
        {
            var line = Read(wktLine);
            var pts  = Read(wktNodes);

            var nss  = new NodedSegmentString(line.Coordinates, null);
            var node = pts.Coordinates;

            for (int i = 0; i < node.Length; i++)
            {
                nss.AddIntersection(node[i], segmentIndex[i]);
            }

            var nodedSS = NodingTestUtility.GetNodedSubstrings(nss);
            var result  = NodingTestUtility.ToLines(nodedSS, line.Factory);
            //System.out.println(result);
            var expected = Read(wktExpected);

            CheckEqual(expected, result);
        }
Пример #3
0
 public void AddIntersection(ICoordinate intPt, int segmentIndex)
 {
     _segStr.AddIntersection(intPt, segmentIndex);
 }