Map annotation construction method, device, computer equipment and storage medium

By entering vector polygon elements under the global geographical coordinate system and building foreign keys, combining clustering technology and query optimization, the problem of difficulty in maintaining reasonable annotation density in the existing technology is solved, and the automatic construction of reasonable density under different scale views is achieved. map notes take into account the business attributes of complex vector elements.

CN114357097BActive Publication Date: 2025-02-25ZHEJIANG INST OF SURVEYING & MAPPING SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111612306.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-27
Publication Date
2025-02-25
Estimated Expiration
2041-12-27

AI Technical Summary

Technical Problem

It is difficult for the prior art to automatically construct map annotations of reasonable density under different scale views, especially under dense vector surface elements, the annotation density is difficult to maintain at a reasonable level, and the business attributes of complex vector elements cannot be effectively taken into account.

Method used

By entering vector polygon features into the spatial database under the global geographical coordinate system, building foreign keys for vector polygon data sets and performing query optimization, using clustering technology to process the annotation point data set, setting a retention threshold according to the view range , generate annotation vector tiles to ensure that the annotation density remains reasonable in different scale views.

Benefits of technology

It realizes the automatic construction of map annotations with appropriate density, additional business attributes, and taking into account complex vector elements in different scale views, ensuring that the annotation density is always maintained to a reasonable level, and improving the visualization effect of map annotations and client response speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114357097B_ABST
    Figure CN114357097B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a method, device, computer equipment and storage medium for constructing map annotations. The method includes: entering vector surface elements into a spatial database in a global geographic coordinate system to obtain a vector surface data set; entering business data related to the vector surface elements into a database in a specified two-dimensional relationship table structure to obtain a business data set, and specifying a foreign key of the vector surface data set; performing query optimization; calculating an annotation point data set, and clustering the annotation point data set according to a set clustering distance threshold; setting a retention threshold according to a view range, returning the annotation points with the largest cumulative area after the first n clusters, to obtain an annotation point data set to be visualized; constructing an annotation text data set; and constructing an annotation vector tile. By implementing the method of the embodiment of the present invention, the automatic construction of map annotations can be realized, taking into account complex vector elements under different scale views, and keeping the annotation density at a reasonable level.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a map annotation processing method, and more specifically to a map annotation construction method, device, computer equipment and storage medium. Background Art

[0002] Vector surface elements and other abstract forms express objective objects in the real world. It is an important data storage method in geographic information systems. It usually includes two parts: attribute data and graphic data. The graphic part can be a simple graphic composed of a single graphic or a complex graphic composed of multiple sub-graphics. Vector data is one of the digital forms of maps. Map annotations are notes and various text descriptions of maps, including text, location, angle, etc., which are one of the basic contents of maps. Map annotations are an important part of vector data visualization.

[0003] Map annotations are usually provided to clients in the form of vector tiles. Vector tiles contain all the data displayed by the client. Therefore, a reasonable map annotation density is not only conducive to making the front-end visualization more reasonable, but also helps to reduce the size of map annotation vector tiles and improve client response speed.

[0004] Since a large number of vector surface elements are usually stacked together to form dense vector surfaces in a small-scale view, even in a large-scale view, if a large number of adjacent scattered vector surface data are formed, dense vector surfaces will be formed. In addition, a single complex graphic usually repeatedly constructs annotation points based on sub-graphics, etc., and map annotations based on the graphic's own spatial coordinates will be stacked together, which not only affects the spatial visualization of the vector surface, but also increases the data volume of the annotation vector tile. In addition, map annotations usually construct text based on the attribute data of the vector data itself, and construct point data sets based on the centroid of the graphic. The text part of the map annotation usually requires the participation of business data other than the vector data in the construction, and the vector annotation text composition is constrained by its own existing attributes.

[0005] Therefore, it is necessary to design a new method to realize the automatic construction of map annotations that can take into account complex vector elements under different scale views and keep the annotation density at a reasonable level. Under dense vector surface elements, map annotations with appropriate density, additional business attributes and taking into account complex vector elements can be automatically constructed. Summary of the invention

[0006] The purpose of the present invention is to overcome the defects of the prior art and provide a map annotation construction method, device, computer equipment and storage medium.

[0007] To achieve the above object, the present invention adopts the following technical solution: a method for constructing map annotations, comprising:

[0008] Enter the vector surface elements into the spatial database in the global geographic coordinate system to obtain the vector surface dataset;

[0009] Entering the business data related to the vector surface element into the database with a specified two-dimensional relational table structure to obtain a business data set, and specifying the fields related to the business data and the primary key of the vector surface element as the foreign key of the vector surface data set;

[0010] Performing query optimization on the vector surface dataset and the business data;

[0011] Searching the vector surface dataset within the visual range of the screen to obtain a search result, calculating an annotation point dataset of the search result, and clustering the annotation point dataset according to a set clustering distance threshold;

[0012] Set the retention threshold according to the view range, and return the annotation points with the largest cumulative area after the first n clusters to obtain the annotation point dataset to be visualized, where n is the retention threshold;

[0013] According to the correspondence between the primary key of the vector surface dataset and the foreign key, the business data field corresponding to the vector surface element is obtained to obtain the basic elements of the annotation text of the vector surface element, and the annotation text dataset is constructed;

[0014] Annotation vector tiles are constructed based on the annotation point dataset to be visualized and the annotation text dataset.

