A method, device and storage device for quickly aggregating surface elements
By clustering and sequenceing GIS data, calculating outsourced rectangles and center points, merging polygonal elements, generating outer boundary polygons and connecting clustering center points and edge nodes, the problems of large amount of calculation and difficult to determine parameters in the existing technology are solved, and efficient polygonal element aggregation and automatic mapping are achieved.
Patent Information
- Application Number
- CN202111441066.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-30
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2041-11-30
AI Technical Summary
The existing polygon factor aggregation method has problems such as large calculation volume, difficult to determine parameters, low calculation efficiency and limitations, which is difficult to meet the needs of efficient automatic mapping.
By reading GIS data, clustering, sorting clustering clusters, calculating outsourcing rectangles and center points, merging polygon features, generating outer boundary polygons, connecting cluster center points and edge nodes, extending line segments to outsourcing rectangle long diagonals, recording outer endpoints, generating line segments and polygons, and adjusting output shapes.
The polygon feature aggregation method without introducing difficult-to-deterministic parameters and a small amount of calculation is realized, which improves the efficiency of polygon feature aggregation, speeds up the speed of automatic mapping, and shortens the automatic mapping time.
Smart Images

Figure CN114429505B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cartographic generalization, and more particularly, to a method, device, and storage device for rapid aggregation of surface features. Background Art
[0002] Automatic cartographic generalization is a key technology in the construction of geographic informatization. The purpose of cartographic generalization is to simplify large-scale maps into small-scale maps through abstraction, generalization, etc. Automatic aggregation of surface features is one of the active topics in the field of map research and is also a commonly used method in automatic cartographic generalization. The general process is to obtain multiple clustering clusters through clustering, and then aggregate each clustering cluster into a larger polygon respectively.
[0003] Currently, there are already many methods for automatic aggregation of surface features, including methods based on TIN, methods based on the rolling ball method, methods based on superpixels, and methods based on raster calculation, etc. Among them, the method based on TIN has the problem of too low computational efficiency because of the large amount of calculation and the process of screening and filtering through strategies. The rolling ball method has certain problems in large-scale automated applications due to problems such as the difficulty in automatically determining the rolling ball radius for multiple clustering clusters. The raster-based aggregation method is the method used in ArcGIS. It is necessary to first convert vectors into raster features, and then find the features within a specified distance through various raster search and calculation functions, and finally connect the features within the specified distance. This method also requires a specified distance, and there may be different suitable distances for multiple clustering clusters. At the same time, raster processing is time-consuming. This method also has the problem of choosing the raster cell size, and there is an upper limit for raster processing, which may be insufficient in high-precision large-scale calculations. The rapid surface feature aggregation method has a smaller amount of calculation compared with the method based on superpixels. Therefore, it can be used as one of the alternative methods for automatic cartographic generalization. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a method, device, and storage device for rapid aggregation of surface features in view of the deficiencies of existing surface feature aggregation methods, such as having more rules in calculation, having more difficult-to-determine parameters, having a large amount of calculation, and having limitations.
[0005] A rapid surface feature aggregation method provided by the present invention includes the following steps:
[0006] S1. Read surface feature data; the surface feature data is GIS data;
[0007] S2. Cluster the surface feature data to obtain different clustering clusters;
[0008] S3. Number each clustering cluster and store the sequence as its attribute in the class data group;
[0009] S4. Obtain the bounding rectangles of each clustering cluster, and store the bounding rectangles corresponding to the sequence attributes into the rectClass data group;
[0010] Calculate the centers of each clustering cluster through the centers of the surface elements in each clustering cluster, and store the centers of the clustering clusters corresponding to the sequence attributes into the centerClass data group;
[0011] S5. Merge the surface elements in each clustering cluster by the union method, obtain the outer boundary polygon of the merged surface elements, and store the outer boundary polygon of the merged surface elements corresponding to the sequence attributes into the polygonClass data group;
[0012] Obtain the side lines of each outer boundary polygon, and store the side lines of the outer boundary polygon corresponding to the sequence attributes into the polylineClass data group;
[0013] S6. Traverse the nodes on the side lines of each outer boundary polygon respectively, connect the clustering center points of the corresponding clustering clusters with the nodes on the side lines, and extend the connection line to the length of the long diagonal of the bounding rectangle of the corresponding clustering cluster, record the outer endpoints of the line segment, and store them corresponding to the sequence attributes into the pointClass data group;
[0014] Take the order of the nodes on the side lines of each outer boundary polygon as the attributes of the nodes, and store them into the sequence data group;
[0015] S7. Connect the outer endpoints with the nodes on the side lines of the outer boundary polygon of the corresponding clustering cluster to generate line segments, record the serial numbers corresponding to the class data group, store the serial numbers into the newPolylineClass data group, record the serial numbers corresponding to the sequence data group, and store the serial numbers into the newSequence data group;
[0016] S8. Intersect the line segments corresponding to the newPolylineClass data group and the polygonClass data group with the outer boundary polygon;
[0017] S9. Judge the intersection result in S8. If the intersection result is a point, record these points and enter step S10; otherwise, exit the entire process;
[0018] S10. Generate polygons for the recorded points according to the corresponding newPolylineClass data group and newSequence data group;
[0019] S11. Adjust the output form of the result by setting the threshold of the included angle of the polygon boundary broken line.
[0020] A storage device that stores instructions and data for implementing a fast surface feature aggregation method.
[0021] A fast surface feature aggregation device includes: a processor and a storage device; the processor loads and executes the instructions and data in the storage device to implement a fast surface feature aggregation method.
[0022] The beneficial effects provided by the present invention are as follows: It realizes a surface feature aggregation method that does not require introducing difficult-to-determine parameters and has a small amount of calculation, improves the efficiency of surface feature aggregation, further speeds up the efficiency of automatic cartography, and shortens the time of automatic cartography. Description of the Drawings
[0023] Figure 1 It is a schematic flowchart of the method of the present invention.
[0024] Figure 2 It is a schematic diagram of community data;
[0025] Figure 3 Flowchart for calculating outer endpoints;
[0026] Figure 4 Schematic diagram of the final result of the present invention;
[0027] Figure 5 It is a schematic diagram of the operation of the hardware device of the present invention. Detailed Embodiments
[0028] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be further described below in conjunction with the accompanying drawings.
[0029] Please refer to Figure 1 , Figure 1 which is a schematic flowchart of the method of the present invention;
[0030] A fast surface feature aggregation method includes the following steps:
[0031] S1. Read surface feature data; the surface feature data is GIS data;
[0032] Specifically, as an embodiment, this application takes the building surface features of several communities in a certain area as an example for illustration; read community data community;
[0033] Please refer to Figure 2 , Figure 2 which is a schematic diagram of community data in the embodiment of this application; as an embodiment, when implementing step S2, the method of clustering can be K-Means. As other embodiments, numerical values of actual categories can also be directly assigned. For example, for community data, classification can be performed according to actual community grids;
[0034] S2. Cluster the face element data to obtain different clusters;
[0035] S3. Number each cluster and store the sequence as its attribute in the class data group;
[0036] S4. Obtain the bounding rectangles of each cluster, and store the bounding rectangles corresponding to the sequence attributes in the rectClass data group;
[0037] Calculate the center of each cluster through the centers of the face elements in each cluster, and store the centers of the clusters corresponding to the sequence attributes in the centerClass data group;
[0038] Specifically, when implementing step S4, obtain the bounding rectangle of the cluster. In this embodiment, specifically, obtain the length of the long diagonal of the bounding rectangle to ensure that the outer endpoints in S6 are outside each outer boundary polygon; in other embodiments, generally, a larger value can also be taken or the long diagonal of the entire community data map sheet can be directly used for calculation, that is, set a value by oneself.
[0039] S5. Merge the face elements in each cluster by the union method to obtain the outer boundary polygon of the merged face elements, and store the outer boundary polygon of the merged face elements corresponding to the sequence attributes in the polygonClass data group;
[0040] Obtain the side lines of each outer boundary polygon, and store the side lines of the outer polygon corresponding to the sequence attributes in the polylineClass data group;
[0041] S6. Traverse the nodes on the side lines of each outer boundary polygon respectively, connect the cluster center points of the corresponding clusters with the nodes on the side lines, and extend the connection line to the length of the long diagonal of the bounding rectangle of the corresponding cluster, record the outer endpoints of the line segment, and store them corresponding to the sequence attributes in the pointClass data group;
[0042] Take the order of the nodes on the side lines of each outer boundary polygon as the attribute of the nodes and store it in the sequence data group;
[0043] Please refer to Figure 3 , Figure 3 which is the detailed flowchart of step S6, that is, the flowchart for calculating the outer endpoints;
[0044] S61. Obtain the nodes of the outer boundary polygon edges corresponding to each clustering cluster and record them in a dictionary (for convenience of description, the previous text uses the form of a data group, but in actual applications, it is actually stored in the form of a data table, which does not affect the essential technology). The key is polylineClass, and the value is in the form of [X, Y], where X is the array of abscissas of the node coordinates and Y is the array of ordinates of the node coordinates;
[0045] S62. Obtain the center points of the clustering clusters and record them in a dictionary (the same as above). The key is polygonClass, and the value is a list in the form of [xc, yc], where xc is the abscissa of the center of the clustering cluster and yc is the ordinate of the center of the clustering cluster;
[0046] S63. Calculate the length of the long diagonal of the circumscribed rectangle of each clustering cluster and record it in the dictionary. The key is rectClass, and the value is the length of the long diagonal L;
[0047] S64. Through the corresponding relationship of polylineClass, polygonClass, and rectClass, calculate and obtain the coordinates of the outer endpoints of the connection line between the center point of each clustering cluster and the nodes of the outer boundary polygon edge, extended by a distance of L. Let x be X any abscissa in y and Y be
[0048] When x is not equal to xc and y is not equal to yc :
[0049]
[0050]
[0051]
[0052] When x is equal to xc and y is not equal to yc :
[0053]
[0054]
[0055]
[0056] When y is equal to yc and x is not equal toxc When:
[0057]
[0058]
[0059]
[0060] When y is equal to yc and x is equal to xc When:
[0061]
[0062]
[0063]
[0064]
[0065]
[0066] Wherein, x n-1 and y n-1 are respectively the abscissa and ordinate of the node before the current boundary node, x n+1 and y n+1 are respectively the abscissa and ordinate of the node after the current boundary node; xo and yo are the calculated outer endpoint coordinates;
[0067] S7. Connect the outer endpoints with the nodes on the side of the outer boundary polygon of the corresponding clustering cluster to generate line segments, record the serial numbers corresponding to the class data group, store the serial numbers into the newPolylineClass data group, record the serial numbers corresponding to the sequence data group, and store the serial numbers into the newSequence data group;
[0068] S8. Intersect the line segments corresponding to the newPolylineClass data group and the polygonClass data group with the outer boundary polygon;
[0069] S9. Judge the intersection result in S8. If the intersection result is a point, record these points and go to step S10; otherwise, exit the entire process;
[0070] S10. Generate polygons for the recorded points according to the corresponding newPolylineClass data group and newSequence data group.
[0071] Specifically, for the recorded points, perform a double sorting according to the corresponding newPolylineClass and newSequence, and then connect the recorded points in the order of newSequence according to the newPolylineClass category to generate polygons.
[0072] S11. Adjust the output form of the result by setting the threshold of the included angle of the polygon boundary broken line.
[0073] Specifically, as an embodiment, in this application, judge the included angle of the broken line in the polygon side line in S10. If it is less than the set threshold alpha, remove the corresponding node, and the adjustment of the result can be realized.
[0074] Finally, please refer to Figure 4 , Figure 4 which is the final result diagram of this application;
[0075] Please refer to Figure 5 , Figure 5 which is the schematic diagram of the working of the hardware device in the embodiment of the present invention. The hardware device specifically includes: a fast surface feature aggregation device 401, a processor 402, and a storage device 403.
[0076] A fast surface feature aggregation device 401: The A device 401 implements the A method.
[0077] Processor 402: The processor 402 loads and executes the instructions and data in the storage device 403 to implement the fast surface feature aggregation method.
[0078] Storage device 403: The storage device 403 stores instructions and data; the storage device 403 is used to implement the fast surface feature aggregation method.
[0079] The beneficial effects of the present invention are: realizing a surface feature aggregation method that does not require introducing difficult-to-determine parameters and has less calculation amount, improving the surface feature aggregation efficiency, further accelerating the automatic mapping efficiency, and shortening the automatic mapping time.
[0080] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for quickly aggregating surface elements, characterized in that: It includes the following steps: S1. Read the surface feature data; the surface feature data is GIS data; the surface feature data is the building surface feature data in the field of automatic cartography; S2. Cluster the surface feature data to obtain different clustering clusters; S3. Number each clustering cluster and store the sequence as its attribute into the class data group; S4. Obtain the bounding rectangles of each clustering cluster and store the bounding rectangles corresponding to the sequence attributes into the rectClass data group; Calculate the centers of each clustering cluster through the centers of the surface features in each clustering cluster, and store the centers of the clustering clusters corresponding to the sequence attributes into the centerClass data group; S5. Merge the surface features in each clustering cluster by the union merging method to obtain the outer boundary polygon of the merged surface features, and store the outer boundary polygon of the merged surface features corresponding to the sequence attributes into the polygonClass data group; Obtain the side lines of each outer boundary polygon and store the outer boundary polygon side lines corresponding to the sequence attributes into the polylineClass data group; S6. Traverse the nodes on the side lines of each outer boundary polygon respectively, connect the clustering center points of the corresponding clustering clusters with the nodes on the side lines, and extend the connection line to the length of the long diagonal of the bounding rectangle of the corresponding clustering cluster, record the outer endpoints of the line segment, and store them corresponding to the sequence attributes into the pointClass data group; Take the order of the nodes on the side lines of each outer boundary polygon as the attribute of the nodes and store it into the sequence data group; S7. Connect the outer endpoints with the nodes on the side lines of the outer boundary polygon of the corresponding clustering cluster to generate line segments, record the serial numbers corresponding to the class data group and store the serial numbers into the newPolylineClass data group, record the serial numbers corresponding to the sequence data group and store the serial numbers into the newSequence data group; S8. Intersect the line segments corresponding to the newPolylineClass data group and the polygonClass data group with the outer boundary polygon; S9. Judge the intersection result in S8. If the intersection result is a point, record these points and enter step S10; Otherwise, exit the entire process; S10. Generate polygons for the recorded points according to the corresponding newPolylineClass data group and newSequence data group; S11. Adjust the output form of the result by setting the threshold of the included angle of the polygon boundary broken line.
2. A storage device, characterized in that: The storage device stores instructions and data for implementing a fast surface feature aggregation method described in claim 1.
3. A fast surface element aggregation device, characterized in that: It includes: A processor and a storage device; the processor loads and executes the instructions and data in the storage device for implementing a fast surface feature aggregation method described in claim 1.
Citation Information
Patent Citations
Method and system for modeling geologic properties using homogenized mixed finite elements
CA2774933A1
Method for polygon combination in planar drawing
CN103761094A