GetRightParentFeatures Method
In This Topic
Gets the set of parents (polygon features) that cover this edge. If is true, then only polygons lying to the right of the edge will be returned. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
Parameters
- boundedByEdge
- Indicates whether all parent features that cover this edge are returned. If true, only polygons lying to the right of the edge will be returned. The default value is
true.
Return Value
The set of parents (polygon features) that cover this edge. If is true, then only polygons lying to the right of the edge will be returned.
Exceptions
Example
Explore topology graph
{
static void ExploreTopologyGraph()
{
using (Geodatabase geodatabase = new Geodatabase(new FileGeodatabaseConnectionPath(new Uri(@"C:\TestData\GrandTeton.gdb"))))
using (ArcGIS.Core.Data.Topology.Topology topology = geodatabase.OpenDataset<ArcGIS.Core.Data.Topology.Topology>("Backcountry_Topology"))
{
// Build a topology graph using the extent of the topology dataset.
topology.BuildGraph(topology.GetExtent(), (topologyGraph) =>
{
using (Feature campsites12 = GetFeature(geodatabase, "Campsites", 12))
{
IReadOnlyList<TopologyNode> topologyNodesViaCampsites12 = topologyGraph.GetNodes(campsites12);
TopologyNode topologyNodeViaCampsites12 = topologyNodesViaCampsites12[0];
IReadOnlyList<TopologyEdge> allEdgesConnectedToNodeViaCampsites12 = topologyNodeViaCampsites12.GetEdges();
IReadOnlyList<TopologyEdge> allEdgesConnectedToNodeViaCampsites12CounterClockwise = topologyNodeViaCampsites12.GetEdges(false);
foreach (TopologyEdge edgeConnectedToNodeViaCampsites12 in allEdgesConnectedToNodeViaCampsites12)
{
TopologyNode fromNode = edgeConnectedToNodeViaCampsites12.GetFromNode();
TopologyNode toNode = edgeConnectedToNodeViaCampsites12.GetToNode();
bool fromNodeIsTheSameAsTopologyNodeViaCampsites12 = (fromNode == topologyNodeViaCampsites12);
bool toNodeIsTheSameAsTopologyNodeViaCampsites12 = (toNode == topologyNodeViaCampsites12);
IReadOnlyList<FeatureInfo> leftParentFeaturesBoundedByEdge =
edgeConnectedToNodeViaCampsites12.GetLeftParentFeatures();
foreach (FeatureInfo featureInfo in leftParentFeaturesBoundedByEdge)
{
EnsureShapeIsNotEmpty(featureInfo);
}
IReadOnlyList<FeatureInfo> leftParentFeaturesNotBoundedByEdge =
edgeConnectedToNodeViaCampsites12.GetLeftParentFeatures(false);
foreach (FeatureInfo featureInfo in leftParentFeaturesNotBoundedByEdge)
{
EnsureShapeIsNotEmpty(featureInfo);
}
IReadOnlyList<FeatureInfo> rightParentFeaturesBoundedByEdge =
edgeConnectedToNodeViaCampsites12.GetRightParentFeatures();
foreach (FeatureInfo featureInfo in rightParentFeaturesBoundedByEdge)
{
EnsureShapeIsNotEmpty(featureInfo);
}
IReadOnlyList<FeatureInfo> rightParentFeaturesNotBoundedByEdge =
edgeConnectedToNodeViaCampsites12.GetRightParentFeatures(false);
foreach (FeatureInfo featureInfo in rightParentFeaturesNotBoundedByEdge)
{
EnsureShapeIsNotEmpty(featureInfo);
}
}
}
});
}
static void EnsureShapeIsNotEmpty(FeatureInfo featureInfo)
{
using (Feature feature = featureInfo.GetFeature())
{
// Process feature ...
}
}
}
}
Requirements
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)
ArcGIS Pro version: 3.0 or higher.
See Also