[0015] A further technical solution is: the query optimization of the vector surface data set and the business data includes:

[0016] Under the GIST framework, construct an R-tree spatial index for the vector surface dataset;

[0017] Using a database clustering function, the vector surface dataset is reordered and stored according to the sorting order of the R-tree spatial index;

[0018] Create indexes for the relevant foreign keys of the business data.

[0019] A further technical solution is: using the database clustering function to re-sort the vector surface data set according to the sorting order of the R-tree spatial index and then storing it, including:

[0020] Using a database clustering function to sort the vector surface dataset according to the sorting order of the R-tree spatial index to obtain a sorting result;

[0021] The sorting results are physically stored according to spatial locations.

[0022] A further technical solution is: searching the vector surface dataset within the screen visualization range to obtain a search result, calculating the annotation point dataset of the search result, and clustering the annotation point dataset according to a set clustering distance threshold, including:

[0023] Searching the vector surface data set to obtain search results within a screen visualization range;

[0024] Calculating the annotation point data set of the retrieval result;

[0025] Set the cluster distance threshold, perform spatial clustering on the annotation point dataset according to the area of ​​the vector surface element, and gradually merge the annotation points in the annotation point dataset whose adjacent distance is less than the set cluster distance threshold into the adjacent annotation points with the largest area;

[0026] Accumulate the areas of clustered vector surface features to the corresponding cluster annotation points.

[0027] A further technical solution is: the calculation of the annotation point data set of the retrieval result includes:

[0028] Calculate the coordinates of the center point of the vector surface element to obtain the annotation point. When a single vector surface element is composed of several sub-surface elements, calculate the center point of the sub-surface element with the largest area to obtain the annotation point of the complex vector surface element.

[0029] Integrate all annotation points to obtain an annotation point dataset.

[0030] A further technical solution is: constructing the annotation vector tile based on the annotation point data set to be visualized and the annotation text data set includes:

[0031] Based on the annotation point dataset to be visualized and the annotation text dataset, the actual floating point geographic coordinates are mapped into integer vector tile grid coordinates through geometric coding, and redundant attributes are merged through attribute coding to obtain annotation vector tiles.

[0032] The present invention also provides a map annotation construction device, comprising:

[0033] A vector surface dataset generation unit is used to enter the vector surface elements into the spatial database in the global geographic coordinate system to obtain a vector surface dataset;

[0034] A business data set generation unit is used to enter business data related to vector surface elements into a database in a specified two-dimensional relational table structure to obtain a business data set, and to specify fields related to the business data and the primary key of the vector surface element as foreign keys of the vector surface data set;

[0035] A query optimization unit, used for performing query optimization on the vector surface dataset and the business data;

[0036] A clustering unit, used to search the vector surface dataset within the visual range of the screen to obtain a search result, calculate an annotation point dataset of the search result, and cluster the annotation point dataset according to a set clustering distance threshold;

[0037] Annotation point generation unit, used to set a retention threshold according to the view range, and return the annotation points with the largest cumulative area after the first n clusters, so as to obtain the annotation point data set to be visualized, where n is the retention threshold;

[0038] A text data set generation unit is used to obtain the business data field corresponding to the vector surface element according to the correspondence between the primary key of the vector surface data set and the foreign key, so as to obtain the basic elements of the annotation text of the vector surface element and construct the annotation text data set;

[0039] The tile construction unit is used to construct the annotation vector tile based on the annotation point data set to be visualized and the annotation text data set.

[0040] Its further technical solution is: the query optimization unit includes:

[0041] A spatial index construction subunit, used for constructing an R-tree spatial index for the vector surface dataset under the GIST framework;

[0042] A processing subunit, used for re-sorting the vector surface dataset according to the sorting order of the R-tree spatial index using a database clustering function and then storing the re-sorted vector surface dataset;

[0043] The foreign key index building subunit is used to build indexes for the relevant foreign keys of the business data.

[0044] The present invention further provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor implements the above method when executing the computer program.

[0045] The present invention also provides a storage medium, wherein the storage medium stores a computer program, and the computer program implements the above method when executed by a processor.

[0046] Compared with the prior art, the present invention has the following beneficial effects: the present invention obtains a vector surface dataset and a business dataset, constructs a foreign key of the vector surface dataset, performs query optimization, retrieves the vector surface dataset within the screen visualization range, clusters the annotation point dataset in a clustering manner, determines the annotation point dataset to be visualized according to a retention threshold set in the view range, generates annotation vector tiles in combination with the constructed annotation text dataset, realizes automatic construction of map annotations, can take into account complex vector elements under different scale views, and keeps the annotation density at a reasonable level at all times, and can automatically construct map annotations with appropriate density, additional business attributes, and taking into account complex vector elements under dense vector surface elements.

[0047] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.

[0049] Figure 1 A schematic diagram of a process flow of a map annotation construction method provided by an embodiment of the present invention;

[0050] Figure 2 A schematic diagram of a sub-process of a map annotation construction method provided in an embodiment of the present invention;

[0051] Figure 3 A schematic diagram of a sub-process of a map annotation construction method provided in an embodiment of the present invention;

[0052] Figure 4 A schematic diagram of a sub-process of a map annotation construction method provided in an embodiment of the present invention;

[0053] Figure 5 A schematic diagram of a sub-process of a map annotation construction method provided in an embodiment of the present invention;

