/// <summary> /// Label an isolated node with its relationship to the target point. /// </summary> /// <param name="n"></param> /// <param name="targetIndex"></param> private void LabelIsolatedNode(GraphComponent n, int targetIndex) { LocationType loc = _ptLocator.Locate(n.Coordinate, _arg[targetIndex].Geometry); n.Label.SetAllLocations(targetIndex, loc); }
/// <summary> /// Label an isolated edge of a graph with its relationship to the target point. /// If the target has dim 2 or 1, the edge can either be in the interior or the exterior. /// If the target has dim 0, the edge must be in the exterior. /// </summary> /// <param name="e"></param> /// <param name="targetIndex"></param> /// <param name="target"></param> private void LabelIsolatedEdge(GraphComponent e, int targetIndex, IGeometry target) { // this won't work for GeometryCollections with both dim 2 and 1 geoms if (target.Dimension > 0) { // since edge is not in boundary, may not need the full generality of PointLocator? // Possibly should use ptInArea locator instead? We probably know here // that the edge does not touch the bdy of the target Geometry LocationType loc = _ptLocator.Locate(e.Coordinate, target); e.Label.SetAllLocations(targetIndex, loc); } else e.Label.SetAllLocations(targetIndex, LocationType.Exterior); }