Ejemplo n.º 1
0
        /// <summary>
        /// Find a point from the list of testCoords
        /// that is NOT a node in the edge for the list of searchCoords.
        /// </summary>
        /// <param name="testCoords"></param>
        /// <param name="searchRing"></param>
        /// <param name="graph"></param>
        /// <returns>The point found, or <c>null</c> if none found.</returns>
        public static ICoordinate FindPointNotNode(ICoordinate[] testCoords, ILinearRing searchRing, GeometryGraph graph)
        {
            // find edge corresponding to searchRing.
            Edge searchEdge = graph.FindEdge(searchRing);
            // find a point in the testCoords which is not a node of the searchRing
            EdgeIntersectionList eiList = searchEdge.EdgeIntersectionList;

            // somewhat inefficient - is there a better way? (Use a node map, for instance?)
            foreach (ICoordinate pt in testCoords)
            {
                if (!eiList.IsIntersection(pt))
                {
                    return(pt);
                }
            }
            return(null);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Find a point from the list of testCoords
        /// that is NOT a node in the edge for the list of searchCoords
        /// </summary>
        /// <returns> the point found, or null if none found
        /// </returns>
        internal static Coordinate FindPointNotNode(ICoordinateList testCoords,
                                                    LinearRing searchRing, GeometryGraph graph)
        {
            // find edge corresponding to searchRing.
            Edge searchEdge = graph.FindEdge(searchRing);
            // find a point in the testCoords which is not a node of the searchRing
            EdgeIntersectionList eiList = searchEdge.EdgeIntersectionList;

            // somewhat inefficient - is there a better way? (Use a node map, for instance?)
            for (int i = 0; i < testCoords.Count; i++)
            {
                Coordinate pt = testCoords[i];
                if (!eiList.IsIntersection(pt))
                {
                    return(pt);
                }
            }
            return(null);
        }