[0054] Figure 6 A schematic block diagram of a map annotation construction device provided by an embodiment of the present invention;

[0055] Figure 7 A schematic block diagram of a query optimization unit of a map annotation construction device provided in an embodiment of the present invention;

[0056] Figure 8 A schematic block diagram of a processing subunit of a map annotation construction device provided in an embodiment of the present invention;

[0057] Fig. 9 A schematic block diagram of a clustering unit of a map annotation construction device provided in an embodiment of the present invention;

[0058] Fig.10 A schematic block diagram of a computing subunit of a map annotation construction device provided in an embodiment of the present invention;

[0059] Fig.11 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0060] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0061] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0062] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0063] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0064] See also Figure 1 , Figure 1 A schematic flow chart of a method for constructing map annotations provided by an embodiment of the present invention. The method for constructing map annotations is applied in a server.

[0065] Figure 1 FIG. 1 is a flow chart of a method for constructing map annotations provided by an embodiment of the present invention. Figure 2 As shown, the method includes the following steps S110 to S170.

[0066] S110. Entering the vector surface elements into a spatial database in a global geographic coordinate system to obtain a vector surface dataset.

[0067] In this embodiment, the vector surface data set refers to a data set formed by storing vector surface elements in a spatial database in a unified format.

[0068] Collect vector surface elements with clear spatial coordinate systems. To adapt to large-scale spatial data scenarios, convert the original data to the geographic coordinate system specified by the database, unify the data structure and data requirements, and enter them into the spatial database. For example: collect vector surface elements of different projects in the 40th and 41st projection belts of the 2000 National Geodetic Coordinate System throughout the province, first convert the data to the geographic coordinate system of the 2000 National Geodetic Coordinate System, then specify the spatial data template, unify the data structures from different sources, and enter them into the database with unified standards to form a vector surface data set.

[0069] S120. Enter the business data related to the vector surface element into the database in a specified two-dimensional relational table structure to obtain a business data set, and specify the fields related to the business data and the primary key of the vector surface element as foreign keys of the vector surface data set.

[0070] In this embodiment, the business data set refers to the related pure two-dimensional attribute data, and the two-dimensional relational table structure is a table formed in the format of spatial data + two-dimensional attribute data of general vector surface elements. A foreign key refers to a field specified from the business data.

[0071] Specifically, specify the business data template, enter the business data of the attribute class into the database to form a business data set. Vector surface features usually only include basic information related to graphics, and related business data are usually stored in independent data tables. By saving the primary key value column of the vector data set, the link between the vector data set and the business data is realized. This type of column is the business data foreign key.

[0072] S130: Optimize query on the vector surface dataset and the business data.

[0073] In one embodiment, see Figure 2 , the above-mentioned step S130 may include steps S131 to S133.

[0074] S131. Under the GIST (Generalized Search Trees) framework, construct an R-tree spatial index for the vector surface dataset.

[0075] In this embodiment, the R-tree index is a commonly used spatial data index based on rectangular access.

[0076] Dense vector surface data is usually distributed over a large area, and the amount of spatial query and analysis data is huge. In order to realize the dynamic production of map annotation vector tiles, it is necessary to improve the spatial query efficiency of vector surface datasets. Spatial index is a key technology to improve the efficiency of spatial analysis and spatial query operations. By establishing a suitable spatial index for the vector surface dataset, a large number of spatial objects irrelevant to the operation are excluded when retrieving the vector dataset, thereby improving the speed and efficiency of spatial operations.

[0077] Considering that the spatial range of vector tiles is a regular rectangle, and R-tree index is a commonly used spatial data index based on rectangle access, its core idea is to aggregate nodes with similar distances, and the upper layer of the tree structure is the minimum bounding rectangle of the child node. In the database, the minimum bounding rectangle of the vector surface feature is calculated, and on this basis, the R-tree index of the vector surface dataset based on the GIST framework is created as the spatial index of the vector surface dataset.

[0078] S132: Use a database clustering function to re-sort the vector surface dataset according to the sorting order of the R-tree spatial index and then store it.

[0079] Based on the R-tree spatial index, the database clustering function is used to reorder and store the vector surface data set according to the R-tree spatial index sorting, so that the vector surface data set is physically stored according to the spatial position, and the spatially adjacent vector surface elements are kept in one storage page as much as possible.

[0080] In one embodiment, see Figure 3 , the above-mentioned step S132 may include steps S1321 to S1322.

[0081] S1321. Use a database clustering function to sort the vector surface dataset according to the sorting order of the R-tree spatial index to obtain a sorting result.

[0082] In this embodiment, the sorting result refers to the result obtained by physically sorting the vector surface dataset based on the R-tree spatial index.

[0083] S1322. Physically store the sorting results according to spatial locations.

[0084] Specifically, vector face data is physically stored according to the spatial index order.

[0085] In the database, after the vector feature faces within the range of the map annotation vector tile are retrieved according to the spatial index, in order to improve the return speed of the retrieval results, the physical storage order of the vector dataset is usually consistent with the sorting of the spatial index. After specifying the R-tree spatial index, the vector dataset is clustered and the physical storage order of the vector dataset is sorted according to the R-tree spatial index.

[0086] S133: Create indexes for related foreign keys of the business data.

[0087] Specifically, a common index is established for the relevant foreign keys of business data to speed up the associated query of business data; the foreign keys of business data are used for information associated query of vector surface elements, and the foreign key fields are sorted according to specified rules, and leaf nodes, branch nodes, and root nodes are constructed level by level, finally forming a B-tree index to improve the associated query speed.

