/// <summary> /// /// </summary> /// <param name="geomIndex"></param> /// <param name="p"></param> /// <param name="geom"></param> /// <returns></returns> private Location GetLocation(int geomIndex, Coordinate p, GeometryGraph[] geom) { // compute location only on demand if (_ptInAreaLocation[geomIndex] == Location.Null) _ptInAreaLocation[geomIndex] = SimplePointInAreaLocator.Locate(p, geom[geomIndex].Geometry); return _ptInAreaLocation[geomIndex]; }
protected override void RunPtInRing(Location expectedLoc, Coordinate pt, string wkt) { var geom = _reader.Read(wkt); var loc = new SimplePointInAreaLocator(geom); var result = loc.Locate(pt); Assert.AreEqual(expectedLoc, result); }
/// <summary> /// /// </summary> /// <param name="geomIndex"></param> /// <param name="p"></param> /// <param name="geom"></param> /// <returns></returns> public virtual Locations GetLocation(int geomIndex, ICoordinate p, GeometryGraph[] geom) { // compute location only on demand if (ptInAreaLocation[geomIndex] == Locations.Null) { ptInAreaLocation[geomIndex] = SimplePointInAreaLocator.Locate(p, geom[geomIndex].Geometry); } return(ptInAreaLocation[geomIndex]); }
internal virtual int GetLocation(int geomIndex, Coordinate p, GeometryGraph[] geom) { // compute location only on demand if (ptInAreaLocation[geomIndex] == LocationType.None) { ptInAreaLocation[geomIndex] = SimplePointInAreaLocator.Locate(p, geom[geomIndex].Geometry); } return(ptInAreaLocation[geomIndex]); }
/// <summary> /// Tests whether any component of the target geometry intersects the test geometry (which must be an areal geometry) /// </summary> /// <param name="testGeom">The test geometry</param> /// <param name="targetRepPts">The representative points of the target geometry</param> /// <returns>true if any component intersects the areal test geometry</returns> protected bool IsAnyTargetComponentInAreaTest(Geometry testGeom, IList <Coordinate> targetRepPts) { var piaLoc = new SimplePointInAreaLocator(testGeom); foreach (var p in targetRepPts) { var loc = piaLoc.Locate(p); if (loc != Location.Exterior) { return(true); } } return(false); }