A method and system for merging and splitting basic geographic surface elements
Through the method of interrupting virtual line segments at intersection points, it realizes rapid merge, split and pruning of basic geographical features in CAD, solving the problem of insufficient functions in existing CAD software when processing multi-layer topographic maps, and improving operational efficiency and data quality.
Patent Information
- Application Number
- CN202310667169.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-07
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2043-06-07
AI Technical Summary
Existing CAD software does not have enough functions when processing and editing basic geographic data (topographic maps) containing multiple layers, especially in merging, splitting, pruning and other operations, and cannot be quickly implemented.
The method of interrupting virtual line segments by forming closed surfaces, combining, splitting and trimming in CAD, and combining surface shading display and redundant point sparseness, realizes rapid merger, splitting and basic geographical surface elements by forming closed surfaces, and prune.
It realizes the rapid merge, split and pruning of opposite elements in CAD, reducing data redundancy, and improving production efficiency and product quality.
Smart Images

Figure CN117113472B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of graphics processing software, and in particular to a method and system for merging and splitting basic geographic surface elements. Background Art
[0002] With the continuous development of geographic information systems and their deepening application in various fields, various forms of geographic information data need to be processed and published. CAD graphic files are a common file format currently used by domestic surveying and mapping products. The main work in CAD is vector acquisition and graphic processing of land objects. Surface elements - as one of the main components of graphics, they are often used to represent important geographical elements such as buildings, roads, and water systems. They need to be processed for graphic synthesis and display to meet the needs of results. The CAD body has few functions for graphic processing and requires various secondary developments;
[0003] However, the methods of merging, splitting, trimming and other editing processing of surface elements are relatively mature in software such as ArcGIS, but ArcGIS is mainly suitable for processing a single data layer, which is inconvenient for processing and checking files containing many layers such as basic geographic data (topographic maps). At present, topographic map files are mainly saved in CAD format, but CAD software does not have such related functions. In view of the above problems, the inventor proposes a method and system for merging and splitting basic geographic surface elements to solve the above problems. Summary of the invention
[0004] In order to solve the problem that the algorithm logic of existing CAD software is complex and cannot be quickly implemented; the purpose of the present invention is to provide a method and system for merging and splitting basic geographic surface elements.
[0005] To solve the above technical problems, the present invention adopts the following technical solution: a method for merging and splitting basic geographic surface elements, comprising the following steps:
[0006] S1. Form a closed surface by breaking virtual line segments at intersection points;
[0007] S2. Use the intersection point interruption virtual line segment method to merge, split, trim, etc. in CAD;
[0008] S3. Perform surface shading display and redundant point thinning in CAD.
[0009] Preferably, in S1, the steps of forming a closed surface by using the principle of the virtual line segment method of breaking the intersection point are as follows:
[0010] A: Read the coordinates of each node of the polyline L (if it is a face, it can be regarded as a closed polyline) in sequence, and store them in coordinate list A in sequence. The attributes of coordinate list A include sequence number, X, Y, and identifier, where the node identifier is 0. Read the coordinates of each node of the polygonal surface element M in clockwise direction and store them in coordinate list B. The attributes of list B are the same as those of coordinate list A.
[0011] B: Based on the node coordinates of the polyline L and the polygon M, calculate whether they intersect. If they intersect, calculate the coordinates of the intersection point. If they are collinear, consider the two ends of the collinear line as the intersection points.
[0012] C: The intersection point on the polyline L is assigned attributes according to the serial numbers of the nodes before and after the edge. For example, if the intersection point is on the line connecting points 3 and 4, and the ratio of the distance from points 3 to 4 is 6:4, then the intersection point is assigned the serial number 3.6 and added to the coordinate list A, and marked as -1. Similarly, the same operation is performed on the intersection point on the polygon M, and the intersection point is added to the coordinate list B;
[0013] D: Form virtual line segments from two adjacent points in the coordinate list A, and determine the relationship between each line segment and the polygon M. If a merge is performed, the line segments inside M are discarded, and only the external line segments are retained to generate a large wrapping surface. If a split is performed, the line segments inside M and the nodes of M itself are required to form a closed surface.
[0014] Preferably, in S2, the specific steps of merging, splitting, pruning, etc. are as follows:
[0015] A: Face merging. The processing objects are two polygonal faces M1 and M2. The intersection point interruption virtual line segment method is used to construct coordinate lists A and B. Two adjacent points in the coordinate list A form virtual line segments. It is determined whether each line segment is included in M2 (points on the line are considered to be included. When constructing the program, the points are checked by inserting points at 10% of the line segment length). The line segments outside M2 are recorded in the line segment object list C;
[0016] In the same way, two adjacent points in the coordinate list B are used to form virtual line segments, and each line segment is determined to be included in M1. The line segments outside M1 are recorded in the line segment object list D;
[0017] Connect the line segments with the same endpoint coordinates in the object lists C and D in sequence to form a closed surface. If there is an inner island after the merger, multiple new surfaces will be formed, among which the surface with a smaller area is included in the surface with the largest area. Whether to retain the inner island surface can be determined based on the actual situation;
[0018] B: Face splitting, the processing objects are split lines and split faces, and the intersection point interruption virtual line segment method is used to construct coordinate lists A and B. According to intersection point 1, intersection point 2 and the nodes between them in coordinate list A, virtual line segments are constructed to determine whether each line segment is included in the split face (when constructing the program, 10% of the line segment length is used for interpolation point checking. There must be at least one interpolation point inside the split face, and points on the line are considered not included). If all line segments are inside the split face, intersection point 1 and intersection point 2 constitute a set of real intersection points. If they are not real intersection points, continue to determine the intersection points of intersection point 2 and intersection point 3 and later.
[0019] If intersection 1 and intersection 2 are a set of real intersections, then these two intersections can be connected to form two closed surfaces: the first surface M1, starting from intersection 1, connects the nodes in coordinate list B clockwise until intersection 2, and then connects along the nodes in coordinate list A to intersection 1; the second surface M2, changes the connection starting point, starting from intersection 2, connects along the nodes in coordinate list B clockwise until intersection 1, and then connects along the nodes in coordinate list A to intersection 2, so that the surface element completes the first split;
[0020] Find the next set of true intersection points and determine whether the intersection points are located on M1 or M2. If the set of intersection points is on the boundary of M2, use the set of true intersection points to continue splitting M2 to form two closed surfaces, M3 and M4. Continue to find true intersection points and split the closed surfaces until there are no true intersection points. At this point, the split surfaces are completely split by the dividing line, forming multiple small closed surfaces.
[0021] C: Face clipping, the processing objects are clipping face and clipped face. Face clipping is similar to face splitting, except that the clipping element is a face instead of a polyline. It is necessary to determine whether the last intersection point and the first intersection point are a set of real intersection points, and only the part within the clipping face is retained after splitting.
[0022] In the same way as face splitting, the trimming face is considered to be a closed dividing line, and the trimmed face is equivalent to the splitting face. The trimming face is used to split the trimmed face into multiple closed faces, and the inclusion relationship between these closed faces and the trimming face is determined. Those located inside the trimming face are the results of trimming.
[0023] Preferably, in S3, the specific steps of coloring display and redundant point thinning are as follows:
[0024] A: Face shading display is used to quickly browse the polygon closed surface in the CAD drawing, read the node coordinates of all closed polyline feature graphics in the CAD file, read the feature code attribute in the extended attribute, and determine the color to be displayed according to the code attribute. Use DrawableOverrule to rewrite the WorldDraw function to change the display rule of the graphics in the drawing area, draw the closed surface according to the coordinates of the polyline node, and add the color determined by the code attribute to color it. Non-closed polylines will not change. Turning off shading display means calling the standard function again to display the feature.
[0025] B: Redundant point thinning is used to eliminate the redundant points that may exist after the surface is merged. Constraints are made based on the area and side length to obtain all nodes of the surface elements, and duplicate point data is eliminated according to the threshold. The area of the triangle formed by two consecutive adjacent points and the sum of the lengths of the two sides are calculated starting from the first point. If both the length and the area are less than the threshold, the middle point is defined as a redundant point. If the second point is defined as a redundant point, the first point and the third and fourth points are calculated in the same way. Otherwise, the second, third and fourth points are calculated to determine whether the third point is a redundant point. If the third point is a redundant point, the relationship between the point before the calculation and the fourth and fifth points is calculated, and finally it returns to the first point.
[0026] Delete the redundant points defined in the calculation, reconnect the non-redundant points from the first point in sequence to obtain a new graph, and the thinning of redundant points of the surface elements is completed.
[0027] Preferably, a system for merging and splitting basic geographic surface elements includes an intersection interruption module, characterized in that the terminal of the (intersection interruption module) is connected to a surface element merging module, a surface element splitting module, and a surface element pruning module, and the terminal of the surface element merging module is connected to a redundant point thinning module, and a final closed surface coloring display module.
[0028] Compared with the prior art, the present invention has the following beneficial effects:
[0029] In the present invention, the method and system are based on terrain measurement, and realize the functions of merging, splitting and trimming surface element graphics in CAD through the intersection point interruption virtual line segment method. In addition, according to the characteristics of surface elements, element coloring display and redundant point thinning are realized, providing a method for quickly optimizing terrain CAD graphic objects, reducing data redundancy, and significantly improving the production efficiency and product quality of the operating unit. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0031] Figure 1 It is a schematic diagram of the merging of surface elements of the present invention.
[0032] Figure 2 It is a schematic diagram of the surface element splitting of the present invention.
[0033] Figure 3 Another schematic diagram of the face element splitting of the present invention.
[0034] Figure 4 It is a schematic diagram of surface element trimming of the present invention.
[0035] Figure 5 It is a schematic diagram showing the status of the elements of the present invention.
[0036] Figure 6 Schematic diagram of thinning out redundant points of surface elements according to the present invention.
[0037] Figure 7 It is a connection diagram of the system of the present invention.
[0038] In the figure: 100, intersection interruption module; 200, surface element merging module; 300, surface element splitting module; 400, surface element trimming module; 500, redundant point thinning module; 600, closed surface coloring display module. DETAILED DESCRIPTION
[0039] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0040] like Figure 1-7 As shown, the present invention provides a method for merging and splitting basic geographic surface elements, comprising the following steps:
[0041] S1. Form a closed surface by breaking virtual line segments at intersection points;
[0042] S2. Use the intersection point interruption virtual line segment method to merge, split, trim, etc. in CAD;
[0043] S3. Perform surface shading display and redundant point thinning in CAD.
[0044] In S1, the steps of forming a closed surface by using the principle of virtual line segment method by intersecting points are as follows:
[0045] A: Read the coordinates of each node of the polyline L (if it is a face, it can be regarded as a closed polyline) in sequence, and store them in coordinate list A in sequence. The attributes of coordinate list A include sequence number, X, Y, and identifier, where the node identifier is 0. Read the coordinates of each node of the polygonal surface element M in clockwise direction and store them in coordinate list B. The attributes of list B are the same as those of coordinate list A.
[0046] B: Based on the node coordinates of the polyline L and the polygon M, calculate whether they intersect. If they intersect, calculate the coordinates of the intersection point. If they are collinear, consider the two ends of the collinear line as the intersection points.
[0047] C: The intersection point on the polyline L is assigned attributes according to the serial numbers of the nodes before and after the edge. For example, if the intersection point is on the line connecting points 3 and 4, and the ratio of the distance from points 3 to 4 is 6:4, then the intersection point is assigned the serial number 3.6 and added to the coordinate list A, and marked as -1. Similarly, the same operation is performed on the intersection point on the polygon M, and the intersection point is added to the coordinate list B;
[0048] D: Form virtual line segments from two adjacent points in the coordinate list A, and determine the relationship between each line segment and the polygon M. If a merge is performed, the line segments inside M are discarded, and only the external line segments are retained to generate a large wrapping surface. If a split is performed, the line segments inside M and the nodes of M itself are required to form a closed surface.
[0049] In S2, the specific steps of merging, splitting, pruning, etc. are as follows:
[0050] A: Face merging. The processing objects are two polygonal faces M1 and M2. The intersection point interruption virtual line segment method is used to construct coordinate lists A and B. Two adjacent points in the coordinate list A form virtual line segments. It is determined whether each line segment is included in M2 (points on the line are considered to be included. When constructing the program, the points are checked by inserting points at 10% of the line segment length). The line segments outside M2 are recorded in the line segment object list C;
[0051] In the same way, two adjacent points in the coordinate list B are used to form virtual line segments, and each line segment is determined to be included in M1. The line segments outside M1 are recorded in the line segment object list D;
[0052] Connect the line segments with the same endpoint coordinates in the object lists C and D in sequence to form a closed surface. If there is an inner island after the merger, multiple new surfaces will be formed, among which the surface with a smaller area is included in the surface with the largest area. Whether to retain the inner island surface can be determined based on the actual situation;
[0053] B: Face splitting, the processing objects are split lines and split faces, and the intersection point interruption virtual line segment method is used to construct coordinate lists A and B. According to intersection point 1, intersection point 2 and the nodes between them in coordinate list A, virtual line segments are constructed to determine whether each line segment is included in the split face (when constructing the program, 10% of the line segment length is used for interpolation point checking. There must be at least one interpolation point inside the split face, and points on the line are considered not included). If all line segments are inside the split face, intersection point 1 and intersection point 2 constitute a set of real intersection points. If they are not real intersection points, continue to determine the intersection points of intersection point 2 and intersection point 3 and later.
[0054] If intersection 1 and intersection 2 are a set of real intersections, then these two intersections can be connected to form two closed surfaces: the first surface M1, starting from intersection 1, connects the nodes in coordinate list B clockwise until intersection 2, and then connects along the nodes in coordinate list A to intersection 1; the second surface M2, changes the connection starting point, starting from intersection 2, connects along the nodes in coordinate list B clockwise until intersection 1, and then connects along the nodes in coordinate list A to intersection 2, so that the surface element completes the first split;
[0055] Find the next set of true intersection points and determine whether the intersection points are located on M1 or M2. If the set of intersection points is on the boundary of M2, use the set of true intersection points to continue splitting M2 to form two closed surfaces, M3 and M4. Continue to find true intersection points and split the closed surfaces until there are no true intersection points. At this point, the split surfaces are completely split by the dividing line, forming multiple small closed surfaces.
[0056] C: Face clipping, the processing objects are clipping face and clipped face. Face clipping is similar to face splitting, except that the clipping element is a face instead of a polyline. It is necessary to determine whether the last intersection point and the first intersection point are a set of real intersection points, and only the part within the clipping face is retained after splitting.
[0057] In the same way as face splitting, the trimming face is considered to be a closed dividing line, and the trimmed face is equivalent to the splitting face. The trimming face is used to split the trimmed face into multiple closed faces, and the inclusion relationship between these closed faces and the trimming face is determined. Those located inside the trimming face are the results of trimming.
[0058] In S3, the specific steps of coloring display and redundant point thinning are as follows:
[0059] A: Face shading display is used to quickly browse the polygon closed surface in the CAD drawing, read the node coordinates of all closed polyline feature graphics in the CAD file, read the feature code attribute in the extended attribute, and determine the color to be displayed according to the code attribute. Use DrawableOverrule to rewrite the WorldDraw function to change the display rule of the graphics in the drawing area, draw the closed surface according to the coordinates of the polyline node, and add the color determined by the code attribute to color it. Non-closed polylines will not change. Turning off shading display means calling the standard function again to display the feature.
[0060] B: Redundant point thinning is used to eliminate the redundant points that may exist after the surface is merged. Constraints are made based on the area and side length to obtain all nodes of the surface elements, and duplicate point data is eliminated according to the threshold. The area of the triangle formed by two consecutive adjacent points and the sum of the lengths of the two sides are calculated starting from the first point. If both the length and the area are less than the threshold, the middle point is defined as a redundant point. If the second point is defined as a redundant point, the first point and the third and fourth points are calculated in the same way. Otherwise, the second, third and fourth points are calculated to determine whether the third point is a redundant point. If the third point is a redundant point, the relationship between the point before the calculation and the fourth and fifth points is calculated, and finally it returns to the first point.
[0061] Delete the redundant points defined in the calculation, reconnect the non-redundant points from the first point in sequence to obtain a new graph, and the thinning of redundant points of the surface elements is completed.
[0062] A system for merging and splitting basic geographic surface elements, comprising an intersection breaking module (100), characterized in that the terminal of the intersection breaking module is connected to a surface element merging module (200), a surface element splitting module (300), and a surface element pruning module (400), and the terminal of the surface element merging module is connected to a redundant point thinning module (500), and a final closed surface coloring display module (600).
[0063] An embodiment of the above steps:
[0064] 1. Merge polygon elements
[0065] (1) Select two surface elements to be merged in the CAD file, read the node coordinates of the two surfaces in clockwise order, name them 0, 1, 2, etc., add identifiers (A and B respectively) in front of the numbers and store them in coordinate object list A and object list B;
[0066] (2) Using the coordinates of each of the two adjacent nodes in the two face elements, determine whether the two faces intersect. If they do intersect, calculate the coordinates of all the intersection points. If they are collinear, consider the two ends of the collinear line as intersection points.
[0067] (3) The intersection point is assigned attributes according to the specific sides of the two surface elements where the intersection point is located. For example, if the intersection point is located on the line connecting points 3 and 4 of surface element A, and the ratio of the distance from point 3 to point 4 is approximately 6:4, then attribute 1 is assigned as A3.6. At the same time, if the intersection point is located on the line connecting points 1-2 of surface element B at a ratio of approximately 2:8, then attribute 2 is assigned as B1.2.
[0068] (4) Extract attribute 1 of the intersection point and insert it into the coordinate object list A of surface A according to the node parameter. Similarly, insert the intersection point into the coordinate object list B of surface B according to attribute 2;
[0069] (5) Calculate the coordinates of every two adjacent points in the object lists A and B, delete the duplicate points (the distance is less than 0.001 meters), and keep only one;
[0070] (6) Every two adjacent points in the object list A form a virtual line segment, and interpolate points every 10% of the line segment length. Use the ray method to determine whether the line segment is included outside the B surface element through the line segment interpolation points. When all the interpolation points are outside the cut surface, the line segment is recorded in the line segment object list C;
[0071] (7) The two adjacent points in the object list B are formed into virtual line segments. According to the method of S6, it is determined whether each line segment is outside the surface element A. The line segments outside the surface element A are recorded in the line segment object list D, as shown in the attached figure. Figure 1 , object lists C and D contain red segments;
[0072] (8) Starting from the first line segment object in object list C, search for a line segment with the same endpoint coordinates in object list C and object list D according to its endpoint coordinates, connect the two to form a polyline, and continue to search for the next line segment according to the endpoint coordinates of the second line segment that is not connected to connect, until there are no line segments that meet the conditions, forming a closed surface;
[0073] (9) When there is an inner island in the actual operation process, a face within a face will be formed. In S8, multiple closed faces will be formed, among which the face with a smaller area is included in the face with the largest area. An option is added to the system to determine whether to retain the inner island face.
[0074] 2. Splitting of polygon elements
[0075] (1) Select the split line and split surface in the CAD file. The node coordinates of the split line are read in sequence starting from the upper left corner. The node coordinates of the split surface are read in clockwise order starting from the upper left corner. They are named 0, 1, 2, etc., and an identifier (F and C, respectively) is added in front of the number and stored in coordinate list A and coordinate list B;
[0076] (2) Using the coordinates of each two adjacent nodes in the coordinate lists A and B, determine whether the splitting line and the splitting surface intersect. If they do, calculate the coordinates of all intersection points. If they are collinear, consider the two ends of the collinear line as intersection points.
[0077] (3) The intersection point is assigned attributes according to whether it is located on the dividing line or the boundary of the split surface. For example, if the intersection point is located on the line connecting points 3 and 4 of the dividing line, and the ratio of the distance from points 3 to 4 is approximately 6:4, then attribute 1 is assigned as F3.6. At the same time, if the intersection point is located on the line connecting points 1-2 of the split surface at a ratio of approximately 2:8, then attribute 2 is assigned as C1.2. Figure 2
[0078] (4) Extract attribute 1 of the intersection point and insert it into the split line coordinate object list A according to the node parameter. Similarly, insert the intersection point into the split surface coordinate object list B according to attribute 2;
[0079] (5) As attached Figure 2 , determine whether the first two intersection points in the coordinate list A are a set of real intersection points: the first two intersection points are F1 and F2, and the F1-F2 virtual line segment is checked for interpolation points. After checking, all points are on the split surface boundary, and the F1-F2 virtual line segment is not within the split surface;
[0080] (6) Continue to determine whether the second and third intersection points in the coordinate list A are a set of real intersection points: perform point insertion checks on the two virtual line segments F2-F3 and F3-F3.4. After checking, the two line segments are both within the split surface, and F2 and F3.4 are the first set of real intersection points;
[0081] (7) Construct two closed surfaces based on the real intersection points F2 and F3.4: the first surface is connected in a clockwise direction along F2-C0-C1-C2-F3.4, and then a closed surface is formed along F3-F2; the second surface is connected in a clockwise direction along F3.4-C3-F2, and then a closed surface is formed along F3-F3.4, completing the first split of the split surface;
[0082] (8) Continue to determine whether the other intersection points in the coordinate list A are real intersection points. After checking the points, F5.5 and F6 are a group of real intersection points, while F6 and F7 are not real intersection points. According to the connection rules, continue to split the closed surface that has been split once, and finally obtain three closed surfaces M1, M3, and M4, as shown in the attached figure. Figure 3 , the original split surfaces are completely split.
[0083] 3. Area feature pruning method
[0084] In the same way as face splitting, the trimmed face is considered as a closed split line, and the trimmed face is equivalent to the split face, as shown in the following figure. Figure 4, use the trimming surface to split the trimmed surface into M1, M3, and M4, and determine the inclusion relationship between these closed surfaces and the trimming surface. Only M3 is inside the trimming surface, and M3 is the result after trimming.
[0085] 4. Coloring display of surface elements
[0086] (1) Traverse all polyline features in the CAD file and read the feature code (CODE) attribute of the extended attribute;
[0087] (2) According to the type of polyline, select the closed polyline elements, read the node coordinates X and Y of the graph, and store them in the queue;
[0088] (3) Establish a comparison table of element codes and colors, and determine the colors to be displayed based on the attributes;
[0089] (4) Turn on shaded display: define a new class DrawRule derived from the DrawableOverrule class, rewrite the WorldDraw function, and modify the display rules of the graphics in the drawing area according to the type;
[0090] (5) Draw a closed surface according to the coordinates of the polyline nodes and color it with the color determined by the code attributes;
[0091] (6) Turn off the shaded display: Re-call the standard WorldDraw function to display the elements and restore the original display state of the elements, as shown in the following figure. Figure 5 , the left picture shows the original display state, and the right picture shows the shaded display state.
[0092] 5. Thinning out redundant points of area elements
[0093] (1) Traverse the X and Y coordinates of all nodes of a surface element in the CAD file and store them in a queue;
[0094] (2) Calculate the distance L between every two adjacent points in the queue, In the above formula, i is the node number of the surface element;
[0095] (3) If the distance L is less than 0.0001 m, it is considered a duplicate point. The midpoint coordinates of the two points are calculated and the coordinates of the duplicate point in the queue are replaced. The original duplicate point is deleted to form a new queue.
[0096] (4) Calculate the distances between adjacent points in the new queue according to S2, and re-determine duplicate points according to S3 until all duplicate points are deleted;
[0097] (5) See attached Figure 6, calculate the area of the triangle formed by the 0th point, the 1st point, and the 2nd point in the new queue and the sum of the lengths of the two sides 0-1 and 1-2, the area S = (X1*Y2-X1*Y3+X2*Y3-X2*Y1+X3*Y1-X2*Y2), the area takes 0.01 square meters as the domain value, and the side length takes 100 meters as the threshold. If the area of the triangle and the sum of the two side lengths are both less than the threshold, then the first point is determined to be a redundant point, and the rest are not determined to be redundant points;
[0098] (6) Assuming that the first point in S5 is determined to be a non-redundant point, the area and side length of the triangles of points 1, 2, and 3 are calculated, and the judgment is continued according to the conditions in S5, and then the area and side length of the next triangle are calculated;
[0099] (7) The area of the triangle formed by points 2, 3, and 4 is less than 0.01 square meters, and the sum of the side lengths of 2-3 and 3-4 is less than 100 meters. Point 3 is determined to be a redundant point. At this time, the calculation of points 2, 4, and 5 is started according to the rules, and the determination continues until the process returns to determining whether point 0 is a redundant point.
[0100] (8) All redundant points in the queue are removed to obtain the thinned-out result. The non-redundant points are reconnected in sequence from the first point to obtain a new graph M. The thinning-out of redundant points of the surface elements is completed.
[0101] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for merging and splitting basic geographic surface elements, characterized in that: The following steps are involved: S1. Using the principle of virtual line segment method by using intersection points to form multiple virtual line segments from the closed surface; S2, merging, splitting and trimming the surface graphics by using the virtual line segment method of the intersection point interruption; S3, perform surface coloring display and redundant point thinning in CAD; In S1, the steps of forming a closed surface by using the principle of virtual line segment method by intersecting points are as follows: A: Read the coordinates of each node of the polyline L in order and store them in coordinate list A. The attributes of coordinate list A include serial number, X, Y, and identifier, where the node identifier is 0. Read the coordinates of each node of the polygonal surface element M in clockwise order and store them in coordinate list B. The attributes of list B are the same as those of coordinate list A. B: Based on the node coordinates of the polyline L and the polygon M, calculate whether they intersect. If they intersect, calculate the coordinates of the intersection point. If they are collinear, consider the two ends of the collinear line as the intersection points. C: The intersection point on the polyline L is assigned attributes according to the serial numbers of the nodes before and after the edge. The intersection point is located on the line connecting points 3 and 4, and the ratio of the distance from points 3 to 4 is 6:
4. The intersection point is assigned the serial number 3.6 and added to the coordinate list A, and marked as -1. Similarly, the same operation is performed on the intersection point on the polygon M, and the intersection point is added to the coordinate list B; D: Form virtual line segments between two adjacent points in the coordinate list A, and determine the relationship between each line segment and the polygon M. If merging is performed, the line segments inside M are discarded, and only the external line segments are retained to generate a large wrapping surface. If splitting is performed, the line segments inside M and the nodes of M itself are required to form a closed surface. In S2, the specific steps of merging, splitting, and pruning are as follows: A: Face merging. The processing objects are two polygonal faces M1 and M2. The intersection point interruption virtual line segment method is used to construct coordinate lists A and B. Two adjacent points in the coordinate list A are used to form virtual line segments. It is determined whether each line segment is included in M2. The line segments outside M2 are recorded in the line segment object list C. In the same way, two adjacent points in the coordinate list B are used to form virtual line segments, and each line segment is determined to be included in M1. The line segments outside M1 are recorded in the line segment object list D; Connect the line segments with the same endpoint coordinates in the object lists C and D in sequence to form a closed surface. If there is an inner island after the merger, multiple new surfaces will be formed, among which the surface with a smaller area is included in the surface with the largest area. Whether to retain the inner island surface can be determined based on the actual situation; B: Face splitting. The processing objects are split lines and split faces. The intersection-interrupted virtual line segment method is used to construct coordinate lists A and B. Virtual line segments are constructed based on intersection points 1 and 2 in coordinate list A and the nodes between them. It is determined whether each line segment is included in the split face. If the line segments are all in the split face, intersection points 1 and 2 constitute a set of real intersection points. If they are not real intersection points, the intersection points 2 and 3 and subsequent intersection points are determined. If intersection 1 and intersection 2 are a set of real intersections, then these two intersections can be connected to form two closed surfaces: the first surface M1, starting from intersection 1, connects the nodes in coordinate list B clockwise until intersection 2, and then connects along the nodes in coordinate list A to intersection 1; the second surface M2, changes the connection starting point, starting from intersection 2, connects along the nodes in coordinate list B clockwise until intersection 1, and then connects along the nodes in coordinate list A to intersection 2, so that the surface element completes the first split; Find the next set of true intersection points and determine whether the intersection points are located on M1 or M2. If the set of intersection points is on the boundary of M2, use the set of true intersection points to continue splitting M2 to form two closed surfaces, M3 and M4. Continue to find true intersection points and split the closed surfaces until there are no true intersection points. At this point, the split surfaces are completely split by the dividing line, forming multiple small closed surfaces. C: Face clipping, the processing objects are clipping face and clipped face. Face clipping is similar to face splitting, except that the clipping element is a face instead of a polyline. It is necessary to determine whether the last intersection point and the first intersection point are a set of real intersection points, and only the part within the clipping face is retained after splitting. In the same way as face splitting, the trimming face is considered as a closed dividing line, and the trimmed face is equivalent to the split face. The trimming face is used to split the trimmed face into multiple closed faces, and the inclusion relationship between these closed faces and the trimming face is determined. The ones inside the trimming face are the trimmed results; In S3, the specific steps of coloring display and redundant point thinning are as follows: A: Face shading display is used to quickly browse the polygon closed surface in the CAD drawing, read the node coordinates of all closed polyline feature graphics in the CAD file, read the feature code attribute in the extended attribute, and determine the color to be displayed according to the code attribute. Use DrawableOverrule to rewrite the WorldDraw function to change the display rule of the graphics in the drawing area, draw the closed surface according to the coordinates of the polyline node, and add the color determined by the code attribute to color it. Non-closed polylines will not change. Turning off shading display means calling the standard function again to display the feature. B: Redundant point thinning is used to eliminate the redundant points that may exist after the surface is merged. Constraints are made based on the area and side length to obtain all nodes of the surface elements, and duplicate point data is eliminated according to the threshold. The area of the triangle formed by two consecutive adjacent points and the sum of the lengths of the two sides are calculated starting from the first point. If both the length and the area are less than the threshold, the middle point is defined as a redundant point. If the second point is defined as a redundant point, the first point and the third and fourth points are calculated in the same way. Otherwise, the second, third and fourth points are calculated to determine whether the third point is a redundant point. If the third point is a redundant point, the relationship between the point before the calculation and the fourth and fifth points is calculated, and finally it returns to the first point. Delete the redundant points defined in the calculation, reconnect the non-redundant points from the first point in sequence to obtain a new graph, and the thinning of redundant points of the surface elements is completed.