[0088] S140, searching the vector surface dataset within the visual range of the screen to obtain a search result, calculating an annotation point dataset of the search result, and clustering the annotation point dataset according to a set clustering distance threshold.

[0089] In this embodiment, the retrieval result refers to a spatial intersection query, first obtaining the vector surface elements where the bounding rectangle intersects the query range based on the R-tree spatial index, and then further obtaining the vector surface elements intersecting the query range based on the database spatial intersection analysis.

[0090] In one embodiment, see Figure 4 , the above-mentioned step S140 may include steps S141 to S144.

[0091] S141, searching the vector surface dataset to obtain search results within a screen visualization range.

[0092] Specifically, the search results within the screen visualization range refer to the above-mentioned search results.

[0093] The actual geographic space range corresponding to the view is calculated according to the client's view range as the query range. The client transmits the query range to the backend in the format of WKT (Well-known text). Through spatial intersection query, the vector surface elements intersecting the outer rectangle and the query range are first obtained according to the R-tree spatial index, and then the vector surface elements intersecting the query range are further obtained as the retrieval results according to the database spatial intersection analysis.

[0094] S142: Calculate the annotation point data set of the search result.

[0095] In this embodiment, the annotation point data set refers to a set consisting of centroids of vector surface elements.

[0096] In one embodiment, see Figure 5 , the above-mentioned step S142 may include steps S1421 to S1422.

[0097] S1421. Calculate the coordinates of the center point of the vector surface element to obtain the annotation point. When a single vector surface element is composed of a plurality of sub-surface elements, calculate the center point of the sub-surface element with the largest area to obtain the annotation point of the complex vector surface element.

[0098] S1422. Integrate all annotation points to obtain an annotation point data set.

[0099] Specifically, map annotations usually take the centroid of the vector surface element as the annotation point, while the centroid of the concave vector surface element is usually outside the vector surface element. To ensure that the annotation point is on the vector surface element and roughly in the middle, the center point of the graphic is taken by the following method: draw a straight line in the east-west direction at the average position of the south and north of the vector surface element, take the longest intersecting line segment between the straight line and the vector surface element, and finally take the midpoint of the line segment as the center point of the graphic, that is, the annotation point. Complex vector surface elements usually consist of multiple simple vector surface elements. To ensure that the map annotation is displayed appropriately, the center of the sub-vector surface element with the largest area of ​​the complex vector surface element is taken as the annotation point. For example, a responsibility field surface element usually consists of multiple non-adjacent farmlands, and the center point of the largest farmland plot is selected as the map annotation point.

[0100] The annotation points are vector data centers, and it is guaranteed that in special cases such as concave polygons, the annotation points fall on the vector surface elements. Considering the complex vector surface elements containing multiple sub-surfaces, only the annotation points with the largest sub-surface area are displayed, further reducing the density of the annotation point dataset. The annotation points are dynamically calculated in the background, and there is no need to store or cache to meet the client response requirements.

[0101] S143, setting a cluster distance threshold, spatially clustering the annotation point dataset according to the area of ​​the vector surface element, and gradually merging the annotation points in the annotation point dataset whose adjacent distances are less than the set cluster distance threshold into the adjacent annotation points with the largest area.

[0102] Specifically, when initially obtaining a map annotation point dataset, each map annotation corresponds to a vector surface element. Since vector surface elements are dense, the annotation point dataset is usually dense. The preliminary annotation point dataset is clustered by setting the cluster distance d. Within the annotation vector tile range, select annotation points with a distance less than d and merge them to the point with the largest area of ​​the surrounding vector surface elements.

[0103] Taking the clustering distance of annotation point dataset as the constraint condition and the area value of vector polygon feature as the annotation point clustering priority, the annotation point dataset is automatically clustered to ensure that the annotation density is always maintained at a reasonable level in different views.

[0104] S144. Accumulate the areas of the clustered vector surface elements to the corresponding cluster annotation points.

[0105] Specifically, due to the uneven distribution of the land area, the difference in the original area represented by the merged cluster annotation points is also very obvious. It is very likely that a large number of merged areas are scattered vector surface elements, and the original area represented by the merged cluster annotation points is also relatively small. In order to prevent such annotation points from being filtered out in step S150, resulting in uneven annotation distribution, the area of ​​the clustered vector surface elements is accumulated to the corresponding cluster annotation points. For example, if there are three adjacent scattered farmlands A1, A2, and A3, with areas of 200 square meters, 500 square meters, and 400 square meters respectively, and the distance between their center points is less than d, the annotation points of A1 and A3 are merged with the annotation point of A2, and the area represented by the annotation point of A2 is 1100 square meters.

[0106] S150, setting a retention threshold according to the view range, returning the annotation points with the largest cumulative area after the first n clusters, to obtain the annotation point data set to be visualized, where n is the retention threshold.

[0107] In this embodiment, the annotation point data set to be visualized refers to a set of annotation points with the largest cumulative area after the first n clusters.

[0108] Specifically, the client's view range is a fixed value. To ensure the visualization of vector surface features on the client, the number of map annotations at different scales should be kept within a fixed value to avoid overlapping map annotations. For example, in vector surface visualization, 50 is selected as the maximum number of client displays, and the annotation points in the vector tile are clustered with a density threshold of 50. The density threshold refers to the retention threshold set according to the view range, which can be determined according to the actual situation.

