A method for simplifying and merging administrative district boundaries, a terminal device and a storage medium

CN122820909APending Publication Date: 2026-09-25XIAMEN YAXON ZHILLAN TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510338414.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-21
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

多边形点数过多,不仅会超过编译协议的数值限制,会导致编译出错,也增加了地图匹配过程中的计算的复杂度,降低了匹配效率

Benefits of technology

[0031]本发明采用如上技术方案,解决了行政区域需要同时合并和简化的问题,并能保留区域相交处的精确性和原区域覆盖的地理范围。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122820909A_ABST
    Figure CN122820909A_ABST
Patent Text Reader

Abstract

The application relates to a method for simplifying and merging administrative district boundaries, a terminal device and a storage medium, which comprises the following steps: acquiring all polygons corresponding to the boundaries of an administrative district to be processed; extracting polygons without common boundaries with other administrative districts, removing islands and holes, and taking the whole as a processing object; obtaining a boundary edge sequence of the processing object after processing; merging the polygon formed by the boundary edge sequence with a polygon with a common boundary, and forming a boundary graph of the administrative district to be processed after superimposing islands and holes. The application solves the problem that administrative regions need to be simultaneously merged and simplified, and can retain the accuracy of region intersections and the geographical range covered by the original region.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of map compilation, and more particularly to a method for simplifying and merging administrative region boundaries, a terminal device, and a storage medium. Background Technology

[0002] During the compilation of map administrative boundaries, some regions sometimes have very complex administrative boundaries, including not only land boundaries but also thousands of island polygons. An excessive number of polygon points not only exceeds the numerical limits of the compilation protocol, leading to compilation errors, but also increases the computational complexity of the map matching process, reducing matching efficiency.

[0003] Common polygon simplification algorithms include the Douglas-Pugh algorithm, which reduces the number of polygon points but cannot guarantee that the simplified boundary will completely cover all traffic elements of the original area. Common polygon merging algorithms include Delaunay triangulation, which has lower execution efficiency and is suitable for large-scale point cloud datasets. Common methods are general processing methods for all point sets, and the generated results may not necessarily follow the boundaries of the original polygons. Summary of the Invention

[0004] To address the aforementioned problems, this invention proposes a simplified merging method for administrative region boundaries, a terminal device, and a storage medium.

[0005] The specific plan is as follows:

[0006] A method for simplifying and merging administrative region boundaries includes the following steps:

[0007] S1: Obtain all polygons corresponding to the boundaries of the administrative region to be processed;

[0008] S2: Determine if there are any polygons among all polygons that do not share a common boundary with other administrative regions. If so, proceed to S3; otherwise, use all the obtained polygons as the boundary graphics of the administrative region to be processed.

[0009] S3: Extract all polygons that do not share a common boundary with other administrative regions, and remove any islands or holes they contain. Then, treat all polygons that do not share a common boundary with other administrative regions after removing islands and holes as the whole object to be processed.

[0010] S4: Draw the outer rectangle of the object to be processed, so that all vertices of the object to be processed are contained within the outer rectangle;

[0011] S5: Convert the object to be processed and its surrounding rectangle as a whole into a new polygon A with a self-contacting loop structure;

[0012] S6: Triangulate polygon A to obtain a triangulated mesh;

[0013] S7: Extract all boundary edges contained in the triangular mesh; the boundary edges must meet the following conditions: they do not contain vertices of the outer rectangle and are not shared edges of two triangles;

[0014] S8: Extract the maximum and minimum values ​​of the lengths of all boundary edges, and calculate the length threshold of the boundary edges based on the maximum and minimum values ​​and a preset ratio threshold.

[0015] S9: After assembling all boundary edges into a boundary edge sequence in descending order of length, execute the following process:

[0016] S901: Determine whether the length of the first boundary edge in the boundary edge sequence is greater than the length threshold. If yes, proceed to S902; otherwise, output the boundary edge sequence.

[0017] S902: Remove the first boundary edge from the boundary edge sequence, and add the other two sides of the triangle to which the first boundary edge belongs as boundary edges to the boundary edge sequence. Update the order of each boundary edge in the boundary edge sequence and return to S901.

[0018] S10: Merge the polygon formed by the boundary edge sequence with the polygons that share common boundaries with other administrative regions among all the polygons obtained in step S1 to obtain a merged graphic; extract the outer boundaries of each sub-region in the merged graphic to form a joint polygon, and superimpose the original island holes onto the joint polygon to form the boundary graphic of the administrative region to be processed.

