A method and system for searching locations on a topographic map based on a KD tree using a curve
By constructing a curve-based kd-tree on a topographic map and generating a straight-line topographic map using the LCC projection method and the Delaunay triangulation algorithm, the high complexity of point location query on the topographic map is solved, and a fast and easy-to-implement point location search is achieved.
Patent Information
- Application Number
- CN202110998624.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-27
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2041-08-27
AI Technical Summary
Existing point location methods have high time complexity and are difficult to implement when querying on topographic maps, making it difficult to meet the needs of fast querying.
Two-dimensional maps are generated using the LCC projection method. Feature edges are categorized by type. A planar triangular mesh is generated using the Delaunay triangulation algorithm. A straight-line topographic map is generated through extreme value quasi-conformal mapping. A curve-based kd-tree is constructed on the straight-line topographic map for point location lookup.
It achieves point position search with O(lgn) query time and O(n) storage complexity, which is fast, versatile, easy to implement, maintains the topology and satisfies the straightening constraint.
Smart Images

Figure CN114547483B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a curve-based kd tree to accelerate a point location search method based on a straight line map, and in particular to a curve-based KD tree location search method and system on a topographic map. Background Art
[0002] The point location problem is a fundamental problem in computational geometry and is widely used in computer graphics and geographic information systems. In the case of geographical subdivision of topographic maps, the point location problem is to determine the area where a query point is located, which happens frequently and requires real-time results. Therefore, it is worthwhile to preprocess the topographic maps and store them in a data structure that allows point location queries to be answered quickly. Many solutions have been proposed for the point location problem. Among all the proposed point location methods, the optimal query time of O(lgn) and storage complexity of O(n) are relatively complex and not easy to implement. Summary of the invention
[0003] The object of the present invention is to provide a method and system for searching a position on a topographic map based on a curve KD tree, so as to overcome the deficiencies of the prior art.
[0004] In order to achieve the above object, the present invention adopts the following technical scheme:
[0005] A method for searching a location on a topographic map based on a curve-based KD tree comprises the following steps:
[0006] S1, using LCC projection method to generate two-dimensional map from geographic map data;
[0007] S2, classifying each characteristic edge contained in the generated two-dimensional map;
[0008] S3, using the Delaunay triangulation algorithm to generate a single-boundary planar triangular mesh for the two-dimensional map;
[0009] S4, deriving curve constraints from the boundary styles obtained by the classification process, and then using the extremum quasi-conformal mapping method to generate straight line mapping to construct a straight line topographic map for the two-dimensional map;
[0010] S5, constructing a curve-based kd tree on the straight topographic map, and using the constructed kd tree to search the area where any point is located.
[0011] Furthermore, the geographic map data includes segmentation curves at different levels and latitude and longitude coordinate information of geographic boundaries.
[0012] Further, S2.1, extracting all curve segments between nodes connecting more than two regions on each characteristic edge contained in the generated two-dimensional map;
[0013] S2.2, for each subdivision curve, trace each edge and calculate its angle θ with the x-axis x ∈(-π,π), if the edge is tilted toward the y-axis, that is Then set the edge to "vertical" style, otherwise, set it to "horizontal" style.
[0014] Furthermore, for a T-node with three connected edges having the same mapping style, find two edges with the largest angle difference, set them to have the same mapping style, and then mark the third edge with another mapping style. By comparing with the angle of the x-axis, calculate the mapping styles of the two groups, set the group with the smallest angle to the horizontal style, and the other group to the vertical style.
[0015] Furthermore, for continuous edges with the same mapping style, if a sharp turn occurs at a common vertex, the curve is split at that vertex, and the mapping style of the latter segment is required to be different from that of the former segment, and the split vertex will become a right angle on the straight line map.
[0016] Furthermore, for the angle with the quadrant angle bisector less than θ s <15° and the curve length is greater than the tolerance ε s A curve is subdivided evenly when the number of subdivisions is equal to the curve length divided by the tolerance, and the mapping style of the subcurves is set alternately.
[0017] Furthermore, the map is embedded in a rectangle, and the four sides of the rectangle are designated as fixed boundaries. Under the constraints of the subdivision curves that conform to the Delaunay triangulation and the vertices extracted to determine the straight line style, a single-boundary planar triangular mesh is obtained through Delaunay triangulation, denoted as M = (V, E, F), where V, E, F represent the vertex set, edge set and face set respectively, and the subdivision curve set is denoted as l = l H ∪l V , where l H is the set of characteristic curve segments to be mapped to horizontal straight line segments, l V is the set of characteristic curve segments to be mapped to vertical straight line segments.
[0018] Furthermore, let D have a local coordinate system (u, v);
[0019] 4.1, calculate the harmonic functions f1, f2 using the internal curve straightening constraint;
[0020] 4.2, obtain the harmonic 1-form through gradient calculation
[0021] 4.3, calculate the scalar coupling factor λ to minimize the equation;
[0022]
[0023] Among them A ijk For the surface i ,v j ,v k ] is the area of the face, × is the cross product, and n is the face normal vector
[0024] 4.4 Calculation
[0025] 4.5. Integrating ω in the field M generates a quasi-conformal mapping function
[0026]
[0027] Where γ(q,p) is any path from the base point q to the point p. In the plane domain, where f(q) = (0,0), all f(γ i ) and f(l k ) are all straight line segments.
[0028] Furthermore, step S5 specifically includes: 5.1, constructing a curve-based kd tree on the straight line topographic map;
[0029] 5.2, use the properties of the tree to search for the nearest edge of a given point, find the nearest edge of the current search point, and get the located area by judging whether the point is on the left or right of the nearest edge.
[0030] A location search system on a topographic map, comprising a classification module, a straight topographic map module and a search module.
[0031] The classification module is used to generate a two-dimensional map from geographic map data, and classify each characteristic edge contained in the generated two-dimensional map;
[0032] The linear topographic map module is used to generate a single-boundary planar triangular mesh for a two-dimensional map using the Delaunay triangulation algorithm, derive curve constraints from the boundary style obtained by classification processing, and then use the extreme value quasi-conformal mapping method to generate a linear mapping to construct a linear topographic map for the two-dimensional map;
[0033] The search module is used to construct a curve-based kd tree on the straight line topographic map based on the straight line topographic map constructed by the straight line topographic map module, use the tree attributes to search for the nearest edge of a given point, find the nearest edge of the current search point, and obtain the located area by judging whether the point is located on the left or right of the nearest edge.
[0034] Compared with the prior art, the present invention has the following beneficial technical effects:
[0035] The present invention discloses a method for searching a position on a topographic map based on a curve KD tree. A two-dimensional map is generated from geographic map data by an LCC projection method. Each characteristic edge contained in the generated two-dimensional map is subjected to type classification processing. A single-boundary plane triangle mesh is generated for the two-dimensional map by using a Delaunay triangulation algorithm. A curve-based kd tree is constructed on the straight line topographic map based on a point query method for a straight line topographic map to accelerate the search for the nearest edge. The point position query is simplified to the nearest edge of the search query point. The located area can be obtained by searching the kd tree. The method is easy to implement and is a method for quasi-conformal straight line mapping of shapes that is closest to the original map. The structural straight line topographic map takes into account constraints of different types and levels, has flexibility in level, and can be used as a reference map for geographic applications. On the basis of the quasi-conformal straight line topographic map, the kd tree based on the data structure curve accelerates the point location search on the topographic map.
[0036] Furthermore, the straight line mapping generated by the extremum quasi-conformal method satisfies the straightening constraint, maintains the topological structure, and minimizes the angular deformation.
[0037] A location search system on a topographic map stores edges in tree nodes and balances a curve-based kd tree. It is expected to search for point locations with O(lgn) query time and O(n) storage complexity. The system has fast search speed, strong versatility and is easy to implement. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1a is the original straight line map of the United States in the embodiment of the present invention, Figure 1b It is a straight line mapping diagram of the original straight line map of the United States in an embodiment of the present invention.
[0039] FIG. 2 is an automatic design structure mapping pattern according to an embodiment of the present invention. Figure 2a Figure 2b is the vertex of the sharp turn; Figure 2b is the vertex of the T-junction.
[0040] Figure 3 This is an example of the subdivision of the inclined edges of a partial topographic map of the United States in an embodiment of the present invention.
[0041] Figure 4 It is a straight line topographic map with landmarks of different levels in an embodiment of the present invention.
[0042] Figure 5 It is an overall flow chart of an embodiment of the present invention. DETAILED DESCRIPTION
[0043] The present invention is further described in detail below in conjunction with the accompanying drawings:
[0044] like Figure 5As shown, a position search method based on a curve KD tree comprises the following steps:
[0045] S1, using LCC projection method to generate two-dimensional map from geographic map data;
[0046] Geographic map data includes different levels of segmentation curves and longitude and latitude coordinate information of geographic boundaries;
[0047] like Figure 1a , Figure 1b As shown in the figure, the straight line maps generated by the quasi-conformal mapping method are respectively used for part of the map of China and part of the topographic map of the United States, where θ is set s =15°, ε s = 0.013, we get RL(1); set θ s =40°, ε s =0.013, and we get RL.
[0048] S2, classifying each characteristic edge contained in the generated two-dimensional map;
[0049] Specifically, S2.1, extract all curve segments between nodes connecting two or more regions on each characteristic edge contained in the generated two-dimensional map;
[0050] S2.2, for each subdivision curve, trace each edge and calculate its angle θ with the x-axis x ∈(-π,π), if the edge is tilted toward the y-axis, that is Then set the edge to "vertical" style, otherwise, set it to "horizontal" style.
[0051] Sharp turn apex:
[0052] For consecutive edges with the same mapping style, if a sharp turn occurs at the common vertex, that is, the consecutive angle difference is greater than the threshold, |θ x (e current )-θ x (e prev )|>ε, usually The curve is split at this vertex, and the mapping style of the latter segment is required to be different from that of the former segment. The split vertex will become a right angle on the straight line map.
[0053] T-node vertex:
[0054] For T-nodes with three connected edges with the same mapping style, find the two "most" collinear edges (the two edges with the largest angle difference), set them to have the same mapping style, then mark the third edge with another mapping style, calculate the mapping styles of the two groups by comparing with the angle of the x-axis, set the group with the smallest angle to the horizontal style, and the other group to the vertical style.
[0055] As shown in Figure 2, the structure mapping style is automatically designed. Figure 2a It is the apex of the sharp turn; Figure 2b Designed for the apex of a T-junction.
[0056] Slash subdivision:
[0057] like Figure 3 As shown, for the inclined curve, that is, the angle with the quadrant angle bisector is less than θ s <15° and the curve length is greater than the tolerance ε s , when the number of subdivisions is equal to the curve length divided by the tolerance, it is subdivided evenly and the mapping style of the subcurves is set alternately.
[0058] S3, using the Delaunay triangulation algorithm to generate a single-boundary planar triangular mesh for the two-dimensional map;
[0059] Specifically: First, the map is embedded in a rectangle, and the four sides of the rectangle are designated as fixed boundaries. Under the constraints of the subdivision curves that conform to the Delaunay triangulation and the vertices extracted to determine the straight line style, a single-boundary planar triangular mesh is obtained through Delaunay triangulation, denoted as M = (V, E, F), where V, E, and F represent the vertex set, edge set, and face set, respectively, and the subdivision curve set is represented as l = l H ∪l V , where l H is the set of characteristic curve segments to be mapped to horizontal straight line segments, l V is the set of characteristic curve segments to be mapped to vertical straight line segments; let the outer rectangular boundary be divided into four segments by four right angles, γ 0 ,γ 1 ,γ 2 , γ 3 Let γ 0 ,γ 2 ∈l H , γ 1 , γ 3 ∈l V ,Finally, the input is represented as (M, l).
[0060] S4, deriving curve constraints from the boundary styles obtained by the classification process, and then using the extremum quasi-conformal mapping method to generate straight line mapping to construct a straight line topographic map for the two-dimensional map;
[0061] Specifically, using the curve l(l==l H ∪l V ) The decorated triangle mesh M = (V, E, F) ensures a planar rectangular domain D,st with triangle meshes. H (l V ) are mapped into horizontal (vertical) straight line segments.
[0062] Specifically: Assume D has a local coordinate system (u, v);
[0063] 4.1, calculate the harmonic functions f1, f2 using the internal curve straightening constraint;
[0064]
[0065] Where n is the normal vector of the boundary, s i , t j is an unknown variable and is automatically calculated by the algorithm.
[0066] For the characteristic curve l k =[v 1 ,v 2 , …, v nk ], there are two types of alignment constraints: (1) horizontal direction: the v coordinates are the same; (2) vertical direction: the u coordinates are the same.
[0067] The discrete Laplace operator Δ is defined as:
[0068]
[0069] w ij is the weight of the cotangent edge
[0070]
[0071] They are triangles [v i ,v j ,v k ],[v j ,v i ,v l ] in and around [v i ,v j ] opposite angles;
[0072] 4.2, the harmonic 1-form is obtained by gradient calculation
[0073] 4.3, calculate the scalar coupling factor λ to minimize the equation:
[0074]
[0075] Among them Aijk For the surface i ,v j ,v k ] is the area of the face, × is the cross product, and n is the face normal vector
[0076] 4.4 Calculation
[0077] 4.5. Integrating ω in the field M generates a quasi-conformal mapping function
[0078]
[0079] Where γ(q,p) is any path from the base point q to the point p. In the plane domain, where f(q) = (0,0), all f(γ i ) and f(l k ) are all straight line segments. We can trace a straight line f(γ i )Get this rectangular map and set f 0 =f;
[0080] 4.6, Optimizing Quasi-Conformal Mapping;
[0081] Calculate the initial Beltrami coefficient μ 0 =μ(f 0 )
[0082]
[0083] Repeat the following three steps:
[0084] Optimization: μ n+1 ←μ n +δΔμ n
[0085] Calculation and μ n and f μn The relevant intermediate quasiconformal mapping:
[0086]
[0087] . Compute quasi-conformal mapping
[0088]
[0089] renew until:
[0090] ||μ n+1 -μ n ||∞<∈
[0091]
[0092] like Figure 4 Shown is a rectilinear topographic map with landmarks of different levels.
[0093] S5, constructing a curve-based kd tree on the straight topographic map, and using the constructed kd tree to search the area where any point is located.
[0094] 5.1, a curve-based KD tree is constructed on a rectilinear topographic map. The edges of the rectilinear topographic map are clustered by grouping horizontal / vertical edges with the same y / x coordinates; the curve-based KD tree uses the lines in the rectilinear edge group that have the same y / x coordinates as the horizontal / vertical splitting lines; for each internal node, the median of the edge group relative to the splitting axis is selected, and the axis used to select the splitting line is circled.
[0095] The curve-based KD tree is a space partitioning data structure based on a straight line topography of horizontal / vertical edges in two-dimensional space; each non-leaf node can be considered as implicitly generating a split line on the selected set of straight edges, which divides the space into two half-spaces; the set of edges on the left side of the split line is represented by the left subtree of the node, and the set of edges on the right side of the split line is represented by the right subtree; straight edges can be split by the split line; each node in the tree is associated with one of the two dimensions and is perpendicular to the axis of that dimension.
[0096] 5.2, Searching the area where any point is located using the constructed kd tree: Point location query can be simplified to searching for the nearest edge of a given point. Using the properties of the tree to quickly eliminate most of the search space can accelerate this process; once the nearest edge of the current search point is found, the located area is obtained by judging whether the point is located to the left or right of the nearest edge. Since the subdivision curves of the original topographic map are not horizontal / vertical, we construct a curve-based kd tree and perform the nearest edge search on the straight topographic map. In the process of searching for the nearest edge, we only refer to the original topographic map when calculating the distance between the current search point and the candidate nearest edge.
[0097] set up To express the maximum deviation between the original topography and the straight-line topography:
[0098]
[0099] In the nearest edge search, due to The search area is always enlarged.
[0100] The present invention discloses a position search method based on a curve KD tree, a method for finding an extreme quasi-conformal straight line mapping that is closest to the shape of the original map, and a structural straight line topographic map that takes into account constraints of different types and levels, has flexibility in terms of level, and can be used as a reference map for geographic applications. On the basis of the quasi-conformal straight line topographic map, a kd tree algorithm based on a data structure curve is proposed to accelerate the point location search on the topographic map. The present invention takes into account constraints of different types and levels and has practicality: the straight line mapping generated by the extreme quasi-conformal method satisfies the straightening constraint condition, maintains the topological structure, and minimizes the angular deformation. The edges are stored in the nodes of the tree, and the curve-based kd tree is balanced. Point position search is performed with O(lgn) query time and O(n) storage complexity. The algorithm has the advantages of high speed, strong versatility, and easy implementation.
Claims
1. A method for searching a location on a topographic map based on a curve-based KD tree, characterized in that: The following steps are involved: S1, using LCC projection method to generate two-dimensional map from geographic map data; S2, classifying each characteristic edge contained in the generated two-dimensional map; S2.1, extracting all curve segments between nodes connecting two or more regions on each characteristic edge contained in the generated two-dimensional map; S2.2, for each subdivision curve, trace each edge and calculate its angle θ with the x-axis x ∈(-π,π), if the edge is tilted toward the y-axis, that is Then set the edge to "vertical" style, otherwise, set it to "horizontal" style; S3, using the Delaunay triangulation algorithm to generate a single-boundary planar triangular mesh for the two-dimensional map; The map is embedded in a rectangle, and the four sides of the rectangle are designated as fixed boundaries. Under the constraints of the subdivision curves that conform to the Delaunay triangulation and the vertices extracted to determine the straight line style, a single-boundary planar triangular mesh is obtained through Delaunay triangulation, denoted as M = (V, E, F), where V, E, F represent the vertex set, edge set and face set respectively, and the subdivision curve set is denoted as l = l H ∪l V , where l H is the set of characteristic curve segments to be mapped to horizontal straight line segments, l V is the set of characteristic curve segments to be mapped to vertical straight line segments; S4, deriving curve constraints from the boundary styles obtained by the classification process, and then using the extremum quasi-conformal mapping method to generate straight line mapping to construct a straight line topographic map for the two-dimensional map; Assume D has a local coordinate system (u,v); 4.1, calculate the harmonic functions f1, f2 using the internal curve straightening constraint; 4.2, obtain the harmonic 1-form through gradient calculation 4.3, calculate the scalar coupling factor λ to minimize the equation; Among them A ijk For the surface i ,v j ,v k ] is the area of the face, × is the cross product, and n is the face normal vector 4.4 Calculation 4.
5. Integrating ω in the field M generates a quasi-conformal mapping function in, γ(q,p) is any path from the base point q to the point p; in the plane domain, where f(q) = (0,0), all f(γ i ) and f(l k ) are all straight line segments; S5, constructing a curve-based kd tree on the straight topographic map, and using the constructed kd tree to search the area where any point is located.
2. The method for searching a position on a topographic map based on a curve KD tree according to claim 1, characterized in that: Geographic map data includes different levels of segmentation curves and latitude and longitude coordinate information of geographic boundaries.
3. The method for searching a position on a topographic map based on a curve KD tree according to claim 1, characterized in that: For a T-node with three connected edges with the same mapping style, find the two edges with the largest angle difference, set them to have the same mapping style, then mark the third edge with another mapping style, calculate the mapping styles of the two groups by comparing with the x-axis angle, set the group with the smallest angle to the horizontal style, and the other group to the vertical style.
4. The method for searching a position on a topographic map based on a curve KD tree according to claim 1, characterized in that: For continuous edges with the same mapping style, if a sharp turn occurs at a common vertex, the curve is split at that vertex, and the mapping style of the latter segment is required to be different from that of the former segment. The split vertex will become a right angle on the straight line map.
5. The method for searching for a position on a topographic map based on a curve KD tree according to claim 1, characterized in that: For angles less than θ s <15° and the curve length is greater than the tolerance ε s A curve is subdivided evenly when the number of subdivisions is equal to the curve length divided by the tolerance, and the mapping style of the subcurves is set alternately.
6. The method for searching for a position on a topographic map based on a curve KD tree according to claim 1, characterized in that: Step S5 specifically includes: 5.1, constructing a curve-based kd tree on the straight line topographic map; 5.2, use the properties of the tree to search for the nearest edge of a given point, find the nearest edge of the current search point, and get the located area by judging whether the point is on the left or right of the nearest edge.
7. A location search system on a topographic map based on the method of claim 6, characterized in that: Including classification module, linear topographic map module and search module, The classification module is used to generate a two-dimensional map from geographic map data, and classify each characteristic edge contained in the generated two-dimensional map; The linear topographic map module is used to generate a single-boundary planar triangular mesh for a two-dimensional map using the Delaunay triangulation algorithm, derive curve constraints from the boundary style obtained by classification processing, and then use the extreme value quasi-conformal mapping method to generate a linear mapping to construct a linear topographic map for the two-dimensional map; The search module is used to construct a curve-based kd tree on the straight line topographic map based on the straight line topographic map constructed by the straight line topographic map module, use the tree attributes to search for the nearest edge of a given point, find the nearest edge of the current search point, and obtain the located area by judging whether the point is located on the left or right of the nearest edge.
Citation Information
Patent Citations
Three-dimensional terrain model real-time smooth drawing method with combination of GPU technology
CN105336003A
Automatic unmanned vehicle parking method based on ICP algorithm
CN106541945A
Method for constructing indoor real three-dimensional map based on laser radar
CN108171780A
Division algorithm for performing map gridding by using triangles
CN112991529A
Generation of triangle mesh for a three dimensional image
US20190057545A1
