Common ArcEngine topology Interfaces

Source: Internet
Author: User

Topology is a set of topological relationships between Feature classes under the same Feature set (FeatureDataset. Therefore, to participate in all the element classes of a topology, the topology check must be accurate within the same element set (that is, with the same spatial reference. One element set can have multiple topologies, but each element class can only participate in one topology. Multiple rules can be defined in one topology.

Topology analysis process:
1. Create a topology (add topology Rules)
Ii. Verify Topology
3. Ensure that the topology is correct during editing
4. query the existing topology IN THE SYSTEM
**************************************** ***************************************

I. Topology creation method:
1: Use ArcCatalog to create a desktop;
2: Use the program (ArcEngine) to develop and establish the topology;

The implementation interface for establishing a topology in the Engine is ITopologyContainer: CreateTopology;
The ITopologyContainer: CreateTopology method is used to create a topology;

Interface Description:
ITopologyContainer is a platform container used to create, add, and manage topologies;
This interface allows you to understand the topology information of the current element set, such as the name. If you only want to obtain the topology information of the element set, we recommend that you use IFeatureDatasetNames instead of enabling the topology :: the TopologyNames method can be obtained quickly.
Once the topology is created using the CreateTopology method, the parameters of this topology cannot be changed. To change the topology, You need to delete or re-create a new topology.
DefaultClusterTolerance is the default "tolerance" for topology creation ";
MaximumClusterTolerance indicates the maximum "Tolerance ";
MinimumClusterTolerance indicates the minimum "Tolerance ";
If the tolerance parameter you use when creating a topology is between the maximum and minimum, the parameter is valid. For example, if the tolerance parameter is between the maximum and minimum, the process is based on the extreme values (the maximum and the minimum; note that the default tolerance is the same as the minimum tolerance;

Create a topology rule:
Use the ITopologyRuleContainer interface;

Interface Description:
The IRule interface is the interface for defining rules in the Engine. Its Type attributes include the following:
To create a topology rule, we will use esriRTTopology and use the ITopologyRule interface to implement the topology rule.
And add the defined rule to the current topology through the ITopologyRuleContainer interface (AddRule method ).
The ITopology interface and the ITopologyRuleContainer interface inherit from the Topology class, so they can be QI.

Note:
1: When all elements in the element set have participated in the creation of other topologies, using the used element class to create a new topology will produce an error;
2: When the element has been involved in the Geometry Network operation, the topology creation error also occurs;
3: The target element class is a note layer or multi-dimensional layer, and the topology cannot be created;
4: The target element category has been registered as a version, so no topology can be created;

Ii. Topology verification (validate) method:
1: After setting up the topology of ArcCatalog, you can choose to directly verify the topology;
2: You can also verify the topology created In ArcMap (the element must be in the Edit state Start Edit), and then you can Edit the topology;
3: Use the program for verification;

The ITopology method ValidateTopology is used to verify the topology in the specified region. Note that no version is available
Topology can be verified at any time. A version topology must be verified in the edit session.

After verification, the current topology can check the corresponding topology error and generate the topology layer ITopologyLayer.
The ITopologyLayer is actually a layer, inheritance and layer class.

Interface Description:
The ITopologyLayer interface has a method for rendering Renderer. You can perform classification rendering based on the topology error information (esriTopologyRenderer.

3. Topology Editing:
After verifying the topology, You need to edit and change the current topology error.
During topology editing, we need to know the concept of TopologyGraph;

What is TopologyGraph?
In fact, after topology analysis, we need to pair the wrong line and point (because the polygon is also composed of wired and vertices)
Edit to modify the current element error. Generate a TopologyGraph topology before editing.
Displays Nodes, Edges, and other information to be modified. Our edits are actually performed on TopologyGraph.
As mentioned above, when the ITopologyLayer is created, the Cache exists in the memory.
The topology graph TopologyGraph is created using the ITopologyLayer Cache. The method is as follows:
// TopoLayer is an open topology Layer
ITopologyGraph pTG = topoLayer. Topology. Cache;
PTG. Build (pA. Extent, false); Create a topology, where pA. Extent Is the scope to be analyzed;

Interface Description:
In the attribute method of the interface, we can see many operations on element editing. That's right. A large part of topology editing is actually done using this method. Such as cutting, rebuilding, and deleting.
The HitTest method is used to obtain the Edges and Nodes;

You can use ITopologyNode and ITopologyEdge to obtain edges and vertices for editing.

You can use the ITopologyErrorFeature interface to obtain the element Feature that produces errors. It inherits from the Feature class.
Whether the error in the current TopologyLayer is available through the ITopologyErrorSelection interface;
ITopologyExtension is an extension of the current topology, including the style symbol for setting error elements.
Note: This interface can only be obtained under the Desktop license, and the Engine cannot be used. Then someone will ask: "If we change the color of the topology layer and Topology elements, the Engine will not be able to do it ?"
Oh, of course not. Don't forget the ITopologyLayer interface I mentioned earlier.
Using this interface, we can also perform renderer rendering on layers. For more information, see the help documentation!

Topology elements (Node and Edges)

After editing, we can submit the changes.
ITopologyGraph: THE Post method submits the edits.
Partially edited code:
**************************************** ***********
Set pTopologyGraph = pTopology. Cache
PTopologyGraph. Build
PMxDoc. ActiveView. Extent, False
Set pEnumTopologyEdge = pTopologyGraph. Edges
Set pTopologyEdge = pEnumTopologyEdge. Next
Bsel = pTopologyGraph. Select (esriTopologySelectionResultNew, pTopologyEdge)
Set pAffine = New AffineTransformation2DpAffine. Move 10, 10
PTopologyGraph. TransformSelection esriTransformForward, pAffine, False
PTopologyGraph. Post pGDset. Extent
''Submit for editing
**************************************** ************

This completes the entire topology creation, verification, and editing process.
If you want to view the topology, you can use the ITopologyWorkspace: OpenTopology method to open the topology.

Important:
If we are not satisfied with the current topology and need to delete it, we first need to clear the element class removeclass (Itopology Interface) in the current topology, and then delete (Dataset Interface) topology, otherwise, an error occurs.

Appendix:
I. Topology Error Type in the topology data layer (ItopologyLayer): As a layer, renderer rendering can be performed. The following types can also be rendered;
EsriTRAreaErrors
0 Area Error renderer.
EsriTRLineErrors
1 Line Error renderer.
EsriTRPointErrors
2 Point Error renderer.
EsriTRAreaExceptions
3 Polygon Exception renderer.
EsriTRLineExceptions
4 Line Exception renderer.
EsriTRPointExceptions 5 Point Exception renderer.
EsriTRDirtyAreas
6 Dirty Area renderer

Ii. Geodatabase Topology rules:

Polygon topology rules
1. must not overlay: single element class, polygon elements cannot overlap with each other
2. must not have gaps: Single-element class. There cannot be blank areas (non-data areas) in the consecutive polygon areas)
3. contains point: polygon + point. The boundary of each element of the polygon element class must contain at least one point in the vertex layer.
4. boundary must be covered by: polygon + line. The boundary Layer boundary overlaps with the line layer (the line layer can have more non-overlapping elements)
5. must be covered by feature class of: polygon + polygon, the first polygon layer must be completely covered by the second (the relationship between the Province and the country)
6. must be covered by: polygon + polygon. The first polygon layer must completely overwrite the second one (the relationship between China and the province)
7. must not overlay with: polygon + polygon. The polygon of two Polygon Layers cannot have a pair of overlapping elements.
8. must cover each other: polygon + polygon. The elements of the two polygon must overlap completely.
9. area boundary must be covered by boundary of: polygon + polygon. Each element of the first polygon must be completely overwritten by one or more polygon of the second polygon.
10. must be properly inside polygons: Point + polygon. All elements of the Point layer must be within the polygon.
11. must be covered by boundary of: Point + polygon. The point must be on the boundary of the polygon.

Line topology rules
1. must not have dangle: line, cannot have hanging nodes
2. must not have pseudo-node: line, cannot have pseudo nodes
3. must not overlay: line, cannot overlap with line (between different elements)
4. must not self overlay: line. One element cannot overwrite itself.
5. must not intersect: line, cannot be wired * (between different elements)
6. must not self intersect: line, cannot be wired *
7. must not intersect or touch interrior: Line, which cannot overlap or overlap
8. must be single part: line. A line element can only consist of one path.
9. must not covered with: line + line, two layers of lines cannot overlap
10. must be covered by feature class of: line + line, two layers of lines completely overlap
11. endpoint must be covered by: line + point. The end point in the line layer must overlap with some (or all) points in the point layer.
12. must be covered by boundary of: line + polygon, line overlapped by Polygon boundary
13. must be covered by endpoint of: Point + line. The point is completely overlapped by the end point.
14. point must be covered by line: point + line. All vertices are online.

This article from the CSDN blog, reproduced please indicate the source: http://blog.csdn.net/yzg686/archive/2009/12/24/5071129.aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.