[0019] Furthermore, the outer rectangle is drawn as follows: after drawing the minimum bounding rectangle corresponding to the object to be processed, the minimum bounding rectangle is expanded outward according to a set ratio, and the expanded rectangle is used as the outer rectangle of the object to be processed.

[0020] Furthermore, the transformation process of polygon A includes:

[0021] S501: Select one point from the outer rectangle and one point from each polygon contained in the object to be processed as its initial point;

[0022] S502: Calculate the distance between the initial point of all polygons and the initial point of the outer rectangle, extract the polygon with the shortest distance and set its number as the initial number, i.e., number i = 1;

[0023] S503: Calculate the distance between the initial point of each of the other unnumbered polygons and each vertex of the polygon numbered i, extract the polygon with the shortest distance and set its number as i+1.

[0024] S504: Increment i by 1, repeat step S503 until all polygons corresponding to the object to be processed are numbered, then proceed to S505.

[0025] S505: Set the traversal order of the vertices contained in polygon A as follows: Starting from the initial point A of the outer rectangle, traverse each vertex of the outer rectangle in a clockwise order until the traversal is completed and the vertices return to the initial point of the outer rectangle. Then, add the initial point of polygon number 1, and starting from the initial point of polygon number 1, traverse in a counter-clockwise order to the vertex that is closest to the initial point of polygon number 2; then, starting from the initial point of polygon number 2, traverse in a counter-clockwise order to the vertex that is closest to the initial point of polygon number 3. The vertex of the polygon is added; and so on, until the initial point of the polygon with the largest number n is added. Then, the vertices of the polygon with the number n are traversed in counterclockwise order until the traversal is completed and the vertices of the polygon with the number n are returned to the initial point of the polygon with the number n. Then, the vertex of the polygon with the number n-1 is added that is closest to the initial point of the polygon with the number n, and the traversal starts from that vertex and proceeds in counterclockwise order to the initial point of the polygon with the number n-1. This process is repeated until the initial point of the polygon with the number 1 is reached. Finally, the initial point of the outer rectangle is added.

[0026] Furthermore, the triangulation was performed using the ear-cutting method.

[0027] Furthermore, after triangulation, the process includes: for each pair of adjacent triangles, determining whether the quadrilateral formed by the pair of adjacent triangles satisfies the following conditions: the quadrilateral is a convex polygon and the two adjacent triangles do not conform to Delaunay's rule. If it satisfies the condition, then attempt to flip the diagonal of the quadrilateral and determine whether the minimum interior angle of the two new triangles formed after the flip is greater than the minimum interior angle of the two triangles before the flip. If so, then use the result after the flip; otherwise, retain the result before the flip.

[0028] Furthermore, the formula for calculating the length threshold of the boundary edge is maxEdgeLength=EdgeLengthRatio*(maxEdgeLen-minEdgeLen)+minEdgeLen, where maxEdgeLength represents the length threshold of the boundary edge, EdgeLengthRatio represents the ratio threshold, maxEdgeLen represents the maximum value of the boundary edge length, and minEdgeLen represents the minimum value of the boundary edge length.

[0029] A simplified and merged administrative boundary terminal device includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the method described in the embodiments of the present invention.

[0030] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described above in the embodiments of the present invention.

[0031] The present invention adopts the above technical solution, which solves the problem of merging and simplifying administrative regions at the same time, and can retain the accuracy of the intersection of regions and the geographical scope covered by the original region. Attached Figure Description

[0032] Figure 1 The diagram shown is a flowchart of a method according to an embodiment of the present invention.

[0033] Figure 2 The diagram shown is a schematic of the triangle flipping operation in this embodiment. Detailed Implementation

[0034] To further illustrate the various embodiments, the present invention provides accompanying drawings. These drawings are part of the disclosure of the present invention, primarily used to illustrate the embodiments, and can be used in conjunction with the relevant descriptions in the specification to explain the operating principles of the embodiments. With reference to these drawings, those skilled in the art should be able to understand other possible implementations and the advantages of the present invention.

[0035] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments.

[0036] Example 1:

[0037] This invention provides a simplified method for merging administrative region boundaries, such as... Figure 1 As shown, the method includes the following steps:

[0038] S1: Obtain all polygons corresponding to the boundaries of the administrative region to be processed.

