A TIN-based global digital twin system for coastal restoration
Through the TIN-based global digital twin system coastal restoration method, high-precision feature classification and terrain triangulation technology are used to solve the problem of coastline inconsistency, achieve accurate rendering and smooth processing of the coastline, and improve the rendering effect of the global digital twin system. .
Patent Information
- Application Number
- CN202410868540.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-07-01
AI Technical Summary
When the existing global digital twin system generates coastlines, inconsistencies arise due to differences in the resolution and sources of seawater modeling and land modeling data. This causes seawater to exceed sea level when rendering coastlines, affecting the rendering effect.
The TIN-based global digital twin system coastal restoration method is used to vectorize high-precision feature classification raster image data to generate a terrain triangulation network and extract coastal vector data based on sea level height thresholds, combining the coastline buffer zone and feature classification vectors. Repairs were made, improved vector tiles were written, and the repaired coast scene was rendered in Unreal Engine.
It improves the fitting accuracy and rendering consistency of the coastline, eliminates pixel aliasing problems, avoids rendering lag caused by online modifications, and achieves smooth rendering and efficient data processing of the coastline.
Smart Images

Figure CN118396900B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of geographic information systems, and in particular to a TIN-based global digital twin system coastal restoration method. Background Art
[0002] The traditional two-dimensional GIS expression mainly displays 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 is less research 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.
[0003] Seawater modeling and land modeling play an important and indispensable role in the modeling of land objects in the global digital twin system. Seawater modeling aims to generate the sea surface based on the digital elevation model to ensure the consistency between the sea water height and the terrain elevation. At the same time, land modeling relies on surface classification data to accurately fit the detailed texture of the land to the digital elevation model to present a real and realistic land landscape.
[0004] However, the remote sensing data relied upon by these two modeling techniques often have different resolutions and sources. This difference may lead to deviations in the generation of coastlines. Specifically, due to the different characteristics of the data used for seawater modeling and land modeling, the generated coastline may show certain inconsistencies. This inconsistency may manifest itself as the problem of seawater exceeding sea level during the rendering process, which poses a challenge to the rendering effect of the global digital twin system.
[0005] For example, the invention patent with announcement number CN108052629A discloses a method for rapid land and sea judgment based on high-precision DEM data. The global ASTER GDEM data file is first interpolated and reconstructed according to a certain spatial indexing scheme. On this basis, the reconstructed DEM data file is binarized and compressed and merged into one file. Finally, the merged data file is used for real-time land and sea judgment.
[0006] However, the above application directly determines the land and ocean from DEM, and the accuracy of DEM is generally 30 meters, 60 meters, and 90 meters. The boundary of the coastline appears as pixel jagged and cannot be fully aligned with the terrain of the global digital twin system. In addition, the data of the above scheme is stored in the DEM file. For global-level data, the loading efficiency is low and there is a problem of rendering jams. Therefore, a TIN-based global digital twin system coastal restoration method is proposed to solve the above problems. Summary of the invention
[0007] In view of the shortcomings of the existing technology, the present invention provides a TIN-based global digital twin system coastal restoration method, which has the advantages of improving restoration accuracy and solving the problem of insufficient fit of the coastline.
[0008] In order to achieve the above-mentioned purpose of improving the restoration accuracy, the present invention provides the following technical solution: a TIN-based global digital twin system coastal restoration method, comprising the following steps:
[0009] S1: Smooth vectorization of object classification based on high-precision object classification raster image data;
[0010] S2: Generate terrain triangulated network (TIN) based on digital elevation model (DEM) and generate coastal vector data according to sea level threshold;
[0011] S3: Repair the coastal area based on the coastline buffer zone vector and the feature classification vector;
[0012] S4: Global repair of coastal vector surface data written to improved vector tiles;
[0013] S5: Unreal Engine loads the data and renders the repaired global coastal scene.
[0014] Preferably, the specific steps of performing smoothing vectorization of object classification based on high-precision object classification raster image data in step S1 are:
[0015] S1-1: Raster to vector conversion, converting the classified raster image data into vector data, which can be achieved through raster to vector conversion algorithms, such as polygonization, raster to line segment conversion, etc.
[0016] S1-2: Vector outline encryption, which is to encrypt the outline of the vectorized data, that is, to add nodes to improve the precision and accuracy of the vector data. The line density increase algorithm can be used;
[0017] S1-3: vector contour smoothing, smoothing the encrypted vector contour to eliminate unnecessary jagged boundaries, the commonly used method is Bezier curve fitting;
[0018] S1-4: Delete holes. Perform hole deletion on the smoothed vector data, that is, delete holes or blank areas that do not belong to any feature category. This can be achieved through spatial analysis and geometric operations.
[0019] S1-5: Contour simplification: Simplify the contours in vector data to reduce data complexity and storage space. Commonly used contour simplification algorithms include Douglas-Peucker algorithm, Visvalingam-Whyatt algorithm, etc.
[0020] Preferably, in step S2, a terrain triangulated network (TIN) is generated based on a digital elevation model (DEM), and coastal vector data is generated according to a sea level height threshold. The specific steps and methods used are as follows:
[0021] S2-1: Generate TIN grid based on DEM. Use the Delaunay triangulation algorithm to divide the elevation point set in the DEM data into non-overlapping triangles to generate a TIN grid to accurately describe the terrain features;
[0022] S2-2: Extracting land vector surface according to sea level height threshold: According to the preset sea level height threshold, the TIN grid is segmented by threshold, and the area with elevation higher than the threshold is extracted to form a land vector surface;
[0023] S2-3: Convert the vector surface into a vector line, extract the polygon boundary of the extracted land vector surface, and extract the polygon boundary line into vector line data to represent the boundary of the coastline;
[0024] S2-4: Add buffer zones to vector lines. Perform buffer zone analysis on the extracted coastline vector line data. According to the pre-set buffer distance, add appropriate buffer zones to the vector line data to handle terrain changes and data noise, and improve the quality and stability of coastline data.
[0025] Preferably, the method of repairing the coast according to the coastline buffer zone vector and the feature classification vector in step S3 is intended to improve the accuracy and integrity of the coastline data; the specific steps are as follows:
[0026] S3-1: Calculate the data intersection area, perform spatial intersection analysis on the coastline buffer zone vector and the feature classification vector, identify the intersection area between the two, and determine the coastline part that needs to be repaired;
[0027] S3-2: Extract the land area outside the coastline and generate the water body repair vector surface. Extract the land part outside the coastline from the intersection area, change it into the water area, and generate the water body repair vector surface data;
[0028] S3-3: Extract the water area within the coastline and generate the beach restoration vector surface. Extract the water part within the coastline from the intersection area and modify it into the beach area to generate the beach restoration vector surface data.
[0029] S3-4: Merge the repair vector surface into the feature classification vector, and merge the generated water body repair vector surface and beach repair vector surface into the feature classification vector to complete the repair of the coast.
[0030] Preferably, in step S4, A1: constructing global tile spatial position information according to the vector tile La-Lb pyramid level, and writing it into a header file:
[0031] A1-1: Let the vector tile pyramid level L = a;
[0032] 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 header file;
[0033] A1-3: Let L = L + 1, and continue when L ≤ b;
[0034] A1-4: Repeat steps A1-2 and A1-3;
[0035] A1-5: When L=b, the geographic coordinates of all levels of tiles are constructed to obtain a vector tile pyramid;
[0036] A2: Let L = c, where a ≤ c ≤ b, and use the tile longitude and latitude range to clip the repaired surface classification vector data. The clipped data is converted into vector data composed of faces, where c is the lowest level of data display:
[0037] A3: Encode the rendering level of the vector data, add the display level (show_level) attribute parameter to each point of the vector, and set the rendering level attribute for the surface data;
[0038] A3-2: For face data, show_level is calculated step by step using a thinning algorithm, where the thinning algorithm is the Ramer-Douglas-Peucker algorithm, the Visvalingam-Whyatt algorithm, the Douglas-Peucker algorithm (DP algorithm), the Landauer-Strawson algorithm (LRS algorithm), or the Visvalingam's Algorithm With Topology Preservation (VATP algorithm);
[0039] A3-2-1: For the elements of the face vector file, let L = c;
[0040] 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.
[0041] A3-2-3: Let L = L + 1, and continue when L ≤ b;
[0042] A3-2-4: Repeat steps A3-2-2 and A3-2-3;
[0043] A3-2-5: When L=b, if the point's show_level is not set, it is set to b; the calculation process of all points' show_level is completed;
[0044] A4: vector data compression storage;
[0045] 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.
[0046] 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;
[0047] A4-3: Compress data and write it into a database. Specifically, write the vector tile data into a database engine such as SQLite, PostgreSQL, or MySQL, and create an index based on the tile serial number for quick retrieval.
[0048] Preferably, in step S5, the Unreal Engine loads data and renders the repaired global coast scene, and the specific steps are as follows:
[0049] B1: Parse the header file and extract 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, etc. This information is then saved in a quadtree data structure for quick retrieval.
[0050] 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.
[0051] When d<c, no tile is requested, and when c≤d, vector tiles of level c are requested;
[0052] Furthermore, in 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.
[0053] 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;
[0054] 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;
[0055] B3-2: For the analysis of surface coverage vector surface and repaired coastline vector surface data, load the c-level vector 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 new lines or surfaces for subsequent processing;
[0056] B4: Data processing: After decoding, the surface geographic information data in the tile and 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, and the vector surface is drawn into the PNG image. During processing, the data can be further processed as needed, such as sorting, filtering, classification, simplification, etc.;
[0057] 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 on the 3D scene. For surface data, the line or surface data of B4 is obtained and rendered using upsampling. When d changes, the line or surface data of B4 is upsampled to the tile size and resolution of d level, and then sent to the engine for rendering;
[0058] B4, drawing a vector surface into a PNG image, is characterized in that the surface coverage vector surface is first drawn onto the PNG, and then the coastline cache zone vector surface is drawn onto the PNG to repair the problematic coastline area;
[0059] In B5, the geographic information data is rendered onto a three-dimensional scene, and the problematic seawater area is rendered as a beach.
[0060] Compared with the prior art, the present invention provides a TIN-based global digital twin system coastal restoration method, which has the following beneficial effects:
[0061] 1. The TIN-based global digital twin system coastal restoration method uses a vector contour smoothing method to realize the vectorization of surface classification images and extract coastlines from TIN. The advantage of specific data contour smoothing eliminates the jagged contour problem of pixelated data.
[0062] 2. The TIN-based global digital twin system coastal restoration method uses TIN data to generate accurate coastline data for the digital twin system. The coastline completely fits the boundary of seawater modeling with high accuracy, fundamentally solving the problem of seawater exceeding sea level and flooding over land due to data differences.
[0063] 3. The TIN-based global digital twin system coastal restoration method uses offline repair of coastline data, then saves the restoration results to vector tiles, and finally achieves smooth rendering on a global scale, thus avoiding the lag problems caused by online modifications and the inefficiency of manual modifications.
[0064] 4. The TIN-based global digital twin system coastal restoration method establishes a seawater buffer zone, is compatible with multiple resolution DEMs to realize the differences brought by seawater modeling, and merges the generated water body restoration vector surface and beach restoration vector surface into the land feature classification vector. This method is flexible and easy to modify. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 This is a schematic diagram of the surface coverage image of a TIN-based global digital twin system coastal restoration method proposed in the present invention;
[0066] Figure 2 This is a schematic diagram of surface coverage vector surface data of a TIN-based global digital twin system coastal restoration method proposed in the present invention;
[0067] Figure 3 A schematic diagram of a global digital twin system simulating seawater in a TIN-based global digital twin system coastal restoration method proposed in the present invention;
[0068] Figure 4 A TIN-based global digital twin system proposed in the present invention is a TIN grid schematic diagram of the global digital twin system;
[0069] Figure 5 A schematic diagram of the coastline and coastline buffer extracted by TIN grid in a TIN-based global digital twin system coastal restoration method proposed in the present invention;
[0070] Figure 6 A schematic diagram of merging a restoration vector surface into a land feature classification vector in a TIN-based global digital twin system coastal restoration method proposed by the present invention;
[0071] Figure 7 This is a rendering of the coastal restoration method of the global digital twin system based on TIN proposed in the present invention. Figure a is the rendering effect before restoration, and Figure b is the rendering effect after restoration. DETAILED DESCRIPTION
[0072] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0073] This embodiment provides a high-precision ground object classification raster image data (attached Figure 1 ) to smooth and vectorize the ground feature classification data (attached Figure 2 ) specific steps:
[0074] S1-1: Raster to vector conversion, converting the classified raster image data into vector data, which can be achieved through raster to vector conversion algorithms, such as polygonization, raster to line segment conversion, etc.
[0075] S1-2: Vector outline encryption, which is to encrypt the outline of the vectorized data, that is, to add nodes to improve the precision and accuracy of the vector data. The line density increase algorithm can be used;
[0076] S1-3: vector contour smoothing, smoothing the encrypted vector contour to eliminate unnecessary jagged boundaries, commonly used methods include Bezier curve fitting, etc.
[0077] S1-4: Delete holes. Perform hole deletion on the smoothed vector data, that is, delete holes or blank areas that do not belong to any feature category. This can be achieved through spatial analysis and geometric operations.
[0078] S1-5: Contour simplification: Simplify the contours in vector data to reduce data complexity and storage space. Commonly used contour simplification algorithms include Douglas-Peucker algorithm, Visvalingam-Whyatt algorithm, etc.
[0079] This embodiment provides a method for generating a terrain triangulated network (TIN) based on a digital elevation model (DEM), and generating a terrain triangulated network (TIN) based on sea level (attached Figure 3 ) height threshold to generate coastal vector data. The specific steps and methods used are as follows:
[0080] S2-1: Generate TIN grid based on DEM. Use Delaunay triangulation algorithm to divide the elevation point set in DEM data into non-overlapping triangles to generate TIN grid to accurately describe terrain features, as shown in the attached figure. Figure 4 As shown;
[0081] S2-2: Extracting land vector surface according to sea level height threshold: According to the preset sea level height threshold, the TIN grid is segmented by threshold, and the area with elevation higher than the threshold is extracted to form a land vector surface;
[0082] S2-3: Convert the vector surface into a vector line, extract the polygon boundary of the extracted land vector surface, and extract the polygon boundary line into vector line data to represent the boundary of the coastline;
[0083] S2-4: Add buffer zone to vector line: Perform buffer zone analysis on the extracted coastline vector line data. According to the preset buffer distance, add appropriate buffer zone to the vector line data to deal with terrain changes and data noise, and improve the quality and stability of coastline data. The results are shown in the attached figure. Figure 5 shown.
[0084] This embodiment:
[0085] S3, a method for repairing the coast based on the coastline buffer zone vector and the feature classification vector, aims to improve the accuracy and integrity of the coastline data. The specific steps are as follows:
[0086] S3-1: Calculate the data intersection area, perform spatial intersection analysis on the coastline buffer zone vector and the feature classification vector, identify the intersection area between the two, and determine the coastline part that needs to be repaired;
[0087] S3-2: Extract the land area outside the coastline and generate the water body repair vector surface. Extract the land part outside the coastline from the intersection area, change it into the water area, and generate the water body repair vector surface data;
[0088] S3-3: Extract the water area within the coastline and generate the beach restoration vector surface. Extract the water part within the coastline from the intersection area and modify it into the beach area to generate the beach restoration vector surface data.
[0089] S3-4: Merge the repair vector surface into the feature classification vector, and merge the generated water body repair vector surface and beach repair vector surface into the feature classification vector to complete the coast repair, as shown in the attached figure. Figure 6 shown.
[0090] Said S4, writing the globally repaired coast vector surface data into improved vector tiles;
[0091] A1: Construct global tile spatial location information based on the vector tile La-Lb pyramid level and write it into the header file;
[0092] A1-1: Let the vector tile pyramid level L = a;
[0093] 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 header file;
[0094] A1-3: Let L = L + 1, and continue when L ≤ b;
[0095] A1-4: Repeat steps A1-2 and A1-3;
[0096] A1-5: When L=b, the geographic coordinates of all levels of tiles are constructed to obtain a vector tile pyramid;
[0097] A2: Let L = c, where a≤c≤b, and use the tile longitude and latitude range to clip the repaired surface classification vector data, and convert the clipped data into vector data composed of faces;
[0098] Further, in step A2, c is the lowest level displayed by the data;
[0099] A3: Encode the rendering level of the vector data, add the display level (show_level) attribute parameter to each point of the vector, and set the rendering level attribute for the surface data;
[0100] For face data, the show_level is calculated step by step using a thinning algorithm;
[0101] 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);
[0102] A3-2-1: For the elements of the face vector file, let L = c;
[0103] 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.
[0104] A3-2-3: Let L = L + 1, and continue when L ≤ b;
[0105] A3-2-4: Repeat steps A3-2-2 and A3-2-3;
[0106] A3-2-5: When L=b, if the point's show_level is not set, it is set to b; the calculation process of all points' show_level is completed;
[0107] A4: vector data compression storage;
[0108] 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.
[0109] 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;
[0110] A4-3: Compress data and write it into a database. Specifically, write the vector tile data into a database engine such as SQLite, PostgreSQL, or MySQL, and create an index based on the tile sequence number for quick retrieval.
[0111] In S5, the Unreal Engine loads data and renders the repaired global coast scene. The specific steps are as follows:
[0112] B1: Parse the header file and extract 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, etc. This information is then saved in a quadtree data structure for quick retrieval.
[0113] 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.
[0114] Further, when d<c, no tile is requested, and when c≤d, vector tiles of level c are requested;
[0115] Furthermore, in step B2, the priority of tile loading is determined, specifically sorted according to the distance from the center of the tile to the center of the viewing angle, and the tile closest to the center of the viewing angle has a higher priority;
[0116] B3: Data decoding. After receiving the response from the server, the returned vector tile data is decoded. If there are multiple vector tiles, they are loaded asynchronously using multi-threading, and the tile data is loaded in order of priority from high to low.
[0117] B3-1: For the parsing of point vector data, load the vector tile points at level c, and cache the points in different queues according to show_level. According to the requested level d, the point data where c ≤ show_level ≤ d is used for subsequent processing;
[0118] B3-2: For the parsing of surface coverage vector surfaces and repaired coastline vector surface data, load the vector surfaces at level c, cache them in a queue, and parse the show_level of each internal point. According to level d, the points where c ≤ show_level ≤ d are formed into new lines or surfaces for subsequent processing;
[0119] B4: Data processing. After decoding, the surface geographic information data within the tile and the attribute information related to these features will be obtained. These information will be clipped using the longitude and latitude range of the level d tile, and the vector surfaces will be drawn onto a PNG image. If necessary, these data can be further processed, such as sorting, filtering, classification, simplification, etc.;
[0120] B5: Data rendering. When d < c at a long distance, use optical images for rendering and display. When c ≤ d at a short distance, render the geographic information data processed in B4 onto a 3D scene. For surface data, obtain the line or surface data of B4 and use upsampling for rendering. 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;
[0121] Regarding the above B4, when the vector surface is drawn onto a PNG image, it is characterized in that the surface coverage vector surface is first drawn onto the PNG, and then the repaired coastline cache zone vector surface is drawn onto the PNG to achieve the repair of the problematic coastline area;
[0122] Regarding the above B5, when the geographic information data is rendered onto a 3D scene, the problematic sea water area is rendered as a beach;
[0123] The effect before repair is as shown in Figure 7 (a). The sea water has overflowed the land and is higher than the sea level. The effect after repair is as shown in Figure 7 (b). The sea water higher than the sea level has been repaired into a beach.
[0124] Although the embodiments of the present invention have been shown and described, for those of ordinary skill in the art, it can be understood that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A TIN-based global digital twin system coastal restoration method, characterized in that: Includes the following: S1: Smooth vectorization of object classification based on high-precision object classification raster image data; The specific method for smoothing and vectorizing object classification based on high-precision object classification raster image data is as follows: S1-1: Raster to vector conversion, converting the classified raster image data into vector data through raster to vector conversion algorithms, including polygonization method and raster to line segment method; S1-2: Vector outline encryption, using the line density increase algorithm to encrypt the outline of the vectorized data, that is, adding nodes to improve the precision and accuracy of the vector data; S1-3: vector contour smoothing, using the Bezier curve fitting method to smooth the encrypted vector contour to eliminate jagged boundaries; S1-4: Delete holes. Through spatial analysis and geometric operations, the hole deletion operation is performed on the smoothed vector data, that is, the holes or blank areas that do not belong to any feature category are deleted; S1-5: Contour simplification: Contour simplification algorithms are used to simplify the contours in vector data to reduce data complexity and storage space. Contour simplification algorithms include Douglas-Peucker algorithm and Visvalingam-Whyatt algorithm. S2: Generate terrain triangulated network (TIN) based on digital elevation model (DEM) and generate coastal vector data according to sea level threshold; The specific methods for generating terrain triangulated network (TIN) based on digital elevation model (DEM) and generating coastal vector data according to sea level threshold are as follows: S2-1: Generate TIN grid based on DEM. Use the Delaunay triangulation algorithm to divide the elevation point set in the DEM data into non-overlapping triangles to generate a TIN grid to accurately describe the terrain features; S2-2: Extracting land vector surface according to sea level height threshold: According to the preset sea level height threshold, the TIN grid is segmented by threshold, and the area with elevation higher than the threshold is extracted to form a land vector surface; S2-3: Convert the vector surface into a vector line, extract the polygon boundary of the extracted land vector surface, and extract the polygon boundary line into vector line data to represent the boundary of the coastline; S2-4: Add buffer zones to vector lines. Perform buffer zone analysis on the extracted coastline vector line data. According to the preset buffer distance, add appropriate buffer zones to the vector line data to handle terrain changes and data noise, and improve the quality and stability of coastline data. S3: Repair the coastal area based on the coastline buffer zone vector and the feature classification vector; The method of repairing the coast based on the coastline buffer zone vector and the feature classification vector is aimed at improving the accuracy and integrity of the coastline data; the specific method is as follows: S3-1: Calculate the data intersection area, perform spatial intersection analysis on the coastline buffer zone vector and the feature classification vector, identify the intersection area between the two, and determine the coastline part that needs to be repaired; S3-2: Extract the land area outside the coastline and generate the water body repair vector surface. Extract the land part outside the coastline from the intersection area, change it into the water area, and generate the water body repair vector surface data; S3-3: Extract the water area within the coastline and generate the beach restoration vector surface. Extract the water part within the coastline from the intersection area and modify it into the beach area to generate the beach restoration vector surface data. S3-4: merge the repair vector surface into the feature classification vector, and merge the generated water body repair vector surface and beach repair vector surface into the feature classification vector to complete the repair of the coast; S4: Global repair of coastal vector surface data written to improved vector tiles; The specific method of writing the global repaired coast vector surface data into improved vector tiles is as follows: A1: According to the vector tile La-Lb pyramid level, construct the global tile spatial position information and write it into the header file: 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 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 repaired surface classification vector data. The clipped data is converted into vector data composed of faces, where c is the lowest level of data display: A3: Encode the rendering level of the vector data, and set the rendering level attribute of the surface data to add the display level, i.e., the show_level attribute parameter, to each point of the vector; A3-2: For face data, show_level is calculated step by step using a thinning algorithm, where the thinning algorithm is the Ramer-Douglas-Peucker algorithm, the Visvalingam-Whyatt algorithm, the Douglas-Peucker algorithm (DP algorithm), the Landauer-Strawson algorithm (LRS algorithm), or the Visvalingam's Algorithm With Topology Preservation (VATP algorithm); A3-2-1: For the elements of the face vector 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, and continue when L ≤ b; A3-2-4: Repeat A3-2-2 and A3-2-3; A3-2-5: When L=b, if the point's show_level is not set, it is set to b; the calculation process of all points' show_level is completed; A4: vector data compression storage; A4-1: The vector data is compressed using the Delta encoding method 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; 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 sequence number for quick retrieval. S5: Unreal Engine loads data and renders a repaired global coastal scene. The specific method of Unreal Engine loading data and rendering the repaired global coastal scene is as follows: B1: Parse the header file and 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. When d<c, no tile is requested, and when c≤d, vector tiles of level c are requested; Furthermore, the priority of tile loading is determined, specifically sorted according to 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. 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 surface coverage vector surface and repaired coastline vector surface data, load the c-level vector 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 new lines or surfaces for subsequent processing; B4: Data processing: After decoding, the surface geographic information data in the tile and 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, and the vector surface will be drawn into the PNG image. During processing, these data can be further processed, sorted, filtered, classified, and simplified as needed; when drawing the vector surface into the PNG image, the surface coverage vector surface must be drawn onto the PNG first, and then the coastline cache belt vector surface must be drawn onto the PNG to repair the problematic coastline area; B5: Data rendering: When d is less than c at a long distance, optical images are used for rendering and display. When c is less than or equal to d at a close distance, the geographic information data processed by B4 is rendered onto the three-dimensional scene. For surface data, the line or surface data of B4 is obtained and rendered using upsampling. When d changes, the line or surface data of B4 is upsampled to the tile size and resolution of the d level, and then sent to the engine for rendering. The geographic information data is rendered onto the three-dimensional scene, and the problematic sea area is rendered as a beach.