[0109] S160. According to the correspondence between the primary key of the vector surface dataset and the foreign key, obtain the business data field corresponding to the vector surface element to obtain the basic elements of the annotation text of the vector surface element and construct the annotation text dataset.

[0110] In this embodiment, the annotation text dataset refers to a dataset constructed by basic elements of the annotation text of the vector surface feature.

[0111] Specifically, by associating business data with the primary key of the vector surface dataset, the basic elements of the annotation text that constitute the vector surface feature are obtained, and the annotation text dataset is constructed according to actual needs; the annotation text composition of the vector surface feature is not limited to its own existing attributes, and the attributes of the business data can be attached according to the primary key to flexibly construct the annotation text.

[0112] For the vector feature surface where annotation text is to be constructed, first obtain the vector attribute information, query the business data based on the vector attribute information, which is the primary key of the two-dimensional attribute data, and then obtain the corresponding business attribute information. Finally, construct the annotation text based on the vector attribute information and the business attribute information.

[0113] S170: constructing annotation vector tiles based on the annotation point dataset to be visualized and the annotation text dataset.

[0114] Specifically, based on the annotation point dataset to be visualized and the annotation text dataset, the actual floating point geographic coordinates are mapped to integer vector tile grid coordinates through geometric coding, and redundant attributes are merged through attribute coding to obtain annotation vector tiles. The actual size of the vector tiles is reduced, and the client response speed is further improved.

[0115] Specifically, the Web Mercator projection is used, and the origin of the row and column coordinates of the slice is in the upper left corner to construct the annotation vector tile. The annotation point dataset and the annotation text dataset are binary encoded, and the actual floating-point geographic coordinates are mapped to integer vector tile grid coordinates through geometric encoding, and redundant attributes are merged through attribute encoding to reduce the size of the annotation vector tile. For example, the vector tile annotation floating-point point coordinates (120.123456, 30.654321) are mapped to integer tile internal coordinates (26, 78), and the attribute fields "name" and "ID number" that appear repeatedly are only recorded once, and finally the map annotation vector tile is formed.

[0116] The above-mentioned map annotation construction method obtains a vector surface dataset and a business dataset, constructs a foreign key of the vector surface dataset, and performs query optimization, retrieves the vector surface dataset within the screen visualization range, clusters the annotation point dataset in a clustering manner, and determines the annotation point dataset to be visualized according to the retention threshold set in the view range, and generates annotation vector tiles in combination with the constructed annotation text dataset, so as to realize automatic construction of map annotations, which can take into account complex vector elements under different scale views and keep the annotation density at a reasonable level at all times. Under dense vector surface elements, map annotations with appropriate density, additional business attributes, and taking into account complex vector elements can be automatically constructed.

[0117] Figure 6 is a schematic block diagram of a map annotation construction device 300 provided in an embodiment of the present invention. Figure 6 As shown, corresponding to the above map annotation construction method, the present invention also provides a map annotation construction device 300. The map annotation construction device 300 includes a unit for executing the above map annotation construction method, and the device can be configured in a server. Figure 6The map annotation construction device 300 includes a vector surface data set generation unit 301, a business data set generation unit 302, a query optimization unit 303, a clustering unit 304, an annotation point generation unit 305, a text data set generation unit 306 and a tile construction unit 307.

[0118] The vector surface dataset generation unit 301 is used to enter the vector surface elements into the spatial database in the global geographic coordinate system to obtain the vector surface dataset; the business dataset generation unit 302 is used to enter the business data related to the vector surface elements into the database in a specified two-dimensional relational table structure to obtain the business dataset, and specify the fields related to the business data and the primary key of the vector surface elements as the foreign keys of the vector surface dataset; the query optimization unit 303 is used to perform query optimization on the vector surface dataset and the business data; the clustering unit 304 is used to retrieve the vector surface dataset within the visual range of the screen to obtain the retrieval results, calculate the annotation point dataset of the retrieval results, and The annotation point dataset is clustered according to a set clustering distance threshold; an annotation point generation unit 305 is used to set a retention threshold according to a view range, and return the annotation points with the largest cumulative area after the first n clusters to obtain the annotation point dataset to be visualized, wherein n is the retention threshold; a text dataset generation unit 306 is used to obtain the business data field corresponding to the vector surface element according to the correspondence between the primary key of the vector surface dataset and the foreign key, so as to obtain the basic elements of the vector surface element annotation text and construct the annotation text dataset; a tile construction unit 307 is used to construct annotation vector tiles based on the annotation point dataset to be visualized and the annotation text dataset.

[0119] In one embodiment, if Figure 7 As shown, the query optimization unit 303 includes a spatial index building subunit 3031 , a processing subunit 3032 , and a foreign key index building subunit 3033 .

[0120] The spatial index construction subunit 3031 is used to construct an R-tree spatial index for the vector surface dataset under the GIST framework; the processing subunit 3032 is used to use the database clustering function to re-sort the vector surface dataset according to the sorting order of the R-tree spatial index and then store it; the foreign key index construction subunit 3033 is used to establish an index for the relevant foreign keys of the business data.

[0121] In one embodiment, if Figure 8 As shown, the processing subunit 3032 includes a sorting module 30321 and a storage module 30322 .