[0039] S2: Determine if there are any polygons among all polygons that do not share a common boundary with other administrative regions. If so, proceed to S3; otherwise, use all the obtained polygons as the boundary graphics of the administrative region to be processed.

[0040] If any one of the two polygons corresponding to two administrative regions is a common edge, then the polygon is considered to have a common boundary with other administrative regions.

[0041] S3: Extract all polygons that do not share a common boundary with other administrative regions, and remove any islands or holes they contain. Then, treat all polygons that do not share a common boundary with other administrative regions after removing islands and holes as the whole object to be processed.

[0042] S4: Draw the outer rectangle of the object to be processed, so that all vertices of the object to be processed are contained within the outer rectangle.

[0043] In this embodiment, the outer rectangle is drawn as follows: After drawing the minimum bounding rectangle corresponding to the object to be processed, the minimum bounding rectangle is expanded outward according to a set ratio, and the expanded rectangle is used as the outer rectangle of the object to be processed. The set ratio can be set according to actual needs, and is usually a small value, such as expanding both the length and width by 1.5 times.

[0044] S5: Convert the object to be processed and its surrounding rectangle into a new polygon A with a self-contacting ring structure.

[0045] A self-contacting ring structure is a ring connected end-to-end. The conversion process of polygon A in this embodiment includes the following steps:

[0046] S501: Select one point from the outer rectangle and one point from each polygon contained in the object to be processed as its initial point. In this embodiment, the vertex located at the lower left corner is selected as the initial point.

[0047] S502: Calculate the distance between the initial point of all polygons and the initial point of the outer rectangle, extract the polygon with the shortest distance and set its number as the initial number, i.e., number i = 1.

[0048] S503: Calculate the distance between the initial point of each of the other unnumbered polygons and each vertex of the polygon numbered i, extract the polygon with the shortest distance and set its number as i+1.

[0049] S504: Increment i by 1, return to step S503, and continue until all polygons corresponding to the object to be processed have been numbered, then proceed to S505.

[0050] S505: Set the traversal order of the vertices contained in polygon A as follows: Starting from the initial point A of the outer rectangle, traverse each vertex of the outer rectangle in a clockwise order until the traversal is completed and the vertices return to the initial point of the outer rectangle. Then, add the initial point of polygon number 1, and starting from the initial point of polygon number 1, traverse in a counter-clockwise order to the vertex that is closest to the initial point of polygon number 2; then, starting from the initial point of polygon number 2, traverse in a counter-clockwise order to the vertex that is closest to the initial point of polygon number 3. The process continues until the initial point of the polygon with the largest number n is added. Then, the vertices of the polygon with the largest number n are traversed in a counter-clockwise order until the traversal is completed and the vertices of the polygon with the largest number n are returned to. Then, the vertex of the polygon with the largest number n-1 that is closest to the initial point of the polygon with the largest number n is added, and the traversal continues in a counter-clockwise order from that vertex to the initial point of the polygon with the largest number n-1. This process continues until the initial point of the polygon with the largest number 1 is reached. Finally, the initial point of the outer rectangle is added. Step S505 achieves the connection between the polygons and between the polygons and the outer rectangle. The initial points of each polygon and the outer rectangle, as well as the vertex of each polygon that is closest to the initial point of the next numbered polygon, all appear twice in polygon A.

[0051] S6: Triangulate polygon A to obtain a triangular mesh.

[0052] In this embodiment, the triangulation is performed using the ear clipping method.

[0053] Furthermore, this embodiment, after triangulation, also includes improving the quality of triangulation through a triangle flipping operation. The specific process includes: for each pair of adjacent triangles (two triangles sharing a common side), determining whether the quadrilateral formed by the pair of adjacent triangles satisfies the following conditions: the quadrilateral is a convex polygon and the two adjacent triangles do not conform to Delaunay's rule (Delaunay's rule: the four points of a quadrilateral cannot be concyclic). If satisfied, then attempting to flip the diagonal of the quadrilateral, such as... Figure 2 As shown, determine whether the minimum interior angle of the two new triangles formed after flipping is greater than the minimum interior angle of the two triangles before flipping. If so, use the result after flipping; otherwise, retain the result before flipping.

[0054] S7: Extract all boundary edges contained in the triangular mesh.

[0055] In this embodiment, the boundary edge must meet the following conditions: it must not contain any vertices of the outer rectangle and it must not be a shared edge of two triangles.

