/// <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); }
/// <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); }