[0122] The sorting module 30321 is used to sort the vector surface data set according to the sorting order of the R-tree spatial index using the database cluster function to obtain a sorting result; the storage module 30322 is used to physically store the sorting result according to the spatial position.

[0123] In one embodiment, if Fig. 9 As shown, the clustering unit 304 includes a retrieval subunit 3041 , a calculation subunit 3042 , a spatial clustering subunit 3043 and an accumulation subunit 3044 .

[0124] The retrieval subunit 3041 is used to search the vector surface dataset to obtain the retrieval results within the visual range of the screen; the calculation subunit 3042 is used to calculate the annotation point dataset of the retrieval results; the spatial clustering subunit 3043 is used to set the clustering distance threshold, spatially cluster the annotation point dataset according to the area of ​​the vector surface elements, and gradually merge the annotation points in the annotation point dataset whose adjacent distances are less than the set clustering distance threshold into the adjacent annotation points with the largest area; the accumulation subunit 3044 is used to accumulate the areas of the clustered vector surface elements to the corresponding clustered annotation points.

[0125] In one embodiment, if Fig.10 As shown, the calculation subunit 3042 includes a coordinate calculation module 30421 and an integration module 30422 .

[0126] The coordinate calculation module 30421 is used to calculate the coordinates of the center point of the vector surface element to obtain the annotation point. When a single vector surface element is composed of several sub-surface elements, the center point of the sub-surface element with the largest area is calculated to obtain the annotation point of the complex vector surface element; the integration module 30422 is used to integrate all the annotation points to obtain the annotation point data set.

[0127] In one embodiment, the tile construction unit 307 is used to map actual floating-point geographic coordinates into integer vector tile grid coordinates through geometric encoding based on the annotation point dataset to be visualized and the annotation text dataset, and merge redundant attributes through attribute encoding to obtain annotation vector tiles.

[0128] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned map annotation construction device 300 and each unit can refer to the corresponding description in the aforementioned method embodiment, and for the convenience and brevity of description, it will not be repeated here.

[0129] The map annotation construction device 300 can be implemented in the form of a computer program. Fig.11 Runs on the computer device shown.

[0130] See also Fig.11 , Fig.11 5 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device 500 may be a server, wherein the server may be an independent server or a server cluster composed of multiple servers.

[0131] See also Fig.11 The computer device 500 includes a processor 502 , a memory and a network interface 505 connected via a system bus 501 , wherein the memory may include a non-volatile storage medium 503 and an internal memory 504 .

[0132] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions, and when the program instructions are executed, the processor 502 can execute a map annotation construction method.

[0133] The processor 502 is used to provide computing and control capabilities to support the operation of the entire computer device 500 .

[0134] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a map annotation construction method.

[0135] The network interface 505 is used to communicate with other devices over the network. Fig.11 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0136] The processor 502 is used to run the computer program 5032 stored in the memory to implement the following steps:

[0137] Enter the vector surface elements into the spatial database in the global geographic coordinate system to obtain a vector surface dataset; enter the business data related to the vector surface elements into the database in a specified two-dimensional relational table structure to obtain a business dataset, and specify the fields related to the business data and the primary key of the vector surface elements as the foreign keys of the vector surface dataset; perform query optimization on the vector surface dataset and the business data; retrieve the vector surface dataset within the screen visualization range to obtain the retrieval results, calculate the annotation point dataset of the retrieval results, and cluster the annotation point dataset according to the set clustering distance threshold; set the retention threshold according to the view range, return the annotation points with the largest cumulative area after the first n clusters, so as to obtain the annotation point dataset to be visualized, wherein n is the retention threshold; obtain the business data field corresponding to the vector surface element according to the corresponding relationship between the primary key of the vector surface dataset and the foreign key, so as to obtain the basic elements of the annotation text of the vector surface element, and construct the annotation text dataset; construct the annotation vector tile based on the annotation point dataset to be visualized and the annotation text dataset.

[0138] In one embodiment, when the processor 502 implements the step of performing query optimization on the vector surface dataset and the business data, the processor 502 specifically implements the following steps:

[0139] Under the GIST framework, an R-tree spatial index is constructed for the vector surface dataset; the vector surface dataset is re-sorted and stored according to the sorting order of the R-tree spatial index using a database clustering function; and the relevant foreign keys of the business data are indexed.

[0140] In one embodiment, when the processor 502 implements the step of reordering the vector surface dataset according to the sorting order of the R-tree spatial index using the database clustering function and then storing the vector surface dataset, the processor 502 specifically implements the following steps:

[0141] The vector surface data set is sorted according to the sorting order of the R-tree spatial index using a database clustering function to obtain a sorting result; and the sorting result is physically stored according to the spatial position.

[0142] In one embodiment, the processor 502 implements the following steps when searching the vector surface dataset within the visual range of the screen to obtain the search results, calculating the annotation point dataset of the search results, and clustering the annotation point dataset according to the set clustering distance threshold:

[0143] The vector surface dataset is searched to obtain the search results within the visual range of the screen; the annotation point dataset of the search results is calculated; a clustering distance threshold is set, and the annotation point dataset is spatially clustered according to the area of ​​the vector surface elements, and the annotation points in the annotation point dataset whose adjacent distances are less than the set clustering distance threshold are gradually merged into the adjacent annotation points with the largest area; the areas of the clustered vector surface elements are accumulated to the corresponding cluster annotation points.

