Method for constructing variable resolution vector tiles
By dynamically adjusting the size of vector tile and Geohash encoding, combined with the dynamic quadtree model, the problem of unbalanced data volume of traditional vector tile is solved, and more efficient data transmission and rendering is achieved.
Patent Information
- Application Number
- CN202310166386.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-24
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2043-02-24
AI Technical Summary
Traditional vector tiles ignore the spatial distribution heterogeneity of geographical data, resulting in unbalanced data volume between tiles, affecting transmission and rendering efficiency.
The variable resolution vector tile construction method is adopted to dynamically adjust the tile size according to the data spatial distribution density characteristics, and encode it through the Geohash algorithm, and combine the dynamic quadtree model and point density analysis method to construct variable size vector tile adaptive data density.
It realizes the balance of data volume between tiles, improves transmission and rendering efficiency, reduces data redundancy, and improves front-end loading efficiency.
Smart Images

Figure CN116168096B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of agricultural-environmental microorganisms, and in particular relates to a method for constructing a variable-resolution vector tile structure. Background Art
[0002] With the rapid development of information technology, online geographic information service models have evolved from traditional basic operations such as browsing, querying, and retrieval to advanced functionalities such as rapid display of massive data volumes, interactive personalized map presentations, and dynamic updates of map data. Efficient transmission of massive amounts of geographic information and dynamic, personalized presentation are key theoretical and technical challenges urgently needed in online geographic information services. Currently, online services for raster data are addressed by raster map tile pyramid technology, but raster tiles cannot meet users' needs for personalized geographic information services. Therefore, vector tile pyramid technology has been proposed and has become a new trend.
[0003] The vector tile pyramid is a multi-resolution hierarchical model that, within a unified spatial reference, stores and displays vector data at varying resolutions based on user needs, forming a pyramidal structure with increasing resolution and increasing data size. At each level of the pyramid, the data space is divided into multiple uniformly sized grids (e.g., 256*256 pixels) using dividing lines parallel to the spatial data's coordinate axes. Spatial data is then clipped based on these grids to form vector tiles. At different levels of the pyramid, spatial data is simplified into different levels of detail and organized into a pyramidal structure based on the Level of Detail (LOD) model. Compared to raster tiles, vector tiles reduce tile data size and provide a more convenient spatial data representation. Furthermore, because vector tiles inherit the characteristics of vector data and are based on geographic features, they offer the possibility of personalized information display. Currently, Geoserver, ArcGIS, Mapbox, and other software offer vector tile services. Vector tile technology has been applied in various scenarios, including spatial data processing, mapping, and analysis.
[0004] Traditional vector tiles are divided into uniform grids, ignoring the spatial heterogeneity of geographic data. This leads to an imbalance in data load between tiles. For example, some vector tiles may contain numerous geographic features and therefore require large amounts of data, while others may contain few or no features and require less data. This imbalance in tile load reduces tile transmission and rendering efficiency. Summary of the Invention
[0005] The purpose of the present invention is to address the shortcomings of the existing technology and provide a method for constructing variable-resolution vector tiles. The method can dynamically adjust the tile size according to the spatial distribution density characteristics of the data, thereby ensuring load balance between different tiles and improving the transmission and rendering efficiency of vector tiles.
[0006] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0007] A method for constructing a variable resolution vector tile comprises the following steps:
[0008] Step 1: Determine the vector tile pyramid division levels m to n, where m≤n;
[0009] Step 2: construct a multi-scale vector dataset based on the vector tile pyramid level L;
[0010] Step 3: Based on the multi-scale vector dataset constructed in step 2 above, variable resolution vector tiles with adaptive data density are constructed according to the spatial distribution characteristics of the data.
[0011] Step 4: Encode the variable-resolution vector tiles based on the Geohash algorithm. Each code includes the level of the tile on the pyramid and the spatial position information of the tile.
[0012] Furthermore, step 2 is implemented as follows:
[0013] Step 2.1, let the vector tile pyramid level L = m;
[0014] Step 2.2: Calculate the tile scale and tile pixel resolution based on global subdivision in the WGS84 coordinate system according to the vector tile pyramid level L.
[0015] Step 2.3: Simplify the point, line, and surface vector data using the tile pixel resolution corresponding to the L level calculated in step 2.2 as the threshold;
[0016] Step 2.4, let L = L + 1, L ≤ n;
[0017] Step 2.5: Repeat steps 2.2-2.4 above.
[0018] In step 2.6, when L = m, the simplification of vector data at all levels is completed, and a multi-scale vector data set is obtained.
[0019] Furthermore, step 2.2 calculates the tile scale and tile pixel resolution based on global subdivision in the WGS84 coordinate system according to the vector tile pyramid level L as follows:
[0020] Step 2.2.1, based on the WGS84 coordinate system, the longitude range of the earth is -180° to 180°, and the latitude range is -90° to 90°. For the traditional vector tiles of level L, the number of tiles in the longitude direction is 2*2 L ;
[0021] Step 2.2.2, each traditional vector tile consists of 256*256 pixels, and the number of pixels in the longitude direction is 256*2*2 L ;
[0022] Step 2.2.3, the vector tile scale of layer L is calculated by the formula get;
[0023] In step 2.2.4, the relationship between the pixel resolution of the vector tile at layer L and the tile level is given by the formula Calculated.
[0024] Furthermore, the simplification method for point, line, and surface data in step 2.3 is as follows:
[0025] For point data, the distance threshold method is used for simplification. The tile pixel resolution size is set as the distance threshold, and the point data is simplified by deleting one of the two points whose distance is less than the threshold.
[0026] For line and surface data, first select the elements of the data: select the elements whose length is greater than the side length of a single tile pixel resolution in line data, and select the elements whose area is greater than the area of a single tile pixel resolution in surface data; then thin out the selected line and surface elements.
[0027] Furthermore, step 3 specifically includes the following steps:
[0028] Step 3.1, let the vector tile pyramid level L = m;
[0029] Step 3.2, select the L-th level vector data in the multi-scale vector dataset constructed in step 2 above;
[0030] Step 3.3, convert the vertex of the line and area features in the vector data into discrete coordinate point pairs;
[0031] Step 3.4, use point density analysis method to evaluate the density characteristics of the point set;
[0032] Step 3.5: Determine the maximum number of discrete points that a single vector tile can contain based on the network bandwidth and the size of the storage space occupied by the discrete coordinate points.
[0033] Step 3.6: Using the discrete point set constructed in step 3.3 above, based on the dynamic quadtree model, and using the maximum number of discrete points in a single vector tile obtained in step 3.5 above as the dynamic quadtree partitioning condition, construct variable-size vector tiles with adaptive data density;
[0034] Step 3.7: Combine the variable-size vector tile constructed in step 3.6 and the point set density feature obtained in step 3.4 to analyze whether the density feature of the variable-size vector tile corresponds to the density feature of the point set.
[0035] Step 3.8, let L = L + 1, L ≤ n;
[0036] Step 3.9: Repeat steps 3.2-3.8 above.
[0037] In step 3.10, when L=m, the construction of vector tiles of all levels is completed, and a variable-resolution vector tile pyramid is obtained.
[0038] Furthermore, the method of evaluating the density characteristics of the point set using the point density analysis method in step 3.4 is as follows: first, the same weight is assigned to each point, and then the number of points in the search area is added up, and the total is divided by the area of the search area to obtain the density characteristics of the point set.
[0039] Furthermore, the maximum number of discrete points contained in a single vector tile in step 3.5 is obtained by the following formula:
[0040]
[0041] Among them, Num is the threshold of the maximum number of points contained in a single tile; Bandwidth is the network bandwidth, in Mpbs; t is the transmission time of a single tile, in seconds; DV is the data volume of a single coordinate point, in bits, which varies according to the accuracy of the data.
[0042] Furthermore, the steps for constructing variable-resolution vector tiles with adaptive data density in step 3.6 are as follows:
[0043] Step 3.6.1: Take the geographic range of the vector data in step 3.2 above as the root node and calculate the number of discrete point pairs contained in the range;
[0044] Step 3.6.2: If the number of point pairs is greater than the threshold of the maximum number of discrete point pairs contained in a single vector tile, the geographic range is divided into four equal parts, and each divided geographic range is used as a child node;
[0045] Step 3.6.3: Calculate the number of discrete point pairs contained in the geographic range of each child node. If the number is greater than the threshold for the maximum number of discrete point pairs contained in a single vector tile, continue to divide the geographic range corresponding to the node into four equal parts. Otherwise, set the node as a leaf node and store the vector data corresponding to the node's geographic range as a vector tile.
[0046] In step 3.6.4, repeat steps 3.5.2-3.5.3 above until the construction of the vector tiles at this level is completed.
[0047] Furthermore, step 4 specifically includes the following steps:
[0048] Step 4.1, let the first two digits of the vector tile code be the level L of the tile on the pyramid;
[0049] In step 4.2, let the combination of the last eight digits and letters of the vector tile code be the Geohash code corresponding to the coordinates of the tile center point.
[0050] Furthermore, the Geohash encoding process in step 4.2 is:
[0051] First, the initial interval range of latitude [-90°, 90°] and longitude [-180°, 180°] is used to determine whether the target longitude and latitude are in the left interval or the right interval. The left interval code is 0 and the right interval code is 1.
[0052] Secondly, the interval obtained in the first step is further divided into halves, and the next binary code is obtained until the length of the code meets the accuracy requirement. Then, according to the rule of placing longitude in even positions and latitude in odd positions, the binary codes are combined to obtain a new binary string;
[0053] Finally, the binary string is converted into a string according to the Base32 table to obtain the GeoHash code corresponding to the tile.
[0054] Compared with the prior art, the present invention has the following beneficial effects:
[0055] 1) In the horizontal direction, the present invention takes into account the spatial distribution characteristics of data and dynamically adjusts the size of tiles, making tiles smaller and denser in areas with dense data and larger and sparser in areas with sparse data. This makes the amount of data between tiles relatively balanced, improving the efficiency of tile loading and rendering;
[0056] 2) In the vertical direction, the present invention calculates the tile scale and tile pixel resolution corresponding to the tile level, and simplifies the vector data using the tile pixel resolution as a threshold, thereby obtaining a multi-scale vector dataset. The vector data is organized into a pyramid structure with data granularity decreasing from coarse to fine and data volume decreasing from large to small.
[0057] 3) Since vector tiles only store attribute information and geometric information of vector data, the storage space occupied by attribute information is usually negligible compared to the geometric information. Therefore, in the process of constructing variable-resolution vector tiles, the present invention uses the number of coordinate points contained in the tile as the basis for balancing the size of the vector tiles. The present invention constructs a discrete point set of the vector data by converting the breakpoints of the line and surface elements of each level of vector data in the multi-scale vector data set constructed above into points, and constructs tiles for the vector data based on the number of points in the discrete point set.
[0058] 4) The present invention constructs vector tiles based on a "dynamic quadtree" model. The termination condition of the quadtree partitioning is a key issue. The present invention uses a threshold for the maximum number of discrete points contained in a single tile as the termination condition for the quadtree partitioning. If the number of points contained in a single tile exceeds the given threshold, the corresponding geographic range of the tile is further quadrupled. Otherwise, the partitioning is terminated, and the leaf nodes are stored as vector tiles. Vector tiles constructed in this way can ensure a relatively balanced number of coordinate points within the tile, thereby ensuring a relatively balanced size of the tiles.
[0059] 5) The threshold for the maximum number of discrete points a single tile can contain is crucial for tile partitioning. A too low threshold can lead to unnecessary, overly dense partitioning; a too high threshold can cause a single tile to contain too much data, creating an imbalance in data between tiles and impacting front-end loading efficiency. To ensure a balance between tile data volume and tile partitioning density, thereby improving front-end loading efficiency, this paper determines the threshold for the number of points a single tile can contain, taking into account network bandwidth and latitude and longitude coordinate accuracy.
[0060] 6) To facilitate the storage and retrieval of vector tiles, the present invention uses the Geohash encoding rule to encode variable-resolution vector tiles. The Geohash algorithm determines the unique identifier of the tile by encoding the two-dimensional spatial latitude and longitude coordinates of the center point of the vector tile into a character string. Encoding the variable-resolution vector tile based on the Geohash algorithm can be considered as filling the variable-size vector tile with a Z-order curve. At the same time, the present invention combines the pyramid level where the tile is located, so that each code includes the level of the tile on the pyramid and the spatial position information of the tile, for example, 12_wt3ethx8, where the first two digits are the level of the tile on the pyramid, and the combination of the last eight digits and letters is the Geohash code corresponding to the coordinates of the center point of the tile, which changes dynamically according to the position of the tile, thereby constructing a unique identifier for the vector tile, which is convenient for the storage and query of the tile. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 This is a flowchart of a method for constructing variable-resolution vector tiles according to an embodiment of the present invention;
[0062] Figure 2 Schematic diagram of experimental data of an embodiment of the present invention;
[0063] Figure 3 This is a partial level detail display of a multi-scale vector dataset according to an embodiment of the present invention;
[0064] Figure 4 A point density feature map of a discrete point set constructed from some level vector data of an embodiment of the present invention;
[0065] Figure 5 This is a diagram showing the result of vector tile partitioning at some levels according to an embodiment of the present invention;
[0066] Figure 6 A comparison chart of the number of variable-resolution vector tiles constructed in an embodiment of the present invention and traditional uniform grid vector tiles;
[0067] Figure 7 A comparison chart of the data volume standard deviation between the variable-resolution vector tiles constructed in an embodiment of the present invention and the traditional uniform grid vector tiles. DETAILED DESCRIPTION
[0068] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0069] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features therein may be combined with each other.
[0070] The present invention will be further described below with reference to specific examples, but they are not intended to limit the present invention.
[0071] To address the problem that traditional vector tiles divided into uniform grids have an excessive number of tiles and uneven data volume between tiles, which affects the efficiency of front-end loading and rendering, an embodiment of the present invention proposes a variable-resolution vector tile construction method that considers the spatial distribution density characteristics of data. This method takes into account that geographic information network services usually organize data into a pyramid structure with different levels of detail to meet user needs. It first generates a multi-scale vector dataset for displaying vector tiles at different levels of detail. The basic idea of the vector tile pyramid model is to organize spatial data into vector tiles of different spatial resolutions based on the size of the display area, with larger display areas corresponding to smaller-scale low-resolution vector tiles and smaller display areas corresponding to larger-scale high-resolution tiles. Then, the embodiment of the present invention slices the multi-scale vector dataset using grids of different sizes. Unlike the traditional uniform grid vector tile construction method, the embodiment of the present invention takes into account the spatial distribution heterogeneity of the data and dynamically adjusts the tile size according to the spatial distribution density of the data. Finally, to facilitate data organization and retrieval, the embodiment of the present invention uses the geohash algorithm to encode the variable-resolution vector tiles. The method of the embodiment of the present invention can dynamically adjust the size of the grid according to the spatial distribution density of the data in the horizontal direction, and use the variable-size grid to cut the vector data to form vector tiles. In the vertical direction, the vector data is simplified based on the tile scale and tile pixel resolution corresponding to the tile level to form multi-scale vector data, and the spatial data is organized into a pyramid structure. In terms of data organization, the geohash algorithm is used to encode the variable-resolution vector tiles to improve the efficiency of vector tile storage and query. The embodiment of the present invention is described in detail below with reference to specific examples, which specifically include:
[0072] See also Figure 1 , we use Wuhan Baidu map road network data as experimental data, the experimental data is as follows Figure 2 As shown. The data type is line, the geographic coordinate system is WGS-84, the projection coordinate system is WGS 1984UTM ZONE 49N, a total of 26298 road line features, including 12 attributes such as Shape and Name, and the total data size is 5,324,308 bytes. Figure 2It can be seen that Wuhan's road traffic network has formed a traffic network structure dominated by radial roads, combined with rings and grids. The density and complexity of the traffic network decrease from the core to the outer ring, which is a line data with very uneven spatial distribution of elements. The experimental test environment is an HP laptop processor Intel (R) Core (TM) i5-8250U CPU @ 1.60GHz 1.80GHz, 8.00GB of memory; the operating system is Windows 10 64-bit; the web server is Express; the development platform is ArcEngine; and the browser is Firefox. The implementation process of this embodiment is as follows:
[0073] Step 1: Determine the tile division level 0-21;
[0074] Step 2: Construct a multi-scale vector dataset based on the vector tile pyramid level L. This step is as follows:
[0075] Step 2.1, set the vector tile pyramid level L = 0;
[0076] Step 2.2: Calculate the tile scale and tile pixel resolution based on global subdivision in the WGS84 coordinate system according to the vector tile pyramid level L. The steps for calculating the tile scale and tile pixel resolution based on global subdivision in the WGS84 coordinate system according to the vector tile pyramid level L are as follows:
[0077] Step 2.2.1, based on the WGS84 coordinate system, the longitude range of the earth is 360 degrees (-180° to 180°), and the latitude range is 180 degrees (-90° to 90°). For the L-th level vector tile, the number of tiles in the longitude direction is 2*2 L ;
[0078] Step 2.2.2, each traditional vector tile consists of 256*256 pixels, so the number of pixels in the longitude direction is 256*2*2 L ;
[0079] Step 2.2.3: According to the web map tile service specification, the standard pixel size is 0.28mm×0.28mm, so the total length of the pixel in the longitude direction is 0.00028*256*2*2 L The distance from the Earth at the equator is 2πR, where R is the equatorial radius, which is equal to 6378137 meters. Therefore, the vector tile scale of layer L can be calculated by the formula get;
[0080] Step 2.2.4, the relationship between the pixel resolution of the vector tile at layer L and the tile level can be expressed by the formula The results calculated according to the above steps are shown in Table 1, as shown in Table 1, which shows the tile scale level tile pixel resolution corresponding to level 0-21 vector tiles;
[0081] Table 1 shows the tile scale and pixel resolution corresponding to vector tiles of levels 0-21.
[0082]
[0083]
[0084] Step 2.3, using the tile pixel resolution corresponding to the L level calculated in step 2.1 as the threshold to simplify the point, line, and surface vector data, wherein the simplification method for point, line, and surface data is as follows: For point data, use the "distance threshold method" to simplify, set the tile pixel resolution size as the distance threshold, and simplify the point data by deleting one of the two points whose distance is less than the threshold; For line and surface data, first select the elements of the data: select the elements in the line data whose length is greater than the side length of a single tile pixel resolution, and select the elements in the surface data whose area is greater than the area of a single tile pixel resolution. Then, thin out the selected line and surface elements. This embodiment uses the "Douglas-Peucker" thinning method, and uses the tile pixel resolution size as the thinning threshold to complete the thinning of line and surface data;
[0085] Step 2.4, let L = L + 1, L ≤ 21;
[0086] Step 2.5: Repeat steps 2.2-2.4 above.
[0087] Step 2.6: When L = 21, the simplification of all levels of vector data is completed, and a multi-scale vector data set is obtained, such as Figure 3 Shown are some level-of-detail displays of a multi-scale vector dataset.
[0088] Step 3: Based on the multi-scale vector dataset constructed in step 2 above, variable resolution vector tiles with adaptive data density are constructed according to the spatial distribution characteristics of the data. The specific implementation of this step is as follows:
[0089] Step 3.1, set the vector tile pyramid level L = 0;
[0090] Step 3.2, select the L-th level vector data in the multi-scale vector dataset constructed in step 2 above;
[0091] Step 3.3: Convert the vertex points of line and area features in the vector data into discrete coordinate point pairs (point features do not need to be converted);
[0092] Step 3.4, use the “point density analysis method” to evaluate the density characteristics of the point set. The specific method is: first assign the same weight to each point, then add up the number of points in the search area, and divide the sum by the search area to get the density characteristics of the point set (see Figure 4 ),like Figure 4 Shown is a point density feature map of a discrete point set constructed from partial level vector data;
[0093] Step 3.5: Determine the maximum number of discrete points a single vector tile can contain based on the network bandwidth and the storage space occupied by the discrete coordinate points. The formula for calculating the maximum number of discrete points a single vector tile can contain is:
[0094]
[0095] Where Num is the threshold value for the number of points in a single tile; Bandwidth is the network bandwidth, which in this embodiment is 50 Mbps; t is the transmission time of a single tile, which is approximately 10 ms, or 0.01 s; DV is the data volume of a single coordinate point. In this embodiment, the longitude and latitude coordinates of discrete points are accurate to 15 decimal places. After conversion to a string, the data volume of each coordinate point is approximately 35 bytes, or 280 bits. Therefore, the maximum threshold value for the number of discrete points in a single vector tile is calculated to be 1785.
[0096] Step 3.6: Using the discrete point set constructed in step 3.3 above, based on the "dynamic quadtree" model, the maximum number of discrete points in a single vector tile obtained in step 3.5 above is used as the dynamic quadtree partitioning condition to construct variable-size vector tiles with adaptive data density. The implementation method is as follows:
[0097] Step 3.6.1: Take the geographic range of the vector data in step 3.2 above as the root node and calculate the number of discrete point pairs contained in the range;
[0098] In step 3.6.2, if the number of point pairs is greater than 1785, the geographic range is divided into four equal parts, and each divided geographic range is used as a child node;
[0099] Step 3.6.3: Calculate the number of discrete point pairs contained in the geographic range of each child node. If the number is greater than 1785, continue to divide the geographic range of the node into four equal parts. Otherwise, set the node as a leaf node and store the vector data corresponding to the geographic range of the node as a vector tile.
[0100] Step 3.6.4: Repeat steps 3.5.2-3.5.3 above until the vector tile of this level is constructed.
[0101] Step 3.7: Combine the variable-size vector tile obtained in step 3.6 and the point set density feature obtained in step 3.4 to determine whether the density feature of the variable-size vector tile corresponds to the density feature of the point set;
[0102] Step 3.8, let L = L + 1, L ≤ 21;
[0103] Step 3.9: Repeat steps 3.2-3.8 above.
[0104] Step 3.10, when L=21, the construction of all levels of vector tiles is completed, and the variable resolution vector tile pyramid is obtained (see Figure 5 ),like Figure 5 Shown are the results of vector tile division at some levels.
[0105] Step 4: Encode the variable resolution vector tiles based on the Geohash algorithm. Each code includes the level of the tile on the pyramid and the spatial position information of the tile, such as Figure 6 As shown, specifically including:
[0106] Step 4.1, let the first two digits of the vector tile code be the level L of the tile on the pyramid;
[0107] In step 4.2, let the last eight digits and letters of the vector tile code be the Geohash code corresponding to the coordinates of the tile center point, which changes dynamically according to the position of the tile. The Geohash coding process is as follows:
[0108] First, the initial interval range of latitude [-90°, 90°] and longitude [-180°, 180°] is used to determine whether the target longitude and latitude are in the left or right interval. The left interval code is 0, and the right interval code is 1. Then, the interval obtained in the first step is further divided into halves, and the next binary code is obtained until the code length meets the accuracy requirement. Then, according to the rule of "place longitude in even positions and latitude in odd positions", the binary codes are combined to obtain a new binary string. Finally, the binary string is converted to a string according to the Base32 table to obtain the GeoHash code corresponding to the tile.
[0109] In order to illustrate the beneficial effects of the embodiments of the present invention, a comparative experiment was conducted between the variable resolution vector tiles constructed in the embodiments of the present invention and the traditional uniform grid vector tiles. The comparative experiment included: selecting 9-15 level variable resolution vector tiles and traditional vector tiles for comparative analysis and comparing the number, maximum data volume, minimum data volume, average data volume and standard deviation of the data volume of the two vector tiles. The comparison results are shown in Table 2. Figure 6 、 Figure 7 shown.
[0110] Table 2 is a comparison of the number, maximum data volume, minimum data volume, and average data volume of variable resolution vector tiles and traditional uniform grid vector tiles.
[0111]
[0112]
[0113] Table 2, Figure 6 、 Figure 7 Analysis shows that the number of traditional vector tiles increases exponentially with the increase in tile pyramid levels, while the number of variable-resolution vector tiles proposed in the embodiments of the present invention increases linearly. The standard deviation of the data volume of vector tiles at the same level shows that the standard deviation of the traditional vector tile method is large at low levels, indicating a significant imbalance in the amount of data between tiles; while the standard deviation of variable-resolution vector tiles is very small at all levels, indicating that the amount of data in the tiles is relatively more balanced. Therefore, the method of the embodiments of the present invention ensures load balancing between different tiles and improves the transmission and rendering efficiency of vector tiles.
[0114] The above are only preferred embodiments of the present invention and do not limit the implementation mode and protection scope of the present invention. For those skilled in the art, it should be aware that all solutions obtained by equivalent substitutions and obvious changes made using the contents of the present invention specification should be included in the protection scope of the present invention.
Claims
1. A method for constructing variable resolution vector tiles, characterized in that: The steps include: Step 1: Determine the vector tile pyramid division levels m to n, where m≤n; Step 2: construct a multi-scale vector dataset based on the vector tile pyramid level L; Step 3: Based on the multi-scale vector dataset constructed in step 2 above, variable resolution vector tiles with adaptive data density are constructed according to the spatial distribution characteristics of the data. Step 4: Encode the variable resolution vector tiles based on the Geohash algorithm. Each code includes the level of the tile on the pyramid and the spatial position information of the tile. Among them, step 2 is implemented as follows: Step 2.1, let the vector tile pyramid level L = m; Step 2.2: Calculate the tile scale and tile pixel resolution based on global subdivision in the WGS84 coordinate system according to the vector tile pyramid level L. Step 2.3: Simplify the point, line, and surface vector data using the tile pixel resolution corresponding to the L level calculated in step 2.2 as the threshold; Step 2.4, let L = L + 1, L ≤ n; Step 2.5: Repeat steps 2.2-2.4 above. In step 2.6, when L = m, the simplification of all levels of vector data is completed, and a multi-scale vector data set is obtained; Step 2.2: Calculate the tile scale and tile pixel resolution based on global subdivision in the WGS84 coordinate system according to the vector tile pyramid level L. Step 2.2.1, based on the WGS84 coordinate system, the longitude range of the earth is -180° to 180°, and the latitude range is -90° to 90°. For the traditional vector tiles of level L, the number of tiles in the longitude direction is 2*2 L ; Step 2.2.2, each traditional vector tile consists of 256*256 pixels, and the number of pixels in the longitude direction is 256*2*2 L ; Step 2.2.3, the vector tile scale of layer L is calculated by the formula scale L = get; In step 2.2.4, the relationship between the pixel resolution of the vector tile at layer L and the tile level is given by the formula Pixel Size = Calculated.
2. The method for constructing a variable resolution vector tile according to claim 1, wherein: The simplification method for point, line, and surface data in step 2.3 is as follows: For point data, the distance threshold method is used for simplification. The tile pixel resolution size is set as the distance threshold, and the point data is simplified by deleting one of the two points whose distance is less than the threshold. For line and surface data, first select the elements of the data: select the elements whose length is greater than the side length of a single tile pixel resolution in line data, and select the elements whose area is greater than the area of a single tile pixel resolution in surface data; then thin out the selected line and surface elements.
3. The method for constructing a variable resolution vector tile according to claim 1, wherein: Step 3 specifically includes the following steps: Step 3.1, let the vector tile pyramid level L = m; Step 3.2, select the L-th level vector data in the multi-scale vector dataset constructed in step 2 above; Step 3.3, convert the vertex of the line and area features in the vector data into discrete coordinate point pairs; Step 3.4, use point density analysis method to evaluate the density characteristics of the point set; Step 3.5: Determine the maximum number of discrete points that a single vector tile can contain based on the network bandwidth and the size of the storage space occupied by the discrete coordinate points. Step 3.6: Using the discrete point set constructed in step 3.3 above, based on the dynamic quadtree model, and using the maximum number of discrete points in a single vector tile obtained in step 3.5 above as the dynamic quadtree partitioning condition, construct variable-size vector tiles with adaptive data density; Step 3.7: Combine the variable-size vector tile constructed in step 3.6 and the point set density feature obtained in step 3.4 to analyze whether the density feature of the variable-size vector tile corresponds to the density feature of the point set. Step 3.8, let L = L + 1, L ≤ n; Step 3.9: Repeat steps 3.2-3.8 above. In step 3.10, when L = m, the construction of all levels of vector tiles is completed, and a variable-resolution vector tile pyramid is obtained.
4. The method for constructing a variable resolution vector tile according to claim 3, wherein: The method of evaluating the density characteristics of the point set using the point density analysis method in step 3.4 is as follows: First, assign the same weight to each point, then add up the number of points in the search area and divide the sum by the area of the search area to get the density feature of the point set.
5. The method for constructing a variable resolution vector tile according to claim 3, wherein: The maximum number of discrete points contained in a single vector tile in step 3.5 is obtained by the following formula: Num=[ ]; Among them, Num is the threshold of the maximum number of points contained in a single tile; Bandwidth is the network bandwidth, in Mpbs; t is the transmission time of a single tile, in seconds; DV is the data volume of a single coordinate point, in bits, which varies according to the accuracy of the data.
6. The method for constructing a variable resolution vector tile according to claim 3, wherein: The steps for constructing variable-resolution vector tiles with adaptive data density in step 3.6 are as follows: Step 3.6.1: Take the geographic range of the vector data in step 3.2 above as the root node and calculate the number of discrete point pairs contained in the range; Step 3.6.2: If the number of point pairs is greater than the threshold of the maximum number of discrete point pairs contained in a single vector tile, the geographic range is divided into four equal parts, and each divided geographic range is used as a child node; Step 3.6.3: Calculate the number of discrete point pairs contained in the geographic range of each child node. If the number is greater than the threshold for the maximum number of discrete point pairs contained in a single vector tile, continue to divide the geographic range corresponding to the node into four equal parts. Otherwise, set the node as a leaf node and store the vector data corresponding to the node's geographic range as a vector tile. Step 3.6.4: Repeat steps 3.6.2-3.6.3 above until the construction of the vector tiles at this level is completed.
7. The method for constructing a variable resolution vector tile according to claim 1, wherein: Step 4 specifically includes the following steps: Step 4.1, let the first two digits of the vector tile code be the level L of the tile on the pyramid; In step 4.2, let the combination of the last eight digits and letters of the vector tile code be the Geohash code corresponding to the coordinates of the tile center point.
8. The method for constructing a variable resolution vector tile according to claim 7, wherein: The Geohash encoding method in step 4.2 is: First, the initial interval range of latitude [-90°, 90°] and longitude [-180°, 180°] is used to determine whether the target longitude and latitude are in the left interval or the right interval. The left interval code is 0 and the right interval code is 1. Secondly, the interval obtained in the first step is further divided into halves, and the next binary code is obtained until the length of the code meets the accuracy requirement. Then, according to the rule of placing longitude in even positions and latitude in odd positions, the binary codes are combined to obtain a new binary string; Finally, the binary string is converted into a string according to the Base32 table, and the GeoHash code corresponding to the tile is obtained.
Citation Information
Patent Citations
Tile map storage method based on aggregation files
CN103744855A
Vector tile organization method considering granularity
CN111061729A