예제 #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="p"></param>
 /// <param name="ring"></param>
 /// <returns></returns>
 private static LocationType LocateInPolygonRing(Coordinate p, IBasicGeometry ring)
 {
     // can this test be folded into IsPointInRing?
     if (CgAlgorithms.IsOnLine(p, ring.Coordinates))
     {
         return(LocationType.Boundary);
     }
     if (CgAlgorithms.IsPointInRing(p, ring.Coordinates))
     {
         return(LocationType.Interior);
     }
     return(LocationType.Exterior);
 }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="p"></param>
        /// <param name="l"></param>
        /// <returns></returns>
        private static LocationType LocateInLineString(Coordinate p, ILineString l)
        {
            IList <Coordinate> pt = l.Coordinates;

            if (!l.IsClosed)
            {
                if (p.Equals(pt[0]) || p.Equals(pt[pt.Count - 1]))
                {
                    return(LocationType.Boundary);
                }
            }
            if (CgAlgorithms.IsOnLine(p, pt))
            {
                return(LocationType.Interior);
            }
            return(LocationType.Exterior);
        }