Boundary detection method based on maximum inscribed convex polygon and separation axis theorem
Patent Information
- Application Number
- CN202611021451.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-09
- Publication Date
- 2026-11-03
AI Technical Summary
Existing technologies suffer from high computational complexity and difficulty in balancing real-time performance and accuracy when detecting the intersection of irregular geographic polygons with target geographic objects. This is especially true in scenarios where large core areas coexist with a small number of concave corner areas, where existing methods incur unnecessary computational overhead and detection redundancy.
By constructing the largest inscribed convex polygon inside the irregular geographic polygon and performing convex decomposition on the difference set region, a hierarchical detection structure of core region and corner region is formed, and detection is performed by combining the separating axis theorem and spatial index structure.
It improves the efficiency and accuracy of geographic boundary intersection detection, reduces the number of unnecessary candidate detections, reduces computational pressure, and ensures the reliability and feasibility of detection results.
Smart Images

Figure CN123032733A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of geographic information processing, spatial computing and boundary intersection detection technology, and in particular to a boundary detection method based on the maximum inscribed convex polygon and the separating axis theorem. Background Technology
[0002] In geographic information systems (GIS), urban planning, autonomous driving, remote sensing analysis, nature reserve monitoring, on-board electronic fences, and other spatial target management scenarios, it is frequently necessary to determine whether a target geographic object intersects with a specified geographic boundary. The target geographic object can be a point buffer zone, the spatial coverage area of a vehicle or equipment, a remote sensing identification area, an administrative division object, a protected area object, an operational area object, or other spatial range objects composed of coordinate points. Geographic boundaries typically manifest as irregular geographic polygons, which may have concave structures, sharp corner structures, edge and corner regions, and complex boundary morphologies.
[0003] In existing technologies, common methods for intersection detection between irregular geographic polygons and target geographic objects include direct polygon boundary intersection calculation, point-within-polygon judgment, ray casting, rasterization judgment, bounding rectangle filtering, and candidate region selection based on spatial indexing. Direct polygon boundary intersection calculation requires traversing a large number of boundary segments, resulting in high computational complexity in scenarios with a large number of irregular polygon vertices, a large number of target objects, or high real-time requirements. Ray casting and point-within-polygon judgment are suitable for specific types of containment relationship judgments, but when the target object itself is a face object or a non-convex polygon, further processing of boundary intersections, containment, and overlaps is required. While rasterization judgment can reduce some computational complexity, raster precision affects the judgment results, and in scenarios with high precision requirements, it incurs significant storage and computational overhead.
[0004] The Separating Axis Theorem (SAT) is commonly used for intersection detection between convex polygons. For two convex polygons, if there exists an axis such that the projection intervals of the two polygons on that axis do not overlap, then the two convex polygons do not intersect; if the projection intervals on all candidate separating axes overlap, then the two convex polygons intersect. This method has clear logic and high computational efficiency, but its applicable objects are usually convex polygons. When the geographic boundary to be detected is an irregular non-convex polygon, directly applying the Separating Axis Theorem for overall judgment may not yield correct results. Therefore, it is necessary to convert the irregular geographic polygons into a set of convex polygons suitable for processing by the Separating Axis Theorem, or to design a boundary detection process that balances fast filtering and accurate judgment.
[0005] Some existing solutions perform convex decomposition on the entire irregular geographic polygon and then perform intersection detection with the target geographic object one by one. While this approach can utilize convex polygon detection algorithms, if the entire region is decomposed into a large number of convex polygons, it will result in a large number of candidate detections. This is especially true for irregular geographic polygons with large core areas and a few concave corner areas, where full convex decomposition will cause unnecessary computational overhead. Other solutions first use bounding rectangles for coarse filtering and then use complex polygon intersection algorithms for precise judgment, but it is still difficult to achieve a good balance between real-time performance, accuracy, and scalability.
[0006] Therefore, there is an urgent need for a method that can preprocess irregular geographic polygons and combine the separating axis theorem and spatial indexing structure to achieve fast and accurate boundary detection. Summary of the Invention
[0007] To address the problems existing in the prior art, the purpose of this application is to provide a boundary detection method based on the maximum inscribed convex polygon and the separating axis theorem. By constructing a maximum inscribed convex polygon inside an irregular geographic polygon and performing convex decomposition on the difference region between the irregular geographic polygon and the maximum inscribed convex polygon, a layered detection structure of core region and corner region is formed, thereby improving the efficiency of geographic boundary intersection detection and maintaining the reliability of the detection results.
[0008] To achieve the above-mentioned objectives, this application provides a boundary detection method based on the maximum inscribed convex polygon and the separating axis theorem, comprising the following steps:
[0009] Step S1: Obtain the irregular geographic polygon to be detected, construct the largest inscribed convex polygon located inside the irregular geographic polygon, and perform convex decomposition on the difference region between the irregular geographic polygon and the largest inscribed convex polygon to obtain the set of convex polygons in the corner region.
[0010] Step S2: Obtain the spatial extent of the target geographic object, and perform global range filtering based on the spatial extent of the target geographic object and the spatial extent of the irregular geographic polygon;
[0011] Step S3: If the target geographic object is not filtered out by the global scope, detect whether the target geographic object intersects with the largest inscribed convex polygon based on the separating axis theorem. If they intersect, output the detection result of the intersection between the target geographic object and the irregular geographic polygon.
[0012] Step S4: If the target geographic object does not intersect with the largest inscribed convex polygon, then based on the spatial index structure, query the set of candidate convex polygons related to the spatial range of the target geographic object in the set of convex polygons in the corner region.
[0013] Step S5: Detect whether the target geographic object intersects with the candidate convex polygon set based on the separating axis theorem;
[0014] Step S6: Based on the detection results of step S3 or step S5, output the boundary detection results of whether the target geographic object intersects or does not intersect with the irregular geographic polygon.
[0015] According to one technical solution of this application, step S1 specifically includes:
[0016] Step S11: Obtain the vertex sequence of the irregular geographic polygon, the vertex sequence including multiple vertex coordinates arranged in boundary order;
[0017] Step S12: Using the vertex sequence as the initial candidate vertex set, construct the maximum inscribed convex polygon by vertex culling, so that the maximum inscribed convex polygon is completely located inside the irregular geographic polygon;
[0018] Step S13: Find the difference region between the irregular geographic polygon and the largest inscribed convex polygon, perform convex decomposition on the difference region, and generate the set of convex polygons covering the corner region of the difference region.
[0019] According to one technical solution of this application, step S12 specifically includes:
[0020] Step S121: Use all the vertices of the irregular geographical polygon as the current candidate vertex set;
[0021] Step S122: For the vertices to be removed in the current candidate vertex set, construct two edge vectors based on the previous and next adjacent vertices of the vertex to be removed, and determine the local turning attribute of the vertex to be removed based on the cross product of the two edge vectors.
[0022] Step S123: If the remaining vertices after removing the vertices to be removed can form a convex polygon, and the formed convex polygon is located inside the irregular geographical polygon, then vertex removal is performed.
[0023] Step S124: Repeat steps S122 and S123 until there are no vertices that meet the removal criteria.
[0024] Step S125: The final convex polygon is taken as the largest inscribed convex polygon;
[0025] In the vertex culling process, the area of the convex polygon obtained after culling is used as the evaluation index. When the area decreases beyond the preset threshold due to multiple consecutive cullings, the state of the previous candidate vertex set is restored and the vertex to be culled is switched.
[0026] According to one technical solution of this application, step S13 specifically includes:
[0027] Step S131: Extract the boundary point set of the difference set region, the boundary point set includes boundary points located on the boundary of the irregular geographic polygon and not falling inside the largest inscribed convex polygon.
[0028] Step S132: Using the boundary of the difference set region as the constraint edge, perform constrained Delaunay triangulation to obtain a triangular mesh covering the difference set region;
[0029] Step S133: Merge adjacent triangles in the triangulation network, and each time prioritize the combination that reduces the number of triangles the most after merging and maintains the convexity of the merging result;
[0030] Step S134: If the area ratio of the merged polygon is lower than the preset area threshold, reject the corresponding merge;
[0031] Step S135: Repeat the adjacent triangle merging process until there are no more combinations that meet the merging conditions, and obtain the set of convex polygons in the corner region;
[0032] Wherein, each polygon in the set of convex polygons in the corner region is a convex polygon, and the union of the set of convex polygons in the corner region covers the difference region.
[0033] According to one technical solution of this application, step S2 specifically includes:
[0034] Step S21: Calculate the minimum x-coordinate, maximum x-coordinate, minimum y-coordinate, and maximum y-coordinate of the target geographic object based on the vertex coordinates of the target geographic object;
[0035] Step S22: Calculate the minimum x-coordinate, maximum x-coordinate, minimum y-coordinate, and maximum y-coordinate of the irregular geographical polygon based on the vertex coordinates of the irregular geographical polygon;
[0036] Step S23: When the maximum x-coordinate of the target geographic object is less than the minimum x-coordinate of the irregular geographic polygon, or the minimum x-coordinate of the target geographic object is greater than the maximum x-coordinate of the irregular geographic polygon, or the maximum y-coordinate of the target geographic object is less than the minimum y-coordinate of the irregular geographic polygon, or the minimum y-coordinate of the target geographic object is greater than the maximum y-coordinate of the irregular geographic polygon, it is determined that the target geographic object and the irregular geographic polygon do not intersect and the detection ends.
[0037] According to one technical solution of this application, step S3 specifically includes:
[0038] Step S31: Determine whether the target geographic object is a convex polygon; if the target geographic object is a convex polygon, then the target geographic object is taken as the target convex polygon; if the target geographic object is a non-convex polygon, then the target geographic object is decomposed into a convex polygon to obtain a set of target convex polygons.
[0039] Step S32: Perform the separating axis theorem detection on the largest inscribed convex polygon and the target convex polygon, or perform the separating axis theorem detection on the largest inscribed convex polygon and each target convex polygon in the set of target convex polygons respectively;
[0040] Step S33: If any target convex polygon intersects with the largest inscribed convex polygon, then it is determined that the target geographic object intersects with the irregular geographic polygon.
[0041] Step S34: If none of the target convex polygons intersect with the largest inscribed convex polygon, proceed to step S4.
[0042] According to one technical solution of this application, the separation shaft theorem detection includes:
[0043] Step S321: Obtain each edge of the two convex polygons involved in the detection, and calculate the normal vector corresponding to each edge;
[0044] Step S322: Normalize, directionally normalize, and remove redundancy from the normal vectors to obtain a unique set of separating axes;
[0045] Step S323: Project each vertex of the two convex polygons involved in the detection onto each separation axis in the unique separation axis set to obtain the projection intervals of the two convex polygons on each separation axis;
[0046] Step S324: If there exists at least one separating axis that prevents the two projection intervals from overlapping, then it is determined that the two convex polygons involved in the detection do not intersect.
[0047] Step S325: If the two projection intervals overlap on all separation axes, then the two convex polygons involved in the detection are determined to intersect.
[0048] According to one technical solution of this application, step S4 includes:
[0049] Step S41: Using the outer bound of each convex polygon in the set of convex polygons in the corner region as the index object, establish a spatial index structure;
[0050] Step S42: Using the spatial range of the target geographic object as the query range, query the convex polygons of the corner regions that intersect the outer range and the query range in the spatial index structure;
[0051] Step S43: Form the candidate convex polygon set by combining the convex polygons of the queried corner regions;
[0052] The spatial index structure is either an R-tree index structure or a quadtree index structure.
[0053] According to one technical solution of this application, steps S5 and S6 include:
[0054] Step S51: If the target geographic object is a non-convex polygon, then the target geographic object is decomposed into a convex polygon to obtain a set of target convex polygons; if the target geographic object is a convex polygon, then the target geographic object is used as a target convex polygon.
[0055] Step S52: Perform the separating axis theorem detection on each candidate convex polygon in the candidate convex polygon set and the target convex polygon, or perform the separating axis theorem detection on each target convex polygon in the target convex polygon set.
[0056] Step S53: If any candidate convex polygon intersects with any target convex polygon, output the intersection flag;
[0057] Step S54: If the candidate convex polygon set is empty, or if none of the candidate convex polygons in the candidate convex polygon set intersect with the target convex polygon or the target convex polygon set, then output a non-intersection flag.
[0058] According to one aspect of this application, a boundary detection device is proposed, comprising:
[0059] The data acquisition module is used to acquire the irregular geographic polygons and target geographic objects to be detected.
[0060] The preprocessing module is used to construct the largest inscribed convex polygon located inside the irregular geographic polygon, and to perform convex decomposition on the difference region between the irregular geographic polygon and the largest inscribed convex polygon to obtain a set of convex polygons in the corner region.
[0061] A global filtering module is used to perform global range filtering based on the spatial range of the target geographic object and the spatial range of the irregular geographic polygon.
[0062] The core region detection module is used to detect whether the target geographic object intersects with the largest inscribed convex polygon based on the separating axis theorem.
[0063] The index positioning module is used to query a set of candidate convex polygons related to the spatial extent of the target geographic object in the set of convex polygons in the corner region based on the spatial index structure.
[0064] The corner region detection module is used to detect whether the target geographic object intersects with the candidate convex polygon set based on the separating axis theorem;
[0065] The result output module is used to output the boundary detection results of whether the target geographic object intersects or does not intersect with the irregular geographic polygon.
[0066] Compared with existing technologies, the boundary detection method based on the maximum inscribed convex polygon and the separating axis theorem provided in this application has the following significant technical advantages:
[0067] By dividing irregular geographic polygons into a core region corresponding to the maximally inscribed convex polygon and a set of corner convex polygons corresponding to the difference region, most target objects located within or intersecting the core region can quickly obtain intersection results, reducing the need for individual detection of all corner regions. For target objects that do not intersect with the core region, a spatial indexing structure is used to locate potentially intersecting corner convex polygons, and the separating axis theorem is used for accurate detection, which reduces the number of unnecessary candidate detections.
[0068] This invention employs a circumscribed range for global filtering, which can exclude obviously non-intersecting target geographic objects at an early stage, reducing the computational burden of subsequent convex decomposition detection and separating axis theorem detection. For target geographic objects that are non-convex polygons, this invention adapts them to the separating axis theorem through convex decomposition, helping to ensure the uniformity and feasibility of the complex target object detection process.
[0069] This invention reduces redundant axis projection calculations and improves detection efficiency by normalizing, directionally normalizing, and eliminating redundancy in the separation axis normal vectors, while avoiding redundant processing caused by equivalent normal vectors with opposite directions. By using spatial indexing structures such as R-trees or quadtrees to query convex polygons in corner regions, the efficiency of candidate region localization can be improved in large-scale geographic boundary detection tasks. Attached Figure Description
[0070] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly described below. Obviously, the drawings described below are only some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without creative effort.
[0071] Figure 1 This is a schematic diagram illustrating the flow of the geographic boundary detection method based on the maximum inscribed convex polygon and the separating axis theorem provided in this application embodiment.
[0072] Figure 2A schematic diagram illustrating the structure of an irregular geographic polygon, a maximum inscribed convex polygon, and a region of edge-corner difference.
[0073] Figure 3 A schematic diagram illustrating the projection detection of convex polygons based on the separating axis theorem. Detailed Implementation
[0074] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0075] It should be noted that, unless otherwise specified, the embodiments and features described in the embodiments of this application can be combined with each other. The following embodiments only illustrate several implementation methods of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the patent application. It should be pointed out that, for those skilled in the art, several modifications and improvements can be made without departing from the concept of this application, and these all fall within the protection scope of this application.
[0076] like Figures 1 to 3 As shown, this application proposes a geographic boundary detection method based on the maximum inscribed convex polygon and the separating axis theorem. This method can be executed in a geographic information system server, edge computing device, vehicle-mounted computing platform, remote sensing image processing platform, spatial database server, or on-board electronic fence judgment module. The irregular geographic polygon to be detected can be an administrative region boundary, electronic fence boundary, planned area boundary, protected area boundary, work permit area boundary, or other spatial area boundary. The target geographic object can be a point object buffered to form a polygon object, or it can be a buffered area of a line object, an area occupied by a vehicle or equipment, a polygon recognition result, a remote sensing target area, or other spatial objects described by vertex coordinates.
[0077] In this application, the term "irregular geographic polygon" is used to represent a polygonal region with geographic spatial meaning. This polygon can be a convex polygon or a non-convex polygon, and is particularly suitable for irregular non-convex polygons with concavity, sharp corners, extended edges, or complex boundaries. The term "maximum inscribed convex polygon" is used to represent an inscribed convex polygon region with a large area located inside the irregular geographic polygon. This maximum inscribed convex polygon is used as the core detection region.
[0078] Implementation Method 1: Overall Testing Process
[0079] like Figure 1As shown in the figure, this embodiment provides a geographic boundary detection method, which includes the following steps.
[0080] Step S1: Obtain the irregular geographic polygon to be detected, construct the largest inscribed convex polygon located inside the irregular geographic polygon, and perform convex decomposition on the difference region between the irregular geographic polygon and the largest inscribed convex polygon to obtain the set of convex polygons in the corner region.
[0081] Specifically, irregular geographic polygons can be represented as a sequence of vertices: ;
[0082] in, , Indicates the first The x-coordinates of the vertices, Indicates the first The ordinates of each vertex are given. The vertex sequence is arranged according to the polygon boundary order, which can be clockwise or counterclockwise. Before actual calculation, the vertex sequence can be preprocessed, including deleting duplicate vertices, merging adjacent vertices with a distance less than a preset distance threshold, checking whether the first and last vertices are closed, identifying self-intersecting boundaries and providing anomaly warnings, etc. For those skilled in the art, the above preprocessing can be implemented using conventional geometric algorithms.
[0083] Subsequently, a maximum inscribed convex polygon is constructed based on the vertex sequence. The largest inscribed convex polygon satisfy That is, entirely located within an irregular geographical polygon. Internal. Find the difference region. Furthermore, a convex decomposition is performed on the difference set region to obtain a set of convex polygons in the corner regions. .in, It is a convex polygon, and The union of each convex polygon covers the difference region. The set of convex polygons in the corner regions is used for accurate detection of subsequent non-core regions.
[0084] Step S2: Obtain the spatial extent of the target geographic object and perform global extent filtering based on the spatial extent of the target geographic object and the spatial extent of the irregular geographic polygon.
[0085] Specifically, the bounding boundary of the target geographic object T and the bounding boundary of the irregular geographic polygon P are calculated. If the two bounding boundaries do not overlap in the horizontal or vertical coordinate direction, it can be directly determined that T and P do not intersect, and the detection ends. This step can filter out target objects that are far away or obviously impossible to intersect.
[0086] Step S3: If the target geographic object is not excluded by the global scope filter, detect the target geographic object and the maximum inscribed convex polygon based on the separating axis theorem. Does the object intersect? If it intersects, output the detection result of the intersection between the target geographic object and the irregular geographic polygon P.
[0087] because Completely located within P, therefore as long as the target geographic object T is... Once the intersection is confirmed, it can be determined that T and P intersect. At this point, there is no need to further detect the corner regions, and the intersection result can be directly output.
[0088] Step S4: If the target geographic object T and the largest inscribed convex polygon If they do not intersect, then based on the spatial index structure, a set of convex polygons in the corner regions is formed. In the query, select the set of candidate convex polygons related to the spatial extent of the target geographic object. .
[0089] Specifically, convex polygons are pre-defined for each corner region. The bounding bound of the target geographic object T is used to establish a spatial index structure for the indexed object. This spatial index structure can be an R-tree or a quadtree. During a query, the bounding bound of the target geographic object T is used as the query range. The system returns convex polygons representing the corner regions where the bounding bound intersects with the query range, forming a set of candidate convex polygons. .
[0090] Step S5: Detect the target geographic object T and the candidate convex polygon set based on the separating axis theorem. Does the polygon intersect? If any candidate convex polygon intersects the target geographic object, output an intersection flag; otherwise... Empty, or If none of the candidate convex polygons intersect with the target geographic object, then output a non-intersection flag.
[0091] Step S6: Based on the detection results of step S3 or step S5, output the boundary detection results of whether the target geographic object intersects or does not intersect with the irregular geographic polygon.
[0092] This multi-stage workflow, encompassing global filtering, rapid core region identification, spatial indexing, and precise corner region detection, reduces the average computational cost of detecting intersections of irregular geographic polygons. For large-scale object detection tasks, many obviously non-intersecting objects can be excluded in the outer bounding stage; many objects intersecting with the main geographic boundary can be directly output as intersecting objects in the maximum inscribed convex polygon stage; only objects that do not hit the core region are included in the corner region detection. This workflow avoids the redundant computation caused by completely decomposing the entire irregular geographic polygon and detecting each one individually, and also avoids the logical problem of equating "not intersecting with the core region" with "not intersecting with the original polygon," thus improving detection efficiency and result reliability.
[0093] Implementation Method 2: Construction of the Maximum Inscribed Convex Polygon
[0094] In this embodiment, the largest inscribed convex polygon in step S1 It can be built using the following steps.
[0095] Step S11: Obtain the vertex sequence of the irregular geographic polygon P. The vertex sequence includes the coordinates of multiple vertices arranged in boundary order.
[0096] Step S12: Using the vertex sequence as the initial candidate vertex set, construct the maximum inscribed convex polygon by vertex culling, so that the maximum inscribed convex polygon is completely located inside the irregular geographic polygon.
[0097] Specifically, step S12 may include the following steps.
[0098] Step S121: Use all vertices of the irregular geographic polygon as the current candidate vertex set. In the initial state, .
[0099] Step S122: Select the vertices to be removed from the current candidate vertex set. Based on the previous adjacent vertex of the vertex to be removed and the next adjacent vertex Construct two edge vectors:
[0100] ,
[0101] .
[0102] Based on the cross product of the two edge vectors Determine the local orientation attribute of the vertex to be removed. For a sequence of vertices arranged in a uniform direction, the local orientation attribute can be used to identify concave, convex, or degenerate vertices.
[0103] Step S123: Remove vertices to be removed. If the remaining vertices can form a convex polygon, and the formed convex polygon is located inside the irregular geographic polygon, vertex culling is performed. Whether a convex polygon is formed can be determined by checking whether the cross product signs of all adjacent edge vectors are consistent or meet a preset tolerance; whether it is located inside the irregular geographic polygon can be determined by boundary intersection detection, vertex inclusion detection, or sampling point inclusion detection.
[0104] Step S124: Repeat steps S122 and S123 until no vertex meets the elimination criteria.
[0105] Step S125: Use the final convex polygon as the largest inscribed convex polygon. .
[0106] During vertex culling, the area of the resulting convex polygon is used as the evaluation metric. If multiple consecutive culling attempts cause the area to decrease beyond a preset threshold, the system reverts to the previous candidate vertex set and switches to a new vertex set to be culled. Specifically, an area threshold θ can be set. A And the threshold k for consecutive removals. When the area reduction ratio after k consecutive removals exceeds θ A If the current culling path is causing excessive shrinkage of the core region, then the system should revert to the previous candidate vertex set state and switch to other vertices to be culled or use a different culling order. The area reduction ratio can be expressed as: r = (A prev —A new ) / A prev ;
[0107] Among them, A prev A represents the area of the candidate polygons before elimination. new This represents the area of the candidate polygons after elimination.
[0108] In one alternative implementation, concave vertices or vertices that result in non-convexity can be preferentially eliminated; when multiple vertices can be eliminated, the candidate with the larger area after elimination can be selected. Alternatively, heuristic search, local backtracking, or multi-starting-point elimination strategies can be employed to obtain a larger inscribed convex polygon. For complex geographic boundaries, the construction of the largest inscribed convex polygon can be completed offline, and the results can be cached or stored in a spatial database for reuse in subsequent multi-object detection.
[0109] By combining vertex culling, convexity checking, internality checking, area evaluation, and threshold backtracking, the algorithm can retain a larger core region area while ensuring that the resulting convex polygon lies within the original irregular geographic polygon. A larger core region can cover the main part of the irregular geographic polygon, allowing for intersection results for a large number of subsequent target objects during the core region detection stage, thus reducing the number of corner region detections. The area evaluation and backtracking mechanisms mitigate the risk of excessive core region shrinkage caused by simple sequential culling, making the algorithm highly adaptable and feasible for engineering applications with different irregular boundary shapes.
[0110] Implementation Method 3: Convex Decomposition of Difference Region
[0111] In this embodiment, such as Figure 3 As shown, step S13 is used to obtain the irregular geographic polygon P and the largest inscribed convex polygon. The difference region D between the two regions is determined, and a convex decomposition is performed on the difference region D to generate a set of convex polygons in the corner regions. .
[0112] Step S131: Extract the boundary point set of the difference region D. The boundary point set includes boundary points located on the boundary of the irregular geographic polygon and not falling inside the largest inscribed convex polygon, and may also include boundary points adjacent to the largest inscribed convex polygon and the difference region, as well as necessary intersection points.
[0113] Step S132: Using the boundary of the difference set region D as constraint edges, perform constrained Delaunay triangulation to obtain a triangular mesh covering the difference set region D. Constrained Delaunay triangulation can divide a complex difference set region into multiple triangles while preserving the boundary constraints of the difference set region. Each triangle is a convex polygon, thus naturally suitable for subsequent separation axis theorem detection.
[0114] Step S133: Merge adjacent triangles in the triangulation network, prioritizing combinations that significantly reduce the number of triangles after merging and maintain convexity. Whether adjacent triangles can be merged is determined by checking if the polygon formed by the boundary vertices after merging is a convex polygon. If the merged polygon is non-convex, the merge is rejected.
[0115] Step S134: If the area ratio of the merged polygon is lower than a preset area threshold, reject the corresponding merge. The area ratio can be determined based on the relationship between the area of the merged polygon and the area of its corresponding circumscribed region, the area of the local difference set, or the sum of the areas of multiple triangles before merging. Setting this condition helps avoid generating convex polygons that are too long or narrow or have poor computational performance.
[0116] Step S135: Repeat the adjacent triangle merging process until no combination satisfies the merging condition, resulting in a set of convex polygons in the corner region. .gather Each polygon in the set is a convex polygon, and the set The union covers the difference region D.
[0117] In an alternative implementation, the difference set region D can be composed of multiple disconnected sub-regions. For each disconnected sub-region, constrained Delaunay triangulation and convexity merging can be performed separately, and then the convex polygons generated by each sub-region can be uniformly added to the set of convex polygons of the corner region. For geographic boundaries with hole structures, the hole boundaries can also be used as constraint edges in the triangulation to avoid the triangulation results covering non-target regions.
[0118] By first constraining the difference set region with Delaunay triangulation and then merging adjacent triangles using convexity, the number of final convex polygons can be reduced while maintaining the integrity of the corner region coverage. Compared to directly performing convex decomposition on the entire irregular geographic polygon, this implementation only processes the difference set region outside the largest inscribed convex polygon, resulting in a smaller decomposition range and a typically smaller set of convex polygons in the corner region. This approach also avoids using difficult-to-prove outcome constraints such as "minimum number" or "globally optimal convex decomposition," and ensures the feasibility of the scheme with explicit decomposition and merging steps, which is beneficial for improving algorithm stability and clarity of review.
[0119] Implementation Method 4: Global Filtering
[0120] In this embodiment, step S2 includes the following process.
[0121] Step S21: Calculate the minimum x-coordinate of the target geographic object T based on the vertex coordinates of the target geographic object T. Maximum x-coordinate Minimum y-coordinate and maximum ordinate .
[0122] Step S22: Calculate the minimum x-coordinate of the irregular geographical polygon P based on the vertex coordinates of the irregular geographical polygon P. Maximum x-coordinate Minimum y-coordinate and maximum ordinate .
[0123] Step S23: When any of the following conditions are met, determine that the target geographic object T does not intersect with the irregular geographic polygon P and end the detection:
[0124] < ;
[0125] > ;
[0126] < ;
[0127] > .
[0128] If none of the above conditions are met, the outer bound of the target geographic object overlaps with the outer bound of the irregular geographic polygon, and the target geographic object is not filtered out by the global scope. Continue to execute step S3.
[0129] In this embodiment, the "horizontal coordinate" and "vertical coordinate" can correspond to the x and y coordinates in a Cartesian coordinate system, or to the longitude and latitude in a latitude-longitude coordinate system. In geographical scenarios requiring high-precision area or distance calculations, the latitude and longitude coordinates can be projected to an appropriate Cartesian coordinate system before performing area calculations, convexity checks, and separation axis theorem detection.
[0130] Global scope filtering is a computationally inexpensive pre-screening step that only requires comparing the coordinates of the bounding boundaries of the target geographic object and the irregular geographic polygon. For batch target detection in large-scale geographic scenes, many target objects are spatially far from the detection boundary; this can be quickly eliminated by comparing bounding boundaries, thus avoiding subsequent convex decomposition matching, spatial index lookup, and separating axis projection calculations. This step has a simple structure, is easy to parallelize, and can be used in conjunction with the bounding rectangle index in the spatial database to improve the overall detection throughput.
[0131] Implementation Method 5: Separation Shaft Theorem Detection
[0132] In this embodiment, the separation axis theorem detection in steps S3 and S5 may include the following process.
[0133] Step S31: Determine whether the target geographic object T is a convex polygon. If the target geographic object T is a convex polygon, then treat the target geographic object T as a target convex polygon; if the target geographic object T is a non-convex polygon, then perform convex decomposition on the target geographic object T to obtain the set of target convex polygons G={G1,G2,…,G…} l The convex decomposition of the target object can be achieved using triangulation, ear sectioning, monotonic polygon decomposition, or other known convex decomposition algorithms.
[0134] Step S32: The largest inscribed convex polygon Perform the separating axis theorem detection on the target convex polygon, or use the largest inscribed convex polygon as the reference. Perform the separation axis theorem detection on each of the target convex polygons in the target convex polygon set G.
[0135] Step S33: If any target convex polygon and the largest inscribed convex polygon If they intersect, then the target geographic object T is determined to intersect with the irregular geographic polygon P.
[0136] Step S34: If none of the target convex polygons are inscribed with the largest inscribed convex polygon If they intersect, proceed to step S4.
[0137] For any two convex polygons A and B involved in the detection, the separating axis theorem detection includes the following steps.
[0138] Step S321: Obtain each edge of convex polygons A and B, and calculate the normal vector corresponding to each edge. Let the starting point of a certain edge be... The destination is edge vectors Then one of its normal vectors is the separation axis. Represented as .
[0139] Step S322: Normalize, normalize the direction, and remove redundancy from the normal vectors to obtain a unique set of separating axes. Normalization can be expressed as:
[0140] .
[0141] Direction normalization can merge normal vectors with opposite directions into the same direction according to preset rules, such as defining the first non-zero component of the normalized normal vector as positive. Redundancy removal can be achieved based on vector angles, dot products, or coordinate tolerances.
[0142] Step S323: Project each vertex of the two convex polygons A and B involved in the detection onto each separation axis in the unique set of separation axes, thus obtaining the projection intervals of the two convex polygons on each separation axis. For the separation axis... and vertex The projection value can be expressed as:
[0143] .
[0144] The projection interval of convex polygon A on the separating axis s is:
[0145] [minA, maxA],
[0146] Where minA is the minimum value of the projection of all vertices in A, and maxA is the maximum value of the projection of all vertices in A. Similarly, the projection interval of the convex polygon N is [minB, maxB].
[0147] Step S324: If there exists at least one separating axis that prevents the two projection intervals from overlapping, i.e., maxA < minB or maxB < minA, then it is determined that the two convex polygons involved in the detection do not intersect.
[0148] Step S325: If the two projection intervals overlap on all separation axes, then the two convex polygons involved in the detection are determined to intersect.
[0149] Steps S321 to S325 above define a general procedure for detecting the separating axis theorem between any two convex polygons. In the overall method of this application, this general procedure is reused at two different detection levels:
[0150] (1) Core region detection (step S3): The largest inscribed convex polygon As the first convex polygon, each convex polygon in the convex decomposition set G of the target geographic object is used as the second convex polygon, and steps S321 to S325 are executed.
[0151] (2) Precise detection of corner regions (step S5): Set up candidate corner convex polygons Each convex polygon in the first convex polygon is taken as the first convex polygon, and each convex polygon in the convex decomposition set G of the target geographic object is taken as the second convex polygon. Then, steps S321 to S325 are executed.
[0152] By reusing the same set of separation axis theorem detection logic, the consistency of mathematical detection principles between the core area and the corner areas is ensured, and the repetitive description of the same projection and interval judgment process is avoided, making the instruction manual more concise and clear as a whole.
[0153] Furthermore, in corner region detection, if the target geographic object is a convex polygon, then the candidate convex polygon set is... Each candidate convex polygon in the array is subjected to the separating axis theorem detection against the target convex polygon; if the target geographic object is a non-convex polygon, then... Each candidate convex polygon in the set is subjected to the separating axis theorem detection with each target convex polygon in the set of target convex polygons G. If any candidate convex polygon intersects with any target convex polygon, an intersection flag is output; if the set of candidate convex polygons is empty, or if all detections show no intersection, a non-intersection flag is output.
[0154] The separating axis theorem is applicable to intersection detection between convex polygons. The calculation process mainly includes constructing edge normal vectors, calculating projection intervals, and determining interval overlap. The logic is clear and easy to implement in a program. This implementation splits irregular geographic polygons into a set of maximally inscribed convex polygons and a set of convex polygons in the corner regions. When the target geographic object is a non-convex polygon, target convex decomposition is performed, ensuring that all objects participating in SAT detection are convex polygons, thus guaranteeing the applicability of the algorithm. Normalizing and deduplicating the normal vectors reduces the number of repeated projection axes, lowering the computational load for each detection and providing a significant efficiency advantage in batch detection scenarios.
[0155] Implementation Method Six: Spatial Index Structure
[0156] In this embodiment, step S4 includes the following process.
[0157] Step S41: Set convex polygons in the corner regions Convex polygons The outer scope is used as the index object to establish a spatial index structure.
[0158] When using an R-tree index structure, each The smallest bounding rectangle is used as the leaf node object, and range queries are implemented using the level bounding rectangle of the R-tree. When using a quadtree index structure, the grid can be recursively divided according to the spatial range, and each The bounding extent is inserted into the corresponding node. The spatial index structure can be established during the preprocessing stage and reused when the boundaries of irregular geographic polygons remain unchanged.
[0159] Step S42: Using the spatial range of the target geographic object T as the query range, query the convex polygons of the corner regions where the outer range intersects with the query range in the spatial index structure.
[0160] Step S43: Form a candidate convex polygon set from the queried corner convex polygons. .
[0161] like If empty, it means that there are no convex polygons with corner regions that may intersect with the target geographic object at the outer bounding level, and a non-intersection flag can be output directly. If not empty, continue with SAT precise detection.
[0162] While the set of convex polygons in the corner regions is already smaller than the original overall convex decomposition, it may still contain multiple convex polygons in complex boundary or batch object detection. Using spatial indexing structures such as R-trees or quadtrees avoids traversing all corner region convex polygons for each target object, instead returning only the candidate set whose circumscribed ranges may intersect. This index query is a coarse-grained screening process; combined with subsequent SAT precise detection, it can reduce the risk of missed detections while lowering the average detection time. For scenarios with static geographic boundaries and dynamic target objects, the index structure's characteristic of building once and querying multiple times can further improve overall processing efficiency.
[0163] Implementation Method Seven: Device Example
[0164] This application also provides a geographic boundary detection device, including a data acquisition module, a preprocessing module, a global filtering module, a core area detection module, an index positioning module, a corner area detection module, and a result output module.
[0165] The data acquisition module is used to acquire irregular geographic polygons and target geographic objects to be detected. The data acquisition module can read data from geographic information databases, vector files, remote sensing results, online map services, positioning devices, or business system interfaces. Data formats can include, but are not limited to, GeoJSON, WKT, Shapefile, spatial database records, or custom coordinate arrays.
[0166] The preprocessing module is used to construct the largest inscribed convex polygon located inside the irregular geographic polygon, and to perform convex decomposition on the difference region between the irregular geographic polygon and the largest inscribed convex polygon, obtaining a set of convex polygons in the corner region. The preprocessing module can also be used to perform vertex cleaning, coordinate projection, area calculation, convexity determination, internality determination, constrained Delaunay triangulation, and adjacent triangle merging.
[0167] The global filtering module performs global range filtering based on the spatial extent of the target geographic object and the spatial extent of the irregular geographic polygon. When the outer extent of the target geographic object does not overlap with the outer extent of the irregular geographic polygon, the global filtering module directly generates a non-overlapping result.
[0168] The core region detection module is used to detect whether a target geographic object intersects with the largest inscribed convex polygon based on the separating axis theorem. When an intersection occurs, the core region detection module sends an intersection flag to the results output module.
[0169] The indexing and locating module is used to query a set of candidate convex polygons related to the spatial extent of a target geographic object from a set of convex polygons in a corner region, based on a spatial index structure. The spatial index structure can be an R-tree index structure or a quadtree index structure.
[0170] The corner region detection module is used to detect whether a target geographic object intersects with a set of candidate convex polygons based on the separating axis theorem. The corner region detection module can call the target object convex decomposition submodule to convert non-convex target objects into a set of target convex polygons.
[0171] The results output module is used to output the boundary detection results of whether the target geographic object intersects or does not intersect with the irregular geographic polygon. The output results may include intersection flags, non-intersection flags, hit region type, hit corner region number, detection time, target object identifier, etc.
[0172] The modular device structure allows the geographic boundary detection process to be broken down into relatively independent functional units such as data acquisition, preprocessing, filtering, core area detection, index query, corner detection, and result output, facilitating deployment on servers, edge devices, or embedded platforms. The preprocessing module can handle static boundaries offline, while the core area detection and corner area detection modules can handle real-time targets online. The index localization module can reuse pre-established index structures. This device can adapt to the needs of concurrent multi-target detection and batch multi-boundary detection, and is easy to maintain and expand.
[0173] Implementation Method 8: Application Scenario Description
[0174] This application can be applied to determine overlapping land use boundaries in urban planning. For example, by treating the planned construction area as the target geographic object and the administrative region or control line boundary as an irregular geographic polygon, it can determine whether the planned area intersects with the specified boundary. Through the layered detection of core and peripheral areas in this application, the efficiency of spatial overlap determination can be improved in the review of a large number of planning objects.
[0175] This application can be applied to electronic fence determination in the fields of autonomous driving or intelligent transportation. For example, by using the vehicle's current location buffer zone or predicted driving area as the target geographic object, and the restricted area, work area, or service area as an irregular geographic polygon, it can determine whether the vehicle has entered or is approaching the corresponding boundary. Since vehicle positions change frequently, the detection process requires high real-time performance. This application reduces the real-time computational burden through preprocessing and index lookup.
[0176] This application can be applied to remote sensing analysis and nature reserve monitoring. For example, suspected change patches identified by remote sensing can be used as target geographic objects, and the boundaries of protected areas, ecological red lines, or monitored areas can be used as irregular geographic polygons to determine whether the change patches fall into or contact the monitored area. For a large number of patch objects in large-scale remote sensing data, the global filtering and spatial indexing of this application have good batch processing efficiency.
[0177] This application can also be applied to scenarios such as satellite-based electronic fences, drone inspection area determination, and emergency management area matching. The above application scenarios are used to illustrate the applicability of this application and do not constitute a limitation on the scope of protection of the claims.
[0178] Geographic boundaries in different application scenarios are often complex, irregular, and involve multi-source data fusion. Target objects may also be numerous, frequently updated, or have complex shapes. This application addresses these issues with a unified spatial range filtering, convex polygon detection, and indexing and localization mechanism, reducing the need to develop separate detection logic for different business scenarios.
[0179] According to one aspect of this application, an electronic device is provided, comprising: one or more processors, one or more memories, and one or more computer programs; wherein the processor is connected to the memory, and the one or more computer programs are stored in the memory, and when the electronic device is running, the processor executes the one or more computer programs stored in the memory to cause the electronic device to perform a boundary detection method based on the maximum inscribed convex polygon and the separating axis theorem as described in any of the above technical solutions.
[0180] 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, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0181] The memory can be an internal storage unit of the terminal device, such as a hard drive or RAM. Alternatively, it can be an external storage device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory can include both internal and external storage units. The memory is used to store the computer program and other programs and data required by the terminal device. It can also be used to temporarily store data that has been output or will be output.
[0182] According to one aspect of this application, a computer-readable storage medium is provided for storing computer instructions, which, when executed by a processor, implement a boundary detection method based on the maximum inscribed convex polygon and the separating axis theorem as described in any of the above technical solutions.
[0183] For example, computer-readable storage media can be read-only memory (ROM), random access memory (RAM), read-only optical disc (CD-ROM), magnetic tape, floppy disk, and optical data storage devices, etc. They can be implemented using program code executable by a computing device, thus allowing them to be stored in a storage device for execution by a computing device, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Therefore, this application is not limited to any particular hardware and software combination.
[0184] This application provides a boundary detection method based on the maximum inscribed convex polygon and the separating axis theorem, which has the following characteristics:
[0185] (1) High-fidelity modeling: The core area of the original polygon is preserved by the maximum inscribed convex polygon, and the corner parts are accurately covered by the minimum convex hull decomposition, avoiding the "oversimplification" problem of the traditional convex hull method and significantly improving the accuracy of boundary expression.
[0186] (2) Minimum convex decomposition: The corner area is decomposed using the "minimum convex hull principle", which minimizes the number of convex polygons and effectively reduces the number of axes and computational load of SAT detection.
[0187] (3) High scalability: The method supports parallel processing of multiple geographic polygons and is suitable for large-scale GIS datasets.
[0188] The above description is merely one embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to the technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this application.
Claims
1. A boundary detection method based on the maximum inscribed convex polygon and the separating axis theorem, characterized in that, Includes the following steps: Step S1: Obtain the irregular geographic polygon to be detected, construct the largest inscribed convex polygon located inside the irregular geographic polygon, and perform convex decomposition on the difference region between the irregular geographic polygon and the largest inscribed convex polygon to obtain the set of convex polygons in the corner region. Step S2: Obtain the spatial extent of the target geographic object, and perform global range filtering based on the spatial extent of the target geographic object and the spatial extent of the irregular geographic polygon; Step S3: If the target geographic object is not filtered out by the global scope, detect whether the target geographic object intersects with the largest inscribed convex polygon based on the separating axis theorem. If they intersect, output the detection result of the intersection between the target geographic object and the irregular geographic polygon. Step S4: If the target geographic object does not intersect with the largest inscribed convex polygon, then based on the spatial index structure, query the set of candidate convex polygons related to the spatial range of the target geographic object in the set of convex polygons in the corner region. Step S5: Detect whether the target geographic object intersects with the candidate convex polygon set based on the separating axis theorem; Step S6: Based on the detection results of step S3 or step S5, output the boundary detection results of whether the target geographic object intersects or does not intersect with the irregular geographic polygon.
2. The boundary detection method according to claim 1, characterized in that, Step S1 specifically includes: Step S11: Obtain the vertex sequence of the irregular geographic polygon, wherein the vertex sequence includes multiple vertex coordinates arranged in boundary order; Step S12: Using the vertex sequence as the initial candidate vertex set, construct the maximum inscribed convex polygon by vertex culling, so that the maximum inscribed convex polygon is completely located inside the irregular geographic polygon; Step S13: Find the difference region between the irregular geographic polygon and the largest inscribed convex polygon, perform convex decomposition on the difference region, and generate the set of convex polygons covering the corner region of the difference region.
3. The boundary detection method according to claim 2, characterized in that, Step S12 specifically includes: Step S121: Use all the vertices of the irregular geographical polygon as the current candidate vertex set; Step S122: For the vertices to be removed in the current candidate vertex set, construct two edge vectors based on the previous and next adjacent vertices of the vertex to be removed, and determine the local turning attribute of the vertex to be removed based on the cross product of the two edge vectors. Step S123: If the remaining vertices after removing the vertices to be removed can form a convex polygon, and the formed convex polygon is located inside the irregular geographical polygon, then vertex removal is performed. Step S124: Repeat steps S122 and S123 until there are no vertices that meet the removal criteria. Step S125: The final convex polygon is taken as the largest inscribed convex polygon; In the vertex culling process, the area of the convex polygon obtained after culling is used as the evaluation index. When the area decreases beyond the preset threshold due to multiple consecutive cullings, the state of the previous candidate vertex set is restored and the vertex to be culled is switched.
4. The boundary detection method according to claim 2, characterized in that, Step S13 specifically includes: Step S131: Extract the boundary point set of the difference set region, the boundary point set includes boundary points located on the boundary of the irregular geographic polygon and not falling inside the largest inscribed convex polygon. Step S132: Using the boundary of the difference set region as the constraint edge, perform constrained Delaunay triangulation to obtain a triangular mesh covering the difference set region; Step S133: Merge adjacent triangles in the triangulation network, and each time prioritize the combination that reduces the number of triangles the most after merging and maintains the convexity of the merging result; Step S134: If the area ratio of the merged polygon is lower than the preset area threshold, reject the corresponding merge; Step S135: Repeat the adjacent triangle merging process until there are no more combinations that meet the merging conditions, and obtain the set of convex polygons in the corner region; Wherein, each polygon in the set of convex polygons in the corner region is a convex polygon, and the union of the set of convex polygons in the corner region covers the difference region.
5. The boundary detection method according to claim 1, characterized in that, Step S2 specifically includes: Step S21: Calculate the minimum x-coordinate, maximum x-coordinate, minimum y-coordinate, and maximum y-coordinate of the target geographic object based on the vertex coordinates of the target geographic object; Step S22: Calculate the minimum x-coordinate, maximum x-coordinate, minimum y-coordinate, and maximum y-coordinate of the irregular geographical polygon based on the vertex coordinates of the irregular geographical polygon; Step S23: When the maximum x-coordinate of the target geographic object is less than the minimum x-coordinate of the irregular geographic polygon, or the minimum x-coordinate of the target geographic object is greater than the maximum x-coordinate of the irregular geographic polygon, or the maximum y-coordinate of the target geographic object is less than the minimum y-coordinate of the irregular geographic polygon, or the minimum y-coordinate of the target geographic object is greater than the maximum y-coordinate of the irregular geographic polygon, it is determined that the target geographic object and the irregular geographic polygon do not intersect and the detection ends.
6. The boundary detection method according to claim 1, characterized in that, Step S3 specifically includes: Step S31: Determine whether the target geographic object is a convex polygon; if the target geographic object is a convex polygon, then the target geographic object is taken as the target convex polygon; if the target geographic object is a non-convex polygon, then the target geographic object is decomposed into a convex polygon to obtain a set of target convex polygons. Step S32: Perform the separating axis theorem detection on the largest inscribed convex polygon and the target convex polygon, or perform the separating axis theorem detection on the largest inscribed convex polygon and each target convex polygon in the set of target convex polygons respectively; Step S33: If any target convex polygon intersects with the largest inscribed convex polygon, then it is determined that the target geographic object intersects with the irregular geographic polygon. Step S34: If none of the target convex polygons intersect with the largest inscribed convex polygon, proceed to step S4.
7. The boundary detection method according to claim 6, characterized in that, The separation axis theorem detection includes: Step S321: Obtain each edge of the two convex polygons involved in the detection, and calculate the normal vector corresponding to each edge; Step S322: Normalize, directionally normalize, and remove redundancy from the normal vectors to obtain a unique set of separating axes; Step S323: Project each vertex of the two convex polygons involved in the detection onto each separation axis in the unique separation axis set to obtain the projection intervals of the two convex polygons on each separation axis; Step S324: If there exists at least one separating axis that prevents the two projection intervals from overlapping, then it is determined that the two convex polygons involved in the detection do not intersect. Step S325: If the two projection intervals overlap on all separation axes, then the two convex polygons involved in the detection are determined to intersect.
8. The boundary detection method according to claim 1, characterized in that, Step S4 includes: Step S41: Using the outer bound of each convex polygon in the set of convex polygons in the corner region as the index object, establish a spatial index structure; Step S42: Using the spatial range of the target geographic object as the query range, query the convex polygons of the corner regions that intersect the outer range and the query range in the spatial index structure; Step S43: Form the candidate convex polygon set by combining the convex polygons of the queried corner regions; The spatial index structure is either an R-tree index structure or a quadtree index structure.
9. The boundary detection method according to claim 1, characterized in that, Steps S5 and S6 include: Step S51: If the target geographic object is a non-convex polygon, then the target geographic object is decomposed into a convex polygon to obtain a set of target convex polygons; if the target geographic object is a convex polygon, then the target geographic object is used as a target convex polygon. Step S52: Perform the separating axis theorem detection on each candidate convex polygon in the candidate convex polygon set and the target convex polygon, or perform the separating axis theorem detection on each target convex polygon in the target convex polygon set. Step S53: If any candidate convex polygon intersects with any target convex polygon, output the intersection flag; Step S54: If the candidate convex polygon set is empty, or if none of the candidate convex polygons in the candidate convex polygon set intersect with the target convex polygon or the target convex polygon set, then output a non-intersection flag.
10. A boundary detection device, characterized in that, include: The data acquisition module is used to acquire the irregular geographic polygons and target geographic objects to be detected. The preprocessing module is used to construct the largest inscribed convex polygon located inside the irregular geographic polygon, and to perform convex decomposition on the difference region between the irregular geographic polygon and the largest inscribed convex polygon to obtain a set of convex polygons in the corner region. A global filtering module is used to perform global range filtering based on the spatial range of the target geographic object and the spatial range of the irregular geographic polygon. The core region detection module is used to detect whether the target geographic object intersects with the largest inscribed convex polygon based on the separating axis theorem. The index positioning module is used to query a set of candidate convex polygons related to the spatial extent of the target geographic object in the set of convex polygons in the corner region based on the spatial index structure. The corner region detection module is used to detect whether the target geographic object intersects with the candidate convex polygon set based on the separating axis theorem; The result output module is used to output the boundary detection results of whether the target geographic object intersects or does not intersect with the irregular geographic polygon.