[0144] In one embodiment, when the processor 502 implements the step of calculating the annotation point data set of the search result, the processor 502 specifically implements the following steps:

[0145] Calculate the coordinates of the center point of the vector surface feature to obtain the annotation point. When a single vector surface feature is composed of several sub-surface features, calculate the center point of the sub-surface feature with the largest area to obtain the annotation point of the complex vector surface feature; integrate all the annotation points to obtain the annotation point dataset.

[0146] In one embodiment, when implementing the step of constructing the annotation vector tile based on the annotation point data set to be visualized and the annotation text data set, the processor 502 specifically implements the following steps:

[0147] Based on the annotation point dataset to be visualized and the annotation text dataset, the actual floating point geographic coordinates are mapped into integer vector tile grid coordinates through geometric coding, and redundant attributes are merged through attribute coding to obtain annotation vector tiles.

[0148] It should be understood that in the embodiment of the present application, the processor 502 may be a central processing unit (CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0149] It can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiment of the above method.

[0150] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein when the computer program is executed by a processor, the processor executes the following steps:

[0151] Enter the vector surface elements into the spatial database in the global geographic coordinate system to obtain a vector surface dataset; enter the business data related to the vector surface elements into the database in a specified two-dimensional relational table structure to obtain a business dataset, and specify the fields related to the business data and the primary key of the vector surface elements as the foreign keys of the vector surface dataset; perform query optimization on the vector surface dataset and the business data; retrieve the vector surface dataset within the screen visualization range to obtain the retrieval results, calculate the annotation point dataset of the retrieval results, and cluster the annotation point dataset according to the set clustering distance threshold; set the retention threshold according to the view range, return the annotation points with the largest cumulative area after the first n clusters, so as to obtain the annotation point dataset to be visualized, wherein n is the retention threshold; obtain the business data field corresponding to the vector surface element according to the corresponding relationship between the primary key of the vector surface dataset and the foreign key, so as to obtain the basic elements of the annotation text of the vector surface element, and construct the annotation text dataset; construct the annotation vector tile based on the annotation point dataset to be visualized and the annotation text dataset.

[0152] In one embodiment, when the processor executes the computer program to implement the step of performing query optimization on the vector surface dataset and the business data, the processor specifically implements the following steps:

[0153] Under the GIST framework, an R-tree spatial index is constructed for the vector surface dataset; the vector surface dataset is re-sorted and stored according to the sorting order of the R-tree spatial index using a database clustering function; and the relevant foreign keys of the business data are indexed.

[0154] In one embodiment, when the processor executes the computer program to implement the step of reordering the vector surface dataset according to the sorting order of the R-tree spatial index using the database clustering function and then storing the reordered vector surface dataset, the processor specifically implements the following steps:

[0155] The vector surface data set is sorted according to the sorting order of the R-tree spatial index using a database clustering function to obtain a sorting result; and the sorting result is physically stored according to the spatial position.

[0156] In one embodiment, when the processor executes the computer program to implement the steps of searching the vector surface dataset within the visual range of the screen to obtain the search results, calculating the annotation point dataset of the search results, and clustering the annotation point dataset according to the set clustering distance threshold, the processor specifically implements the following steps:

[0157] The vector surface dataset is searched to obtain the search results within the visual range of the screen; the annotation point dataset of the search results is calculated; a clustering distance threshold is set, and the annotation point dataset is spatially clustered according to the area of ​​the vector surface elements, and the annotation points in the annotation point dataset whose adjacent distances are less than the set clustering distance threshold are gradually merged into the adjacent annotation points with the largest area; the areas of the clustered vector surface elements are accumulated to the corresponding cluster annotation points.

[0158] In one embodiment, when the processor executes the computer program to implement the step of calculating the annotation point data set of the search result, the processor specifically implements the following steps:

[0159] Calculate the coordinates of the center point of the vector surface feature to obtain the annotation point. When a single vector surface feature is composed of several sub-surface features, calculate the center point of the sub-surface feature with the largest area to obtain the annotation point of the complex vector surface feature; integrate all the annotation points to obtain the annotation point dataset.

[0160] In one embodiment, when the processor executes the computer program to implement the step of constructing the annotation vector tile based on the annotation point data set to be visualized and the annotation text data set, the processor specifically implements the following steps:

[0161] Based on the annotation point dataset to be visualized and the annotation text dataset, the actual floating point geographic coordinates are mapped into integer vector tile grid coordinates through geometric coding, and redundant attributes are merged through attribute coding to obtain annotation vector tiles.

[0162] The storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.

[0163] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0164] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of each unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0165] The steps in the method of the embodiment of the present invention can be adjusted in order, combined and deleted according to actual needs. The units in the device of the embodiment of the present invention can be combined, divided and deleted according to actual needs. In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0166] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.

[0167] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A method for constructing map annotations, characterized in that: include: Enter the vector surface elements into the spatial database in the global geographic coordinate system to obtain the vector surface dataset; Entering the business data related to the vector surface element into the database in a specified two-dimensional relational table structure to obtain a business data set, and specifying the fields related to the business data and the primary key of the vector surface element as the foreign key of the vector surface data set; Performing query optimization on the vector surface dataset and the business data; Searching the vector surface dataset within the visual range of the screen to obtain a search result, calculating an annotation point dataset of the search result, and clustering the annotation point dataset according to a set clustering distance threshold; Set the retention threshold according to the view range, and return the annotation points with the largest cumulative area after the first n clusters to obtain the annotation point dataset to be visualized, where n is the retention threshold; According to the correspondence between the primary key of the vector surface dataset and the foreign key, the business data field corresponding to the vector surface element is obtained to obtain the basic elements of the annotation text of the vector surface element, and the annotation text dataset is constructed; Constructing annotation vector tiles based on the annotation point dataset to be visualized and the annotation text dataset; The query optimization of the vector surface dataset and the business data includes: Under the GIST framework, construct an R-tree spatial index for the vector surface dataset; Using a database clustering function, the vector surface dataset is reordered and stored according to the sorting order of the R-tree spatial index; Creating indexes for relevant foreign keys of the business data; The step of searching the vector surface dataset within the visual range of the screen to obtain a search result, calculating an annotation point dataset of the search result, and clustering the annotation point dataset according to a set clustering distance threshold comprises: Searching the vector surface data set to obtain search results within a screen visualization range; Calculating the annotation point data set of the retrieval result; Set the cluster distance threshold, perform spatial clustering on the annotation point dataset according to the area of ​​the vector surface element, and gradually merge the annotation points in the annotation point dataset whose adjacent distance is less than the set cluster distance threshold into the adjacent annotation points with the largest area; Accumulate the area of ​​the clustered vector surface features to the corresponding cluster annotation points; The annotated point data set for calculating the search result includes: Calculate the coordinates of the center point of the vector surface element to obtain the annotation point. When a single vector surface element is composed of several sub-surface elements, calculate the center point of the sub-surface element with the largest area to obtain the annotation point of the complex vector surface element. Integrate all annotation points to obtain an annotation point dataset.

2. The map annotation construction method according to claim 1, characterized in that: The method of using a database clustering function to reorder the vector surface dataset according to the sorting order of the R-tree spatial index and then storing the reordered vector surface dataset comprises: Using a database clustering function to sort the vector surface dataset according to the sorting order of the R-tree spatial index to obtain a sorting result; The sorting results are physically stored according to spatial locations.

3. The method for constructing map annotation according to claim 1, characterized in that: The step of constructing the annotation vector tile based on the annotation point data set to be visualized and the annotation text data set includes: Based on the annotation point dataset to be visualized and the annotation text dataset, the actual floating point geographic coordinates are mapped into integer vector tile grid coordinates through geometric coding, and redundant attributes are merged through attribute coding to obtain annotation vector tiles.

4. A map annotation construction device, characterized in that: include: A vector surface dataset generation unit is used to enter the vector surface elements into the spatial database in the global geographic coordinate system to obtain a vector surface dataset; A business data set generation unit is used to enter business data related to vector surface elements into a database in a specified two-dimensional relational table structure to obtain a business data set, and to specify fields related to the business data and the primary key of the vector surface element as foreign keys of the vector surface data set; A query optimization unit, used for performing query optimization on the vector surface dataset and the business data; A clustering unit, used to search the vector surface dataset within the visual range of the screen to obtain a search result, calculate an annotation point dataset of the search result, and cluster the annotation point dataset according to a set clustering distance threshold; Annotation point generation unit, used to set a retention threshold according to the view range, and return the annotation points with the largest cumulative area after the first n clusters, so as to obtain the annotation point data set to be visualized, where n is the retention threshold; A text data set generation unit is used to obtain the business data field corresponding to the vector surface element according to the correspondence between the primary key of the vector surface data set and the foreign key, so as to obtain the basic elements of the annotation text of the vector surface element and construct the annotation text data set; A tile construction unit, used for constructing an annotation vector tile based on the annotation point data set to be visualized and the annotation text data set; The query optimization unit includes a spatial index building subunit, a processing subunit and a foreign key index building subunit; A spatial index construction subunit is used to construct an R-tree spatial index for the vector face data set under the GIST framework; a processing subunit is used to re-sort the vector face data set according to the sorting order of the R-tree spatial index using a database clustering function and then store it; a foreign key index construction subunit is used to index the relevant foreign keys of the business data; The clustering unit includes a retrieval subunit, a calculation subunit, a spatial clustering subunit and an accumulation subunit; A search subunit is used to search the vector surface data set to obtain the search results within the visual range of the screen; a calculation subunit is used to calculate the annotation point data set of the search results; a spatial clustering subunit is used to set a clustering distance threshold, perform spatial clustering on the annotation point data set according to the area of ​​the vector surface elements, and gradually merge the annotation points in the annotation point data set whose adjacent distances are less than the set clustering distance threshold into the adjacent annotation points with the largest area; an accumulation subunit is used to accumulate the areas of the clustered vector surface elements to the corresponding clustered annotation points; The computing subunit includes a coordinate computing module and an integration module; The coordinate calculation module is used to calculate the coordinates of the center point of the vector surface element to obtain the annotation point. When a single vector surface element is composed of several sub-surface elements, the center point of the sub-surface element with the largest area is calculated to obtain the annotation point of the complex vector surface element; the integration module is used to integrate all the annotation points to obtain the annotation point dataset.

5. A computer device, characterized in that: The computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 3 when executing the computer program.

6. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.

Citation Information

Patent Citations

  • Annotation location and dynamic avoidance method based on vector tiles

    CN109147547A

  • Generalized, differentially encoded, indexed raster vector data and schema for maps on a personal digital assistant

    US6674445B1