A global vector tile data compression construction and dynamic LOD loading method
Through global-level vector tile data compression construction and dynamic LOD loading methods, the problems of long calculation time and poor visualization fluency caused by the large number of vertices in traditional vector tile data processing are solved, achieving fast loading and rendering, and reducing data consumption. Storage space and rendering lag.
Patent Information
- Application Number
- CN202410944469.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-07-15
AI Technical Summary
Traditional vector tile data processing has problems such as a large number of vertices, which results in long calculation time and poor visualization fluency. Especially in global digital twin systems, data processing and loading efficiency is low, resulting in browser freezes and poor rendering effects. .
The global-level vector tile data compression construction method is used to construct tile spatial position information through the La-Lb pyramid level, crop remote sensing data, set the rendering level, use Delta encoding and gz ip algorithm for data compression, and use the dynamic LOD loading method , dynamically loading tile data according to the user's perspective and distance, using a quadtree structure and multi-threaded asynchronous loading to achieve fast rendering.
It achieves fast loading and rendering of vector tile data, reduces data storage space usage, avoids lags caused by cross-level access, and ensures smooth rendering and efficient data processing.
Smart Images

Figure CN118484438B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of geographic information data processing, and in particular to a global level vector tile data compression construction and dynamic LOD loading method. Background Art
[0002] The traditional two-dimensional GIS expression shows more planar location information and lacks three-dimensional spatial information. At present, the development of digital twins has begun to focus on data storage, loading and rendering at the city level, while there are few studies on global digital twin systems. The global digital twin system has important value in ecological scene simulation, smart agriculture, virtual reality, metaverse, global digital twins and other fields; data storage and smooth scheduling of global digital twin systems is an important topic; this topic involves a large amount of data, including data from sensors, equipment, simulation and other aspects. Therefore, the ability to store and process these large-scale data has become a challenge, which requires efficient storage systems and processing technologies to cope with. At the same time, the smooth scheduling and loading of large amounts of global data is another technical challenge.
[0003] Vector tile pyramid is a multi-resolution hierarchical model. Under a unified spatial reference, vector data is stored and displayed at different resolutions according to user needs, forming a pyramid structure with resolutions from coarse to fine and data volume from small to large. At the same level of the pyramid, the data space is divided into multiple grids of uniform size (such as 512*512 pixels) using dividing lines parallel to the spatial data coordinate axis, and the spatial data is cut based on the grid to form vector tiles. At different levels of the pyramid, the spatial data is simplified into different levels of detail and organized into a pyramid structure according to the LOD model. Compared with raster tiles, vector tiles can reduce the amount of tile data and provide a more convenient spatial data representation method. Moreover, since vector tiles inherit the characteristics of vector data and are based on geographic elements, they can provide users with the possibility of personalized information display. Vector tile technology has been applied to different scenarios such as spatial data processing, mapping and analysis.
[0004] However, when displaying vector feature data, we often face the common problems of long calculation time and poor visualization fluency due to the large amount of vector data. The main reason is that the number of vertices contained in the vector feature data is too large, and the current visualization systems of personal and enterprise computers are not enough to quickly process tens of thousands to hundreds of thousands of line and surface vector data and their visualization. At the same time, for large-volume vector data, the data displayed on the map is too dense when returned at one time, which can easily cause the browser to freeze and crash, resulting in poor browsing experience and slow output speed on the map. Therefore, a global-level vector tile data compression construction and dynamic LOD loading method is proposed to solve the above problems. Summary of the invention
[0005] 1. Technical issues to be resolved
[0006] In view of the shortcomings of the prior art, the present invention provides a global-level vector tile data compression construction and dynamic LOD loading method, which has the advantage of fast loading speed and solves the problem that the number of vertices contained in the vector element data is too large and the visualization fluency performance is poor.
[0007] (II) Technical solution
[0008] In order to achieve the above-mentioned purpose of fast loading speed, the present invention provides the following technical solution: a global level vector tile data compression construction method, comprising the following steps:
[0009] A1: Construct global tile spatial location information based on the vector tile La-Lb pyramid level and write it into the header file.
[0010] Wherein, a and b in A1 are characterized by 1≤a≤21, 1≤b≤21, and a<b;
[0011] A1-1: Let the vector tile pyramid level L = a;
[0012] A1-2: According to the vector tile pyramid level L, calculate the row and column numbers of all tiles in the global subdivision under the WGS84 coordinate system, the latitude and longitude coordinate range of the tiles, and the resolution information, and write the information into the header file;
[0013] A1-3: Let L = L + 1, and continue when L ≤ b;
[0014] A1-4: Repeat steps A1-2 and A1-3;
[0015] A1-5: When L=b, the geographic coordinates of all levels of tiles are constructed to obtain a vector tile pyramid.
[0016] A2: Let L = c, where a≤c≤b, and use the tile longitude and latitude range to clip the global remote sensing data. The clipped global remote sensing data is converted into vector data composed of points, lines, and surfaces.
[0017] Wherein, c in A2 is characterized by 1≤c≤21;
[0018] A3: Vector data rendering level encoding: add a display level (show_level) attribute parameter to each point of the vector, and set the rendering level attribute for point, line and surface data respectively.
[0019] A3-1: For point data: the number of points is num, let n = ca, randomly select num × (1 / 2) 1 、num×(1 / 2) 2、num×(1 / 2) 3 , ..., num×(1 / 2) n points, set show_level to c, c+1, ..., b-1 respectively, and the remaining num×(1 / 2) n Set show_level to b at each point, and these levels will be used in subsequent loads.
[0020] A3-2: For line and surface data, a thinning algorithm is used to progressively calculate show_level.
[0021] A3-2-1: For the elements of a vector line or surface file, let L = c;
[0022] A3-2-2: Use the resolution of L-level tiles as the distance threshold and use the thinning algorithm to simplify the elements. The number of points of the object will be reduced after simplification. If the show_level of the point is not set, it is set to L.
[0023] A3-2-3: Let L = L + 1, L ≤ b;
[0024] A3-2-4: Repeat steps A3-2-2 and A3-2-3;
[0025] A3-2-5: When L=b, if the show_level of the point is not set, it is set to b; complete the calculation process of show_level for all points.
[0026] A4: Vector data is compressed and stored.
[0027] A4-1: Delta encoding is used to compress vector data based on the differences between adjacent points. For each point, the difference between its coordinate value and the coordinate value of the previous point is encoded and stored. Since the differences between adjacent points in map data are usually small, Delta encoding can effectively reduce storage space.
[0028] A4-2: After A4-1 encoding, the data is converted into a compact binary format data stream for storage, and the binary data stream is compressed using the gzip algorithm.
[0029] A4-3: Compress data and write it into the database. Specifically, write the vector tile data into the SQLite, PostgreSQL, or MySQL database engine, and create an index based on the tile serial number for quick retrieval.
[0030] Furthermore, in step A2, c is the lowest level displayed by the data.
[0031] Furthermore, the global remote sensing data in step A2 is the data required for building a global digital twin system, including optical remote sensing images, infrared remote sensing images, surface classification images, vegetation category images, vegetation height images, OSM data and other attribute data.
[0032] Further, the thinning algorithm in step A3-2 is a Ramer-Douglas-Peucker algorithm, a Visvalingam-Whyatt algorithm, a Douglas-Peucker algorithm (DP algorithm), a Landauer-Strawson algorithm (LRS algorithm) or a Visvalingam's Algorithm With Topology Preservation (VATP algorithm).
[0033] A global level compressed vector tile dynamic LOD loading method comprises the following steps:
[0034] B1: Parse the header file; parse the global tile spatial location information of all LOD levels from the vector tile header file, including level, row and column number, resolution, longitude and latitude range information, and save this information in a quadtree data structure for easy and fast retrieval.
[0035] B2: Request tile data; according to the user's viewing angle and distance, determine the tile level d and row and column numbers to be loaded from the quadtree of B1, and determine the priority of tile loading, and then send a request to the server to obtain vector tiles.
[0036] Wherein, d in B2 is characterized by 1≤d≤21;
[0037] Wherein, d in B2 is characterized by a≤d≤b;
[0038] B3: Data decoding: After receiving the response from the server, decode the returned vector tile data. If there are multiple vector tiles, use multi-threading to load them asynchronously, and load the tile data in order from high to low priority.
[0039] B3-1: For the parsing of point vector data, load the vector tile points of level c, and cache the points in different queues according to show_level l, according to the requested level d, c≤show_level l≤d point data, for subsequent processing.
[0040] B3-2: For the analysis of line and surface vector data, load the c-level vector lines or surfaces, cache them in the queue, and parse the show_level of each internal point. According to the level d, the points with c≤show_level≤d are combined into new lines or surfaces for subsequent processing.
[0041] B4: Data processing; after decoding, the geographic information data of points, lines and surfaces in the tile, as well as the attribute information related to these elements, will be obtained. This information will be clipped using the latitude and longitude range of the level d tile, the points will be saved using a container, and the lines and surfaces will be drawn into a PNG image. These data can be sorted, filtered, classified and simplified as needed.
[0042] B5: Data rendering; when d<c at a long distance, optical images are used for rendering and display; when c≤d at a close distance, the geographic information data processed by B4 is rendered onto a three-dimensional scene.
[0043] B5-1: For a large amount of point data, use the add mode for rendering. When d increases, add points with show_level = d+1 in the container; when d decreases, unload points with show_level = d in the container.
[0044] B5-2: For line and surface data, obtain the line or surface data of B4 and render it using upsampling. When d changes, upsample the line or surface data of B4 to the tile size and resolution of level d, and then send it to the engine for rendering.
[0045] Further, when d<c, no tile is requested, and when c≤d, vector tiles of level c are requested.
[0046] Furthermore, in step B2, the priority of tile loading is determined, and the order is specifically based on the distance from the center of the tile to the center of the viewing angle. The tile closest to the center of the viewing angle has a higher priority.
[0047] Furthermore, the rendering process can be implemented through UE and WebGL technology, the rendering effect is controlled by a style file, and the three-dimensional rendering model is implemented through volume texture and model replacement.
[0048] (III) Beneficial effects
[0049] Compared with the prior art, the present invention provides a global level vector tile data compression construction and dynamic LOD loading method, which has the following beneficial effects:
[0050] 1. Large quantities of data are stored in vector tiles, using lower-level single-layer vector tiles for storage, and using attributes to record the level to which the point belongs; global vector data can be losslessly compressed and stored in small-space vector tiles, and dynamic LOD loading is supported.
[0051] 2. For loading of large batches of points, use the add mode instead of the original rep l ace mode to achieve smooth loading and unloading of batch points; avoid the jamming caused by cross-level access and the flickering problem in rendering.
[0052] 3. Use the lowest level single-layer LOD to store data, and then use cross-level supersampling to parse high-level vector data; realize the dynamic LOD display effect of single-layer data, which not only ensures the smoothness of loading and rendering, but also ensures that data compression occupies little hard disk space. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Attached Figure 1 : A flow chart of a global level vector tile data compression construction method;
[0054] Attached Figure 2 : A flow chart of a global level compressed vector tile dynamic LOD loading method;
[0055] Attached Figure 3 : Global vector point rendering tree effect map;
[0056] Attached Figure 4 : Global vector line rendering road effect map;
[0057] Attached Figure 5 : Global vector surface rendering water effect map;
[0058] Attached Figure 6 : Global vector surface rendering of farmland effects. DETAILED DESCRIPTION
[0059] The following will be combined with 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 only 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.
[0060] A global level vector tile data compression construction method comprises the following steps:
[0061] A1: The global latitude [-90°, 90°] and longitude [-180°, 180°] are used to construct the global tile spatial location information according to the vector tile L0-L21 pyramid levels and write it into the Ti l eJson header file.
[0062] A1-1: Set the vector tile pyramid level L=0;
[0063] A1-2: According to the vector tile pyramid level L, calculate the row and column numbers of all tiles in the global subdivision under the WGS84 coordinate system, the latitude and longitude coordinate range of the tiles, the resolution and other information, and write the information into the TileJson header file;
[0064] A1-3: Let L = L + 1, and continue when L ≤ 21;
[0065] A1-4: Repeat steps A1-2 and A1-3;
[0066] A1-5: When L=21, the geographic coordinate construction of all levels of tiles is completed to obtain a vector tile pyramid.
[0067] A2: Let L = 17, use the tile longitude and latitude range to clip the global remote sensing data, and convert the clipped global remote sensing data into vector data composed of points, lines, and surfaces.
[0068] Furthermore, in step A2, 17 is the lowest level of data display.
[0069] Furthermore, the global remote sensing data in step A2 is the data required for building a global digital twin system, including optical remote sensing images, infrared remote sensing images, surface classification images, vegetation category images, vegetation height images, OSM data and other attribute data.
[0070] A3: Vector data rendering level encoding: add a display level (show_level) attribute parameter to each point of the vector, and set the rendering level attribute for point, line and surface data respectively.
[0071] A3-1: For point data: set the number of points to 16 million, let n = 4, randomly select 8 million, 4 million, 2 million, and 1 million points, and set show_level to 17, 18, 19, and 20 respectively. Finally, for the remaining 1 million points, set show_level to 21. These levels are used in subsequent loading.
[0072] A3-2: For line and surface data, a thinning algorithm is used to progressively calculate show_level.
[0073] Further, the thinning algorithm in step A3-2 is a Ramer-Douglas-Peucker algorithm, a Visvalingam-Whyatt algorithm, a Douglas-Peucker algorithm (DP algorithm), a Landauer-Strawson algorithm (LRS algorithm) or a Visvalingam's Algorithm With Topology Preservation (VATP algorithm).
[0074] A3-2-1: Elements of line or surface vector files, let L = 17;
[0075] A3-2-2: Take the resolution of 17-level tiles, 0.00000536°, as the distance threshold, and use the thinning algorithm to simplify the elements. The number of points of the object will be reduced after simplification. If the show_level of the point is not set, it is set to 17;
[0076] A3-2-3: Let L = L + 1, which is 18, and 18 ≤ 21;
[0077] A3-2-4: Repeat steps A3-2-2 and A3-2-3;
[0078] A3-2-5: When L=21, if the show_level of the point is not set, it is set to 21; complete the calculation process of show_level of all points.
[0079] A4: Vector data is compressed and stored.
[0080] A4-1: Delta encoding is used to compress vector data based on the differences between adjacent points. For each point, the difference between its coordinate value and the coordinate value of the previous point is encoded and stored. Since the difference between adjacent points in map data is usually small, Delta encoding can effectively reduce storage space.
[0081] A4-2: After A4-1 encoding, the data is converted into a compact binary format data stream for storage, and the binary data stream is compressed using the gzip algorithm.
[0082] A5: Compress the data and write it into the database; specifically, write the vector tile data into the SQLite, PostgreSQL, or MySQL database engine, and create an index based on the tile sequence number for quick retrieval.
[0083] A global level compressed vector tile dynamic LOD loading method comprises the following steps:
[0084] B1: Parse the header file; parse the global tile spatial location information of all LOD levels from the vector tile header file, including level, row and column number, resolution, and longitude and latitude range information. Construct a quadtree data structure with this information to save it for quick retrieval.
[0085] B2: Request tile data; in a three-dimensional scene, according to the user's perspective and distance, determine the tile level 18 and row and column numbers that need to be loaded from the quadtree of B1, and determine the priority of tile loading, and then send a request to the server to obtain vector tiles.
[0086] Furthermore, in step B2, the priority of tile loading is determined, and the order is specifically based on the distance from the center of the tile to the center of the viewing angle. The tile closest to the center of the viewing angle has a higher priority.
[0087] B3: Data decoding: After receiving the response from the server, decode the returned vector tile data. If there are multiple vector tiles, use multi-threading to load them asynchronously, and load the tile data in order from high to low priority.
[0088] B3-1: Parsing of point vector data; loading 17-level vector tile points, and caching the points in different queues according to show_level d, and according to the requested level d, 17≤show_level ≤18 point data for subsequent processing.
[0089] B3-2: Analysis of line and surface vector data; load level 17 vector lines or surfaces, cache them in a queue, and parse the show_level of each point inside. According to level 18, the points with 17≤show_level≤18 are combined into new lines or surfaces for subsequent processing.
[0090] B4: Data processing; after decoding, the geographic information data of points, lines and surfaces in the tile, as well as the attribute information related to these elements, will be obtained. This information will be clipped using the latitude and longitude range of the level d tile, the points will be saved using a container, and the lines and surfaces will be drawn into a PNG image. These data can be sorted, filtered, classified and simplified as needed.
[0091] B5: Data rendering; at a long distance, if the LOD level is less than 17, optical images are used for rendering and display; at a close distance, if the LOD level is greater than level 17, the geographic information data processed by B4 is rendered onto the three-dimensional scene.
[0092] B5-1: For large amounts of point data, use add mode for rendering. When the LOD level increases to 19, add points with show_level = 19 to the container; when the LOD level decreases to 17, unload points with show_level = 18 in the container.
[0093] B5-2: For line and surface data, obtain the line or surface data of B4 and render it using upsampling. When the LOD level changes to 19, upsample the line or surface data of B4 to the tile size and resolution of level 19, and then send it to the engine for rendering.
[0094] The rendering process can be achieved through UE and WebGL technology. The rendering effect is controlled by style files, such as color, line width, transparency, etc. The 3D rendering model is realized through body texture and model replacement. In the global digital twin system, as shown in the attached Figure 3 As shown, tree data is saved and loaded using vector points; Figure 4 Roads are saved and loaded using vector lines, as shown in the attached Figure 5 and 6 As shown, water bodies, farmland, etc. are saved and loaded using vector surfaces.
[0095] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A global level vector tile data compression construction method comprises the following steps: A1: Construct global tile spatial location information based on the vector tile La-Lb pyramid level and write it into the header file; in, a and b in A1 are characterized by 1≤a≤21, 1≤b≤21, and a<b; A1-1: Let the vector tile pyramid level L = a; A1-2: According to the vector tile pyramid level L, calculate the row and column numbers of all tiles in the global subdivision under the WGS84 coordinate system, the latitude and longitude coordinate range of the tiles, and the resolution information, and write the information into the header file; A1-3: Let L = L + 1, and continue when L ≤ b; A1-4: Repeat steps A1-2 and A1-3; A1-5: When L=b, the geographic coordinates of all levels of tiles are constructed to obtain a vector tile pyramid; A2: Let L = c, where a≤c≤b, and use the tile longitude and latitude range to clip the global remote sensing data. The clipped global remote sensing data is converted into vector data consisting of points, lines, and surfaces. Wherein, c in A2 is characterized by 1≤c≤21; A3: Vector data rendering level encoding: add a display level (show_level) attribute parameter to each point of the vector, and set the rendering level attribute for point, line, and surface data respectively; A3-1: For point data: the number of points is num, let n = ca, randomly select num × (1 / 2) 1 、num×(1 / 2) 2 、num×(1 / 2) 3 , ..., num×(1 / 2) n points, set show_level to c, c+1, ..., b-1 respectively, and the remaining num×(1 / 2) n Set show_level to b for each point, these levels are used in subsequent loading; A3-2: For line and surface data, a thinning algorithm is used to progressively calculate show_level; A3-2-1: For the elements of a vector line or surface file, let L = c; A3-2-2: Use the resolution of L-level tiles as the distance threshold and use the thinning algorithm to simplify the elements. The number of points of the object will be reduced after simplification. If the show_level of the point is not set, it is set to L. A3-2-3: Let L = L + 1, L ≤ b; A3-2-4: Repeat steps A3-2-2 and A3-2-3; A3-2-5: When L = b, if the show_level of the point is not set, it is set to b; the calculation process of show_level of all points is completed; A4: vector data compression storage; A4-1: Delta encoding is used to compress vector data based on the difference between adjacent points. For each point, the difference between its coordinate value and the coordinate value of the previous point is encoded and stored. Since the difference between adjacent points in map data is usually small, Delta encoding can effectively reduce storage space. A4-2: After A4-1 encoding, the data is converted into a compact binary format data stream for storage, and the binary data stream is compressed using the gzip algorithm; A4-3: Compress data and write it into the database. Specifically, write the vector tile data into the SQLite, PostgreSQL, or MySQL database engine, and create an index based on the tile serial number for quick retrieval.
2. A global level vector tile data compression construction method according to claim 1, characterized in that: In step A2, c is the lowest level displayed by the data.
3. The method for constructing global level vector tile data compression according to claim 1, characterized in that: The global remote sensing data in step A2 is the data required to build a global digital twin system, including optical remote sensing images, infrared remote sensing images, surface classification images, vegetation category images, vegetation height images, OSM data and other attribute data.
4. The method for constructing global level vector tile data compression according to claim 1, characterized in that: The thinning algorithm in step A3-2 is Ramer-Douglas-Peucker algorithm, Visvalingam-Whyatt algorithm, Douglas-Peucker algorithm (DP algorithm), Landauer-Strawson algorithm (LRS algorithm) or Visvalingam's Algorithm With Topology Preservation (VATP algorithm).
5. A global level compressed vector tile dynamic LOD loading method, comprising the following steps: B1: Parse the header file; parse the global tile spatial location information of all LOD levels from the vector tile header file, including level, row and column number, resolution, and longitude and latitude range information; construct a quadtree data structure with this information to save it for quick retrieval; B2: Request tile data; according to the user's viewing angle and distance, determine the tile level d and row and column number to be loaded from the quadtree of B1, and determine the priority of tile loading, then send a request to the server to obtain vector tiles; in, In B2d, Its characteristics are 1≤d≤21; Wherein, d in B2 is characterized by a≤d≤b; B3: Data decoding: After receiving the response from the server, decode the returned vector tile data; if there are multiple vector tiles, use multi-threading to load them asynchronously, and load the tile data in order from high to low priority; B3-1: For the parsing of point vector data, load the vector tile points of level c and cache the points in different queues according to show_level. According to the requested level d, c≤show_level≤d point data is used for subsequent processing; B3-2: For the analysis of line and surface vector data, load the c-level vector line or surface, cache it in the queue, and analyze the show_level of each point inside. According to the level d, the points with c≤show_level≤d are combined into a new line or surface for subsequent processing; B4: Data processing: After decoding, the geographic information data of points, lines, and surfaces in the tile, as well as the attribute information related to these elements, will be obtained. This information is clipped using the latitude and longitude range of the level d tile, points are saved using containers, and lines and surfaces are drawn into PNG images. These data can be sorted, filtered, classified, and simplified as needed; B5: Data rendering; when d<c at a long distance, optical images are used for rendering and display; when c≤d at a close distance, the geographic information data processed in B4 is rendered onto a three-dimensional scene; B5-1: For a large amount of point data, use the add mode for rendering. When d increases, add points with show_level = d+1 in the container; when d decreases, unload points with show_level = d in the container; B5-2: For line and surface data, obtain the line or surface data of B4 and render it using upsampling. When d changes, upsample the line or surface data of B4 to the tile size and resolution of level d, and then send it to the engine for rendering.
6. A global level compressed vector tile dynamic LOD loading method according to claim 5, characterized in that: When d<c, no tile is requested, and when c≤d, vector tiles of level c are requested.
7. The method for dynamic LOD loading of global level compressed vector tiles according to claim 5, characterized in that: In step B2, the priority of tile loading is determined, and the order is specifically based on the distance from the center of the tile to the center of the viewing angle. The tile closest to the center of the viewing angle has a higher priority.
8. The method for dynamic LOD loading of global level compressed vector tiles according to claim 5, characterized in that: The rendering process can be implemented through UE and WebGL technology, the rendering effect is controlled by a style file, and the three-dimensional rendering model is implemented through body texture and model replacement.