[0056] S8: Extract the maximum and minimum lengths of all boundary edges, and calculate the boundary edge length threshold based on the maximum and minimum lengths and a preset ratio threshold.

[0057] In this embodiment, the formula for calculating the length threshold of the boundary edge is:

[0058] maxEdgeLength=EdgeLengthRatio*(maxEdgeLen-minEdgeLen)+minEdgeLen

[0059] Where maxEdgeLength represents the length threshold of the boundary edge, EdgeLengthRatio represents the ratio threshold, maxEdgeLen represents the maximum length of the boundary edge, and minEdgeLen represents the minimum length of the boundary edge.

[0060] S9: After assembling all boundary edges into a boundary edge sequence in descending order of length, execute the following process:

[0061] S901: Determine whether the length of the first boundary edge in the boundary edge sequence is greater than the length threshold. If yes, proceed to S902; otherwise, output the boundary edge sequence.

[0062] S902: Remove the first boundary edge from the boundary edge sequence, add the other two sides of the triangle to which the first boundary edge belongs as boundary edges to the boundary edge sequence, update the order of each boundary edge in the boundary edge sequence, and return to S901.

[0063] S10: Merge the polygon formed by the boundary edge sequence with the polygons that have common boundaries with other administrative regions among all the polygons obtained in step S1 to obtain a merged graphic; extract the outer boundaries of each sub-region in the merged graphic to form a joint polygon, and superimpose the original island holes (the island holes removed in step S3) onto the joint polygon to form the boundary graphic of the administrative region to be processed.

[0064] Example 2:

[0065] The present invention also provides a simplified merging terminal device for administrative region boundaries, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps in the method embodiment described above in Embodiment 1 of the present invention.

[0066] Furthermore, as an executable solution, the simplified and merged terminal device for administrative region boundaries can be a computing device such as a desktop computer, laptop, handheld computer, or cloud server. The simplified and merged terminal device for administrative region boundaries may include, but is not limited to, a processor and memory. Those skilled in the art will understand that the above-described structure of the simplified and merged terminal device for administrative region boundaries is merely an example and does not constitute a limitation on the simplified and merged terminal device for administrative region boundaries. It may include more or fewer components than described above, or combine certain components, or different components. For example, the simplified and merged terminal device for administrative region boundaries may also include input / output devices, network access devices, buses, etc., and this embodiment of the invention does not limit this.

[0067] Furthermore, as an executable solution, the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices. The general-purpose processor can be a microprocessor or any conventional processor. This processor serves as the control center of the simplified and merged terminal equipment at the administrative region boundary, connecting various parts of the simplified and merged terminal equipment across the entire administrative region boundary using various interfaces and lines.

[0068] The memory can be used to store the computer programs and / or modules. The processor, by running or executing the computer programs and / or modules stored in the memory and calling the data stored in the memory, realizes various functions of the simplified and merged terminal device of the administrative region boundary. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0069] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method described in the embodiments of the present invention.

[0070] If the modules / units integrated into the simplified and merged terminal equipment of the administrative region boundaries are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), and software distribution media, etc.

[0071] Although the invention has been specifically shown and described in conjunction with preferred embodiments, those skilled in the art should understand that various changes in form and detail may be made to the invention without departing from the spirit and scope of the invention as defined in the appended claims, all of which shall be within the scope of protection of the invention.

Claims

1. A method for simplifying and merging administrative region boundaries, characterized in that, Includes the following steps: S1: Obtain all polygons corresponding to the boundaries of the administrative region to be processed; S2: Determine if there are any polygons among all polygons that do not share a common boundary with other administrative regions. If so, proceed to S3; otherwise, use all the obtained polygons as the boundary graphics of the administrative region to be processed. S3: Extract all polygons that do not share a common boundary with other administrative regions, and remove any islands or holes they contain. Then, treat all polygons that do not share a common boundary with other administrative regions after removing islands and holes as the whole object to be processed. S4: Draw the outer rectangle of the object to be processed, so that all vertices of the object to be processed are contained within the outer rectangle; S5: Convert the object to be processed and its surrounding rectangle as a whole into a new polygon A with a self-contacting loop structure; S6: Triangulate polygon A to obtain a triangulated mesh; S7: Extract all boundary edges contained in the triangular mesh; the boundary edges must meet the following conditions: they do not contain vertices of the outer rectangle and are not shared edges of two triangles; S8: Extract the maximum and minimum values ​​of the lengths of all boundary edges, and calculate the length threshold of the boundary edges based on the maximum and minimum values ​​and a preset ratio threshold. S9: After assembling all boundary edges into a boundary edge sequence in descending order of length, execute the following process: S901: Determine whether the length of the first boundary edge in the boundary edge sequence is greater than the length threshold. If yes, proceed to S902; otherwise, output the boundary edge sequence. S902: Remove the first boundary edge from the boundary edge sequence, and add the other two sides of the triangle to which the first boundary edge belongs as boundary edges to the boundary edge sequence. Update the order of each boundary edge in the boundary edge sequence and return to S901. S10: Merge the polygon formed by the boundary edge sequence with the polygons that share common boundaries with other administrative regions among all the polygons obtained in step S1 to obtain a merged graphic; extract the outer boundaries of each sub-region in the merged graphic to form a joint polygon, and superimpose the original island holes onto the joint polygon to form the boundary graphic of the administrative region to be processed.

2. The method for simplifying and merging administrative region boundaries according to claim 1, characterized in that: The outer rectangle is drawn as follows: after drawing the minimum bounding rectangle corresponding to the object to be processed, expand the minimum bounding rectangle outward according to the set ratio, and use the expanded rectangle as the outer rectangle of the object to be processed.

3. The method for simplifying and merging administrative region boundaries according to claim 1, characterized in that: The transformation process of polygon A includes: S501: Select one point from the outer rectangle and one point from each polygon contained in the object to be processed as its initial point; S502: Calculate the distance between the initial point of all polygons and the initial point of the outer rectangle, extract the polygon with the shortest distance and set its number as the initial number, i.e., number i = 1; S503: Calculate the distance between the initial point of each of the other unnumbered polygons and each vertex of the polygon numbered i, extract the polygon with the shortest distance and set its number as i+1. S504: Increment i by 1, repeat step S503 until all polygons corresponding to the object to be processed are numbered, then proceed to S505. S505: Set the traversal order of the vertices contained in polygon A as follows: Starting from the initial point A of the outer rectangle, traverse each vertex of the outer rectangle in a clockwise order until the traversal is completed and the vertices return to the initial point of the outer rectangle. Then, add the initial point of polygon number 1, and starting from the initial point of polygon number 1, traverse in a counter-clockwise order to the vertex that is closest to the initial point of polygon number 2; then, starting from the initial point of polygon number 2, traverse in a counter-clockwise order to the vertex that is closest to the initial point of polygon number 3. The vertex of the polygon is added; and so on, until the initial point of the polygon with the largest number n is added. Then, the vertices of the polygon with the number n are traversed in counterclockwise order until the traversal is completed and the vertices of the polygon with the number n are returned to the initial point of the polygon with the number n. Then, the vertex of the polygon with the number n-1 is added that is closest to the initial point of the polygon with the number n, and the traversal starts from that vertex and proceeds in counterclockwise order to the initial point of the polygon with the number n-1. This process is repeated until the initial point of the polygon with the number 1 is reached. Finally, the initial point of the outer rectangle is added.

4. The method for simplifying and merging administrative region boundaries according to claim 1, characterized in that: The triangulation was performed using the ear-cutting method.

5. The method for simplifying and merging administrative region boundaries according to claim 1, characterized in that: After triangulation, the process also includes: for each pair of adjacent triangles, determining whether the quadrilateral formed by the pair of adjacent triangles satisfies the following conditions: the quadrilateral is a convex polygon and the two adjacent triangles do not conform to Delaunay's rule. If it satisfies the condition, then attempt to flip the diagonal of the quadrilateral and determine whether the minimum interior angle of the two new triangles formed after the flip is greater than the minimum interior angle of the two triangles before the flip. If so, then use the result after the flip; otherwise, retain the result before the flip.

6. The method for simplifying and merging administrative region boundaries according to claim 1, characterized in that: The formula for calculating the length threshold of the boundary edge is maxEdgeLength=EdgeLengthRatio*(maxEdgeLen-minEdgeLen)+minEdgeLen, where maxEdgeLength represents the length threshold of the boundary edge, EdgeLengthRatio represents the ratio threshold, maxEdgeLen represents the maximum length of the boundary edge, and minEdgeLen represents the minimum length of the boundary edge.

7. A simplified and merged terminal device for administrative region boundaries, characterized in that: It includes a processor, a memory, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the steps of the method as described in any one of claims 1 to 6.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 6.