Method for generating and updating multilevel tile structure of massive spatial data model
Through the texture sharing library and triangular face shrinkage algorithm, combined with tile tree structure and snapshot technology, the problem of low rendering and updating efficiency of multi-level tile structures in three-dimensional GIS is solved, and efficient rendering and updating of massive spatial data models is achieved.
Patent Information
- Application Number
- CN202311575887.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-23
- Publication Date
- 2025-01-14
AI Technical Summary
The existing three-dimensional GIS method is difficult to effectively use multi-level tile structures for efficient hierarchical rendering of massive spatial data models, and supports the update of data models, and there are problems of low texture sharing and merging efficiency.
The texture sharing within the data range is achieved through the texture sharing library, the triangular face shrinking algorithm based on the texture color mean is used to simplify the spatial data model, and the texture matrix is stored in the third dimension of the simple-mode texture coordinates, and the tile tree structure is built to support hierarchical loading. and refine, accelerate rendering using tile wood snapshots.
It realizes efficient rendering and updating of massive spatial data models, reduces the amount of tile data, avoids the problem of simple mode surface leakage and texture replication, and improves rendering efficiency.
Smart Images

Figure CN119313800A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of geographic information technology, and specifically, a multi-level tile structure can not only effectively solve the hierarchical and efficient rendering problem of a massive spatial data model, but also support the updating of the spatial data model and improve the efficiency of tile use. Texture sharing within the entire data range is achieved through a texture sharing library, which can greatly reduce the texture information of the tile structure; the simplification of the spatial data model by a triangular face contraction algorithm based on the texture color mean can not only quickly generate a simplified model, but also effectively avoid the problem of surface leakage of the simplified model; the texture matrix is stored in the third dimension of the texture coordinates of the simplified model through texture splicing, which can effectively solve the problem that textures with repeated texture coordinates cannot be merged or need to be copied multiple times when merged, resulting in reduced resolution. A method for generating and updating a multi-level tile structure of a massive spatial data model. Background Art
[0002] With the rapid development of IT technology and industry, geographic information technology (GIS) has penetrated into all walks of life with its remarkable characteristics and increasingly powerful functions, and has played an increasingly important role in them. At the same time, these applications have in turn put forward more and higher requirements for GIS. People live in a real three-dimensional space, and many practical phenomena cannot be well solved by existing 2D GIS, such as the design and landscape simulation of overpasses and buildings in urban planning; data management and graphic display of underground railways, shopping malls, parking lots and other service facilities; reasonable layout and planning of power and communication facilities; reasonable configuration of fire protection, power supply, water supply, gas supply, alarm and other facilities in residential buildings in the real estate department; reasonable distribution, management, query and selection of optimal paths for urban ground and underground pipelines; planning and management of aviation flight routes; description and analysis of various phenomena such as strata, faults, geological structures, oil layers, underground gas, groundwater, etc. in the fields of geology and petroleum, etc. All of these require intuitive true three-dimensional representation. Traditional 2DGIS can no longer meet people's application needs, and it urgently needs to be converted to 3D GIS. Therefore, 3D GIS has aroused strong interest among researchers. The research on 3D GIS has become a hot topic in the academic community.
[0003] With the introduction of a series of concepts such as "digital earth" and "digital city", the application demand for three-dimensional city models is increasing rapidly. Universal services of geographic information such as digital cities and virtual geographic environments have also put forward urgent requirements for their three-dimensional representation, and the progress of earth observation technology, computer technology, especially high-resolution remote sensing technology and computer graphics and image processing technology has provided a variety of display methods for this. The three-dimensional representation of geographic information has the following significant features:
[0004] Three-dimensional representation can provide users with more intuitive spatial elevation information, while traditional two-dimensional representation reflects the planar position of spatial objects, and its elevation information only exists as an attribute value and cannot be intuitively reflected.
[0005] The types, quantity and quality characteristics of spatial targets, as well as the spatial positions of objects and the spatiotemporal distribution of phenomena are pointed out in a more intuitive and realistic way, so the three-dimensional representation has complete spatiotemporal positioning characteristics.
[0006] Correspondingly, the digital city is a realistic three-dimensional digital representation of the city, which allows people to explore and interact with the natural and cultural information of the city. In the field of photogrammetry, the digital city refers to the three-dimensional city model in most cases. It not only presents the three-dimensional city model, but also provides a photo-intuitive surface description such as realistic material and texture features and related attribute information. The GIS that meets the needs of the digital city is called "digital city GIS". Compared with three-dimensional visualization and virtual display technology, the research progress of practical true three-dimensional GIS is much slower, and its theory and technology are not yet mature. Therefore, unlike the true three-dimensional GIS in the general sense, the digital city GIS is still only a special prototype method of true three-dimensional GIS at this stage. It has been simplified in many aspects according to most application requirements, such as using the outer enclosing surface model instead of the solid geometric model and downplaying the complex spatial topological relationship. Regardless of how the real world is mapped to the spatial database, it emphasizes that GIS provides three-dimensional capabilities in a robust and effective way.
[0007] However, there are several key technical problems that need to be solved in the current 3D GIS method. How to effectively solve the hierarchical and efficient rendering problem of massive spatial data models with multi-level tile structures, and support the updating of spatial data models to improve the efficiency of tile use; using a texture sharing library to realize texture sharing within the entire data range can greatly reduce the texture information of the tile structure; using a triangle face contraction algorithm based on the mean value of texture color to simplify the spatial data model can not only quickly generate a simplified model, but also effectively avoid the problem of missing faces in the simplified model; storing the texture matrix in the third dimension of the simplified model texture coordinates through texture splicing can effectively solve the problem that textures with repeated texture coordinates cannot be merged or need to be copied multiple times when merged, resulting in reduced resolution; each level of the tile tree is composed of leaf nodes with a scheduling strategy of adding and a branch structure with a scheduling strategy of replacing, which not only retains the advantages of gradually loading and refining spatial data models of different granularities when the camera viewpoint is from far to near, but also effectively reduces the amount of tile data; using tile forest snapshots can greatly speed up the rendering efficiency of spatial data models when the camera viewpoint is far away when loading large-scale massive spatial data models. Summary of the invention
[0008] In order to overcome the drawbacks of the existing technical solutions, the multi-level tile structure is used to effectively solve the hierarchical and efficient rendering problem of massive spatial data models, and it can support the update of spatial data models and improve the efficiency of tile use; texture sharing within the entire data range is realized through a texture sharing library, which can greatly reduce the texture information of the tile structure; the simplification of the spatial data model based on the triangle face contraction algorithm of the texture color mean can not only quickly generate a simple model, but also effectively avoid the problem of missing faces of the simple model; the texture matrix is stored in the third dimension of the simple model texture coordinates through texture splicing, which can effectively solve the problem that textures with repeated texture coordinates cannot be merged or need to be copied multiple times when merged, resulting in reduced resolution; each level of the tile tree is composed of leaf nodes with a scheduling strategy of adding and a branch structure with a scheduling strategy of replacing, which not only retains the advantages of gradually loading and refining spatial data models of different granularities when the camera viewpoint is from far to near, but also effectively reduces the amount of tile data; the use of tile forest snapshots can greatly speed up the rendering efficiency of spatial data models when the camera viewpoint is far away when loading a large range of massive spatial data models.
[0009] A method for generating and updating a multi-level tile structure of a massive spatial data model, the method comprising the following steps: preparing a grid spatial data model: dividing the grid according to the coordinate reference of the spatial data and encoding the grid by using the density operation rule of the spatial data, constructing a grid window template to extract the spatial data model, checking and correcting the spatial data model in the grid, stretching and copying and splicing the textures of each level of the spatial data model one by one, and storing the textures of each level after the standardization and the corresponding number of times used by the spatial data model in the texture sharing library, calculating the level number of the spatial data model in the grid, Record the spatial data model coding, grid coding, and level coding of the spatial data model and cache them; generate a grid tile tree: compress and mix the textures of each level of the spatial data model after standardization, shrink the triangular faces of the spatial data model, perform texture splicing on the spatial data models of the same level in the grid to generate simple models of the spatial data models of each level in the grid, reorganize the spatial data models of each level in the grid to generate leaf nodes of the corresponding level and set the scheduling strategy and spatial error threshold, reorganize the simple models of the spatial data models of each level in the grid to generate the upper-level branch nodes of the corresponding level and set the scheduling strategy, spatial error threshold and reorganization Generate the association relationship of the leaf nodes of the corresponding level, and merge the textures of the texture sharing library; Generate a snapshot of the tile forest: create an orthographic projection camera, build a rendering window, initialize the color template and depth template of the rendering window, extract the branch nodes of all levels of multiple adjacent grid tile trees as tile forests for rendering in the snapshot mapping environment, extract the depth texture from the depth template of the rendering window, calculate the vertex coordinates and texture coordinates and store them in the skeleton information of the tile forest node, extract the color texture from the color template of the rendering window and store it in the texture information of the tile forest node; Multi-level tile structure update: determine the update category of the grid tile tree, When it is determined that the tile tree within this grid needs to be deleted and updated, the simple model of the spatial data model to be deleted is removed from the next level leaf node of the corresponding level of the spatial data model to be deleted, and the spatial data model to be deleted is removed from the branch nodes of the same level of the corresponding level of the spatial data model to be deleted. When it is determined that the tile tree within this grid needs to be added and updated, the simple model of the spatial data model to be added is added from the next level leaf node of the corresponding level of the spatial data model to be added, and the spatial data model to be added is added from the branch nodes of the same level of the corresponding level of the spatial data model to be added, the texture sharing library is updated, and the tile forest snapshot is updated.
[0010] A method for generating and updating a multi-level tile structure of a massive spatial data model, wherein the specific steps of preparing the grid spatial data model are:
[0011] Construct a grid window template to extract the spatial data model: Use the density calculation rule grid size of the spatial data, divide the grid according to the coordinate reference of the spatial data and encode the grid to obtain the grid code, obtain the covered grid set according to the range of the spatial data model, construct each grid in the set as a grid window template, and extract the spatial data model whose center point of the outsourcing range of the spatial data model is within the window template;
[0012] Check and correct the geometric information of the spatial data model: Check the spatial data model. When it is determined that one or more of the number of vertices of the vertex normal coordinates, the number of vertices of the vertex color coordinates, and the number of vertices of the texture coordinates of each level of texture are not equal to the number of vertices of the vertex coordinates and are not zero, correct the spatial data model, recalculate the vertex index of the spatial data model, and regard two vertices whose vertex coordinates have a distance less than a threshold as the same vertex;
[0013] Standardization of textures at all levels: Obtain the size of textures at all levels of the spatial data model, stretch the width and height of a single texture to the nearest power of 2 of the original width and height of the single texture, copy and splice the stretched texture to generate a new texture, and the width and height of the new texture are the maximum values of the stretched width and height, and repeatedly process the single texture until all textures at all levels of the spatial data model are standardized and the process ends; store the standardized textures at all levels and the corresponding number of times used by the spatial data model in the texture sharing library for processing;
[0014] Spatial data model classification: Calculate the level threshold of the grid tile according to the density of spatial data in the grid, count the outsourcing range of all spatial data models in the grid, calculate the level number of the spatial data model, record the spatial data model code, grid code, and level code of the spatial data model and cache them; the formula for calculating the level number of the spatial data model is:
[0015] Level Model =floor(log Threshold (max(x max -x min ,y max -y min )))
[0016] Where:
[0017] Level Model Represents the level number of the spatial data model;
[0018] Threshold represents the level threshold of the grid tile;
[0019] x min 、x maxRepresents the minimum and maximum values of the x-direction of the outer bounds of the spatial data model;
[0020] y min ,y max Represents the minimum and maximum values in the y direction of the outer range of the spatial data model.
[0021] A method for generating and updating a multi-level tile structure of a massive spatial data model, wherein the specific steps of generating a grid tile tree are:
[0022] Generate a simple model of the spatial data model at each level of the grid: compress and mix the textures of each level of the spatial data model after standardization to generate a new texture and the corresponding two-dimensional texture coordinates, shrink the triangular faces of the spatial data model according to the texture color mean threshold to obtain a new set of triangular faces and store them in the simple model of the spatial data model, perform texture splicing on the spatial data models of the same level in the grid to generate a new texture and a texture matrix corresponding to each of them and store them in the simple model of the spatial data model;
[0023] Generate nodes at each level of the grid tile tree: call the spatial data models at each level in the grid, reorganize the spatial data models at the same level to generate leaf nodes at the corresponding level, set the scheduling strategy and spatial error threshold for the reorganized leaf nodes at the corresponding level, call the simplified models of the spatial data models at each level in the grid, reorganize the simplified models of the spatial data models at the same level to generate the upper-level branch nodes at the corresponding level, set the scheduling strategy, spatial error threshold and the association relationship with the reorganized leaf nodes at the corresponding level;
[0024] Texture merging in the texture sharing library: extracting the standardized textures of each level in the texture sharing library, merging the textures that have been used more than once by the spatial data model according to the number of times they have been used by the spatial data model and whether they contain transparent channels, generating new textures with transparent channels and new textures without transparent channels; generating one-to-one corresponding texture matrices for the merged new textures with transparent channels and new textures without transparent channels, and storing the merged new textures with transparent channels and new textures without transparent channels and the texture matrices in the texture sharing library.
[0025] A method for generating and updating a multi-level tile structure of a massive spatial data model, wherein the specific steps of generating a simple model of a spatial data model at each level of a grid are as follows:
[0026] Texture compression and mixing: compress the textures of each level after the normalization of the spatial data model to generate a new texture, and the width and height of the new texture are half of the width and height of the normalized texture. According to the texture coordinates corresponding to the textures of different levels, the new textures generated by compression of different levels are mixed to generate a new texture and the corresponding texture coordinates of two dimensions;
[0027] Triangular face contraction based on texture color mean: calculate the texture color mean of each triangular face of the spatial data model according to the new texture generated by mixing and the corresponding texture coordinates of the two dimensions, calculate the texture color mean threshold according to the geometric simplification rate of the spatial data model, determine whether the difference between the texture color means of two adjacent triangular faces is less than the texture color mean threshold, contract the two adjacent triangular faces whose texture color mean difference is less than the texture color mean threshold to generate a new triangular face, update the vertex indexes of the two contracted vertices of the spatial data model in other adjacent triangles, repeatedly contract the triangular faces to obtain a new set of triangular faces and a set of vertex indices and store them in the simplified model of the spatial data model; the formula for contracting two adjacent triangular faces to generate a new triangular face is:
[0028]
[0029] Where:
[0030] Distance min Represents the shortest distance between the four vertices of two adjacent triangles;
[0031] x A ,y A 、z A Represents the coordinate value of the vertex coordinates of the first vertices of two adjacent triangles;
[0032] x B ,y B , z B Represents the coordinate value of the vertex coordinates of the second vertices of two adjacent triangles;
[0033] x C ,y C , z C Represents the coordinate value of the vertex coordinates of the third vertex of two adjacent triangles;
[0034] x D ,y D , z D Represents the coordinate value of the fourth vertex of two adjacent triangles;
[0035] x1, y1, z1 represent the coordinate values of the vertex coordinates of the first vertex of the new triangle generated by contraction;
[0036] x2, y2, z2 represent the coordinate values of the vertex coordinates of the second vertex of the new triangle generated by contraction;
[0037] x3, y3, z3 represent the coordinate values of the vertex coordinates of the second vertex of the new triangle generated by contraction;
[0038] Texture splicing: Splice the new texture generated by mixing the spatial data models at the same level in the grid to generate a new texture, and generate a texture matrix corresponding to each of the new textures generated by the mixture, store the new texture generated by the splicing in the simple model of the spatial data model, and store the texture matrix in the third dimension of the texture coordinates of the simple model of the corresponding spatial data model, where the formula for the texture matrix to calculate the third dimension of the texture coordinates is:
[0039] Texcoord w =(-log2 s)<<16+t1×256+t2
[0040] Where:
[0041] Matrix Texture Represents the texture matrix;
[0042] s represents the scaling amount of the texture matrix;
[0043] t1 represents the translation of the texture matrix in the first dimension u direction of the texture coordinates;
[0044] t2 represents the translation of the texture matrix in the second dimension v direction of the texture coordinates;
[0045] Texcoord w Represents the third dimension w value of the texture coordinate.
[0046] A method for generating and updating a multi-level tile structure of a massive spatial data model, wherein the specific steps of generating nodes at each level of a grid tile tree are as follows:
[0047] Generate leaf nodes at each level of the grid tile tree: call the spatial data models at each level in the grid, calculate the geometric information data volume of the spatial data model, compare the geometric information data volume of the spatial data model at the same level with the leaf node threshold, and determine that when the geometric information data volume of the spatial data model at the same level is less than the leaf node threshold, reorganize the spatial data model at the same level to generate leaf nodes at the corresponding level, and then recycle and compare the geometric information data volume of the spatial data model at the same level with the leaf node threshold until all the spatial data models at the same level are reorganized to generate leaf nodes at the corresponding level, then stop the cycle and enter the next step; set the scheduling strategy of the leaf nodes at the corresponding level to be newly added, and calculate the spatial error threshold of the leaf nodes at the corresponding level according to the outsourcing scope and level number of the leaf nodes at the corresponding level, and store it in the leaf nodes at the corresponding level; the formula for calculating the geometric information data volume of the spatial data model is:
[0048] Size Geometry =Number Vertex ×10×Size float +Number Index ×Size int
[0049] Where:
[0050] Size Geometry The amount of geometric information data representing the spatial data model;
[0051] Number Vertex The number of vertices representing the vertex coordinates of the spatial data model;
[0052] Size float Represents the unit storage space occupied by float type data in the tile target storage computer system;
[0053] Number Index The number of vertices representing the vertex index of the spatial data model;
[0054] Size int Represents the unit storage space occupied by int type data in the tile target storage computer system;
[0055] Generate branch nodes at each level of the grid tile tree: call the simple model of the spatial data model at each level in the grid, calculate the texture information data volume of the simple model of the spatial data model, compare the texture information data volume of the simple model of the spatial data model at the same level with the branch node threshold, and determine that when the texture information data volume of the spatial data model at the same level is less than the branch node threshold, reorganize the simple model of the spatial data model at the same level to generate the upper-level branch node of the corresponding level, and then cyclically compare the texture information data volume of the simple model of the spatial data model at the same level with the branch node threshold until all the simple models of the spatial data model at the same level are completed. When the previous level branch node of the corresponding level is reorganized and generated, the loop is stopped and the next step is entered; the scheduling strategy of the previous level branch node of the corresponding level is set to the replacement mode, and the spatial error threshold of the previous level branch node of the corresponding level is calculated according to the outsourcing scope and level number of the previous level branch node of the corresponding level and stored in the previous level branch node of the corresponding level, and the association relationship between the previous level branch node of the corresponding level and the leaf node of the corresponding level is stored in the previous level branch node of the corresponding level; wherein the formula for calculating the texture information data volume of the simple model of the spatial data model is:
[0056]
[0057] Where:
[0058] Size Texture The amount of texture information data of the simple model representing the spatial data model;
[0059] N Texture The number of new textures generated by splicing in the simple model representing the spatial data model;
[0060] width i The width of the i-th texture in the simple model representing the spatial data model to generate a new texture;
[0061] Size Pixel Represents the storage space occupied by a unit pixel in the tile target storage computer system.
[0062] A method for generating and updating a multi-level tile structure of a massive spatial data model, wherein the specific steps of generating a tile forest snapshot are:
[0063] Initialize the snapshot mapping environment: create an orthographic projection camera, input the model view matrix and projection matrix, build a rendering window, and initialize the color template and depth template of the rendering window;
[0064] Extract tile forests for snapshot mapping: According to the regular grid size and spatial data model density, extract all levels of branch nodes of multiple adjacent grid tile trees as tile forests, normalize the vertex coordinates of all branch nodes in the tile forests according to the range of the tile forests, and then render them in the snapshot mapping environment;
[0065] Generate a tile forest node: extract the depth texture from the depth template of the rendering window, evenly take points in the rendering window, calculate the vertex coordinates and texture coordinates and store them in the skeleton information of the tile forest node, and extract the color texture from the color template of the rendering window and store it in the texture information of the tile forest node.
[0066] A method for generating and updating a multi-level tile structure of a massive spatial data model, wherein the specific steps of generating a tile forest node are as follows:
[0067] Generate skeleton information of tile forest nodes: After rendering is completed, evenly select points in the rendering window according to the range of the tile forest, calculate the first two dimensions of vertex coordinates and texture coordinates and store them in the skeleton information of the tile forest node, extract the depth texture from the depth template of the rendering window, extract the corresponding depth value from the depth texture according to the first two dimensions of the vertex coordinates, and calculate the third dimension of the vertex coordinates and store it in the skeleton information of the tile forest node. The formula for calculating the third dimension of the vertex coordinates of the tile forest node from the depth value is:
[0068]
[0069] Where:
[0070] z new Represents the third z value of the vertex coordinates of the tile forest node;
[0071] Depth represents the depth value extracted from the depth texture;
[0072] z far Represents the z value of the orthographic projection camera at the far clipping plane;
[0073] z near Represents the z value of the orthographic projection camera at the near clipping plane;
[0074] z max Represents the maximum value of the vertex coordinate z of all branch nodes in the tile forest;
[0075] z min Represents the minimum value of the vertex coordinate z of all branch nodes in the tile forest;
[0076] Generate texture information of tile forest node: extract color texture from the color template of the rendering window and store it in the texture information of the tile forest node, and set the association relationship between the material and color texture in the skeleton information of the tile forest node.
[0077] A method for generating and updating a multi-level tile structure of a massive spatial data model, wherein the specific steps of updating the multi-level tile structure are:
[0078] Update grid tile tree: determine whether the tile trees in each grid in the area need to be updated, and classify the categories of tile trees in the grids that need to be updated according to deletion and addition. When it is determined that the tile tree in this grid needs to be deleted and updated, remove the simple model of the spatial data model to be deleted from the leaf node of the next level corresponding to the level of the spatial data model to be deleted, and remove the spatial data model to be deleted from the branch nodes of the same level of the spatial data model to be deleted. When it is determined that the tile tree in this grid needs to be added and updated, add the simple model of the spatial data model to be added from the leaf node of the next level corresponding to the level of the spatial data model to be added, add the spatial data model to be added from the branch nodes of the same level corresponding to the level of the spatial data model to be added, and update the texture sharing library;
[0079] Update tile forest snapshot: re-map the grid tile tree that is determined to be updated according to the steps of generating tile forest snapshot to generate a new tile forest node to replace the original tile forest node.
[0080] A method for generating and updating a multi-level tile structure of a massive spatial data model, wherein the specific steps of updating the grid tile tree are:
[0081] Determine the update category of the grid tile tree: compare the spatial data model to be updated with the existing grid tile tree, determine whether the tile trees in each grid in the area need to be updated, and classify the categories of the tile trees in the grids that need to be updated according to deletion and addition;
[0082] Deleting and updating the grid tile tree nodes: when it is determined that the tile tree within the grid needs to be deleted and updated, the grid code and model level of the spatial data model to be deleted are obtained from the cache of the spatial data model code, the grid code, and the level code of the spatial data model through the spatial data model code, and the simple model of the spatial data model to be deleted is removed from the leaf node of the next level of the spatial data model to be deleted in the grid tile tree corresponding to the grid code of the spatial data model to be deleted; the spatial data model to be deleted is removed from the branch nodes of the same level of the spatial data model to be deleted in the grid tile tree corresponding to the grid code of the spatial data model to be deleted, and the number of times the texture of the spatial data model to be deleted in the texture sharing library corresponds to the number of times the spatial data model is used;
[0083] Add and update the grid tile tree nodes: when it is determined that the tile book within the grid needs to be added and updated, preprocess the spatial data model to be added according to the spatial data model preprocessing step, generate a simplified model for the spatial data model to be added according to the simplified model step of generating the spatial data model of each level of the grid, add the simplified model of the spatial data model to be added from the leaf node of the next level corresponding to the level of the spatial data model to be added in the grid tile tree corresponding to the grid code of the spatial data model to be added, and add the spatial data model to be added from the branch node of the same level corresponding to the level of the spatial data model to be added in the grid tile tree corresponding to the grid code of the spatial data model to be added;
[0084] Update the texture sharing library: remove the textures that have been used 0 times by the spatial data model, and merge the newly added textures in the texture sharing library according to the texture merging step to generate new textures with transparent channels and new textures without transparent channels, and store the corresponding texture matrices in the texture sharing library.
[0085] It can be seen from this that:
[0086] The method in the embodiment of the present invention can effectively solve the hierarchical and efficient rendering problem of massive spatial data models with a multi-level tile structure, and can support the updating of spatial data models and improve the efficiency of tile use; texture sharing within the entire data range is achieved through a texture sharing library, which can greatly reduce the texture information of the tile structure; the simplification of the spatial data model by a triangular face contraction algorithm based on the texture color mean can not only quickly generate a simplified model, but also effectively avoid the problem of missing faces of the simplified model; the texture matrix is stored in the third dimension of the simplified model texture coordinates through texture splicing, which can effectively solve the problem that textures with repeated texture coordinates cannot be merged or need to be copied multiple times when merged, resulting in reduced resolution; each level of the tile tree is composed of leaf nodes with a scheduling strategy of adding a new mode and a branch structure with a scheduling strategy of replacing a mode, which not only retains the advantages of gradually loading and refining spatial data models of different granularities when the camera viewpoint is from far to near, but also effectively reduces the amount of tile data; the use of tile forest snapshots can greatly speed up the rendering efficiency of the spatial data model when the camera viewpoint is far away when loading a large-scale massive spatial data model. BRIEF DESCRIPTION OF THE DRAWINGS
[0087] Figure 1 A schematic flow chart of a method for generating and updating a multi-level tile structure of a massive spatial data model provided in an embodiment of the present invention;
[0088] Figure 2 A schematic diagram of a process flow of preparing a grid space data model in an embodiment of the present invention;
[0089] Figure 3 A schematic diagram of the process of generating a grid tile tree in an embodiment of the present invention;
[0090] Figure 4 It is a schematic diagram of a simplified flow chart of steps for generating spatial data models of each level of a grid in an embodiment of the present invention;
[0091] Figure 5 A schematic diagram of the process of generating nodes at each level of a grid tile tree in an embodiment of the present invention;
[0092] Figure 6 This is a schematic diagram of the process of generating a snapshot of a tile forest in an embodiment of the present invention;
[0093] Figure 7 This is a schematic diagram of the process of generating a tile forest node in an embodiment of the present invention;
[0094] Figure 8 It is a schematic diagram of the process flow of the multi-level tile structure update steps in an embodiment of the present invention;
[0095] Fig. 9 The figure is a schematic diagram of the process of updating the grid tile tree in an embodiment of the present invention. DETAILED DESCRIPTION
[0096] In order to enable those skilled in the art to better understand the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. The exemplary embodiments and descriptions of the present invention are used to explain the present invention but are not intended to limit the present invention.
[0097] Embodiment 1:
[0098] Figure 1 A schematic diagram of a flow chart of a method for generating and updating a multi-level tile structure of a massive spatial data model provided in this embodiment is shown in FIG. Figure 1As shown, a method for generating and updating a multi-level tile structure of a massive spatial data model, the method includes the following steps: grid spatial data model preparation: using the density operation rule of spatial data to calculate the grid size, dividing the grid according to the coordinate reference of the spatial data and encoding the grid, constructing a grid window template to extract the spatial data model, checking and correcting the spatial data model in the grid, stretching and copying and splicing the textures of each level of the spatial data model one by one, and storing the standardized textures of each level and the corresponding number of times used by the spatial data model in the texture sharing library, calculating the level code of the spatial data model in the grid number, record the spatial data model code, grid code, and level code of the spatial data model and cache them; generate a grid tile tree: compress and mix the textures of each level of the spatial data model after standardization, shrink the triangular faces of the spatial data model, splice the textures of the spatial data models at the same level in the grid to generate simple models of the spatial data models at each level of the grid, reorganize the spatial data models at each level in the grid to generate leaf nodes at the corresponding level and set the scheduling strategy and spatial error threshold, reorganize the simple models of the spatial data models at each level in the grid to generate the upper-level branch nodes at the corresponding level and set the scheduling strategy, spatial error threshold and The group generates the association relationship of the leaf nodes of the corresponding level, and merges the textures of the texture sharing library; generates a snapshot of the tile forest: creates an orthographic projection camera, builds a rendering window, initializes the color template and depth template of the rendering window, extracts the branch nodes of all levels of multiple adjacent grid tile trees as tile forests for rendering in the snapshot mapping environment, extracts the depth texture from the depth template of the rendering window, calculates the vertex coordinates and texture coordinates and stores them in the skeleton information of the tile forest node, extracts the color texture from the color template of the rendering window and stores it in the texture information of the tile forest node; updates the multi-level tile structure: determines the update category of the grid tile tree, When it is determined that the tile tree within this grid needs to be deleted and updated, the simple model of the spatial data model to be deleted is removed from the next level leaf node of the corresponding level of the spatial data model to be deleted, and the spatial data model to be deleted is removed from the branch nodes of the same level of the corresponding level of the spatial data model to be deleted. When it is determined that the tile tree within this grid needs to be added and updated, the simple model of the spatial data model to be added is added from the next level leaf node of the corresponding level of the spatial data model to be added, and the spatial data model to be added is added from the branch nodes of the same level of the corresponding level of the spatial data model to be added, the texture sharing library is updated, and the tile forest snapshot is updated.
[0099] like Figure 2 As shown, a method for generating and updating a multi-level tile structure of a massive spatial data model, the specific steps of preparing the grid spatial data model are:
[0100] Construct a grid window template to extract the spatial data model: Use the density calculation rule grid size of the spatial data, divide the grid according to the coordinate reference of the spatial data and encode the grid to obtain the grid code, obtain the covered grid set according to the range of the spatial data model, construct each grid in the set as a grid window template, and extract the spatial data model whose center point of the outsourcing range of the spatial data model is within the window template;
[0101] Check and correct the geometric information of the spatial data model: Check the spatial data model. When it is determined that the number of vertices of the vertex normal coordinates, the number of vertices of the vertex color coordinates, and the number of vertices of the texture coordinates of each level of texture are not equal to the number of vertices of the vertex coordinates and are not zero, correct the spatial data model, recalculate the vertex index of the spatial data model, and regard two vertices whose vertex coordinates are less than the threshold value of 1CM as the same vertex;
[0102] Standardization of textures at all levels: Obtain the size of textures at all levels of the spatial data model, stretch the width and height of a single texture to the nearest power of 2 of the original width and height of the single texture, copy and splice the stretched texture to generate a new texture, and the width and height of the new texture are the maximum values of the stretched width and height, and repeatedly process the single texture until all textures at all levels of the spatial data model are standardized and the process ends; store the standardized textures at all levels and the corresponding number of times used by the spatial data model in the texture sharing library for processing;
[0103] Spatial data model classification: Calculate the level threshold of the grid tile according to the density of spatial data in the grid, count the outsourcing range of all spatial data models in the grid, calculate the level number of the spatial data model, record the spatial data model code, grid code, and level code of the spatial data model and cache them; the formula for calculating the level number of the spatial data model is:
[0104] Level Model =floor(log Threshold (max(x max -x min ,y max -y min )))
[0105] Where:
[0106] Level Model Represents the level number of the spatial data model;
[0107] Threshold represents the level threshold of the grid tile;
[0108] x min 、xmax Represents the minimum and maximum values of the x-direction of the outer bounds of the spatial data model;
[0109] y min ,y max Represents the minimum and maximum values in the y direction of the outer range of the spatial data model.
[0110] like Figure 3 As shown, a method for generating and updating a multi-level tile structure of a massive spatial data model, wherein the specific steps of generating a grid tile tree are:
[0111] Generate a simple model of the spatial data model at each level of the grid: compress and mix the textures of each level of the spatial data model after standardization to generate a new texture and the corresponding two-dimensional texture coordinates, shrink the triangular faces of the spatial data model according to the texture color mean threshold to obtain a new set of triangular faces and store them in the simple model of the spatial data model, perform texture splicing on the spatial data models of the same level in the grid to generate a new texture and a texture matrix corresponding to each of them and store them in the simple model of the spatial data model;
[0112] Generate nodes at each level of the grid tile tree: call the spatial data models at each level in the grid, reorganize the spatial data models at the same level to generate leaf nodes at the corresponding level, set the scheduling strategy and spatial error threshold for the reorganized leaf nodes at the corresponding level, call the simplified models of the spatial data models at each level in the grid, reorganize the simplified models of the spatial data models at the same level to generate the upper-level branch nodes at the corresponding level, set the scheduling strategy, spatial error threshold and the association relationship with the reorganized leaf nodes at the corresponding level;
[0113] Texture merging in the texture sharing library: extracting the standardized textures of each level in the texture sharing library, merging the textures that have been used more than once by the spatial data model according to the number of times they have been used by the spatial data model and whether they contain transparent channels, generating new textures with transparent channels and new textures without transparent channels; generating one-to-one corresponding texture matrices for the merged new textures with transparent channels and new textures without transparent channels, and storing the merged new textures with transparent channels and new textures without transparent channels and the texture matrices in the texture sharing library.
[0114] like Figure 4 As shown, a method for generating and updating a multi-level tile structure of a massive spatial data model, the specific steps of generating a simple model of the spatial data model at each level of the grid are:
[0115] Texture compression and mixing: compress the textures of each level after the normalization of the spatial data model to generate a new texture, and the width and height of the new texture are half of the width and height of the normalized texture. According to the texture coordinates corresponding to the textures of different levels, the new textures generated by compression of different levels are mixed to generate a new texture and the corresponding texture coordinates of two dimensions;
[0116] Triangular face contraction based on texture color mean: calculate the texture color mean of each triangular face of the spatial data model according to the new texture generated by mixing and the corresponding texture coordinates of the two dimensions, calculate the texture color mean threshold according to the geometric simplification rate of the spatial data model, determine whether the difference between the texture color means of two adjacent triangular faces is less than the texture color mean threshold, contract the two adjacent triangular faces whose texture color mean difference is less than the texture color mean threshold to generate a new triangular face, update the vertex indexes of the two contracted vertices of the spatial data model in other adjacent triangles, repeatedly contract the triangular faces to obtain a new set of triangular faces and a set of vertex indices and store them in the simplified model of the spatial data model; the formula for contracting two adjacent triangular faces to generate a new triangular face is:
[0117]
[0118] Where:
[0119] Distance min Represents the shortest distance between the four vertices of two adjacent triangles;
[0120] x A ,y A 、z A Represents the coordinate value of the vertex coordinates of the first vertices of two adjacent triangles;
[0121] x B ,y B , z B Represents the coordinate value of the vertex coordinates of the second vertices of two adjacent triangles;
[0122] x C ,y C , z C Represents the coordinate value of the vertex coordinates of the third vertex of two adjacent triangles;
[0123] x D ,y D , z D Represents the coordinate value of the fourth vertex of two adjacent triangles;
[0124] x1, y1, z1 represent the coordinate values of the vertex coordinates of the first vertex of the new triangle generated by contraction;
[0125] x2, y2, z2 represent the coordinate values of the vertex coordinates of the second vertex of the new triangle generated by contraction;
[0126] x3, y3, z3 represent the coordinate values of the vertex coordinates of the second vertex of the new triangle generated by contraction;
[0127] Texture splicing: Splice the new texture generated by mixing the spatial data models at the same level in the grid to generate a new texture, and generate a texture matrix corresponding to each of the new textures generated by the mixture, store the new texture generated by the splicing in the simple model of the spatial data model, and store the texture matrix in the third dimension of the texture coordinates of the simple model of the corresponding spatial data model, where the formula for the texture matrix to calculate the third dimension of the texture coordinates is:
[0128] Texcoord w =(-log2 s)<<16+t1×256+t2
[0129] Where:
[0130] Matrix Texture Represents the texture matrix;
[0131] s represents the scaling amount of the texture matrix;
[0132] t1 represents the translation of the texture matrix in the first dimension u direction of the texture coordinates;
[0133] t2 represents the translation of the texture matrix in the second dimension v direction of the texture coordinates;
[0134] Texcoord w Represents the third dimension w value of the texture coordinate.
[0135] like Figure 5 As shown, a method for generating and updating a multi-level tile structure of a massive spatial data model, wherein the specific steps of generating nodes at each level of the grid tile tree are:
[0136] Generate leaf nodes at each level of the grid tile tree: call the spatial data models at each level in the grid, calculate the geometric information data volume of the spatial data model, compare the geometric information data volume of the spatial data model at the same level with the leaf node threshold, and determine that when the geometric information data volume of the spatial data model at the same level is less than the leaf node threshold, reorganize the spatial data model at the same level to generate leaf nodes at the corresponding level, and then recycle and compare the geometric information data volume of the spatial data model at the same level with the leaf node threshold until all the spatial data models at the same level are reorganized to generate leaf nodes at the corresponding level, then stop the cycle and enter the next step; set the scheduling strategy of the leaf nodes at the corresponding level to be newly added, and calculate the spatial error threshold of the leaf nodes at the corresponding level according to the outsourcing scope and level number of the leaf nodes at the corresponding level, and store it in the leaf nodes at the corresponding level; the formula for calculating the geometric information data volume of the spatial data model is:
[0137] Size Geometry =Number Vertex ×10×Size float +Number Index ×Size int
[0138] Where:
[0139] Size Geometry The amount of geometric information data representing the spatial data model;
[0140] Number Vertex The number of vertices representing the vertex coordinates of the spatial data model;
[0141] Size float Represents the unit storage space occupied by float type data in the tile target storage computer system;
[0142] Number Index The number of vertices representing the vertex index of the spatial data model;
[0143] Size int Represents the unit storage space occupied by int type data in the tile target storage computer system;
[0144] Generate branch nodes at each level of the grid tile tree: call the simple model of the spatial data model at each level in the grid, calculate the texture information data volume of the simple model of the spatial data model, compare the texture information data volume of the simple model of the spatial data model at the same level with the branch node threshold, and determine that when the texture information data volume of the spatial data model at the same level is less than the branch node threshold, reorganize the simple model of the spatial data model at the same level to generate the upper-level branch node of the corresponding level, and then cyclically compare the texture information data volume of the simple model of the spatial data model at the same level with the branch node threshold until all the simple models of the spatial data model at the same level are completed. When the previous level branch node of the corresponding level is reorganized and generated, the loop is stopped and the next step is entered; the scheduling strategy of the previous level branch node of the corresponding level is set to the replacement mode, and the spatial error threshold of the previous level branch node of the corresponding level is calculated according to the outsourcing scope and level number of the previous level branch node of the corresponding level and stored in the previous level branch node of the corresponding level, and the association relationship between the previous level branch node of the corresponding level and the leaf node of the corresponding level is stored in the previous level branch node of the corresponding level; wherein the formula for calculating the texture information data volume of the simple model of the spatial data model is:
[0145]
[0146] Where:
[0147] Size Texture The amount of texture information data of the simple model representing the spatial data model;
[0148] N Texture The number of new textures generated by splicing in the simple model representing the spatial data model;
[0149] width i The width of the i-th texture in the simple model representing the spatial data model to generate a new texture;
[0150] Size Pixel Represents the storage space occupied by a unit pixel in the tile target storage computer system.
[0151] like Figure 6 As shown, a method for generating and updating a multi-level tile structure of a massive spatial data model, wherein the specific steps of generating a tile forest snapshot are:
[0152] Initialize the snapshot mapping environment: create an orthographic projection camera, input the model view matrix and projection matrix, build a rendering window, and initialize the color template and depth template of the rendering window;
[0153] Extract tile forests for snapshot mapping: According to the regular grid size and spatial data model density, extract all levels of branch nodes of multiple adjacent grid tile trees as tile forests, normalize the vertex coordinates of all branch nodes in the tile forests according to the range of the tile forests, and then render them in the snapshot mapping environment;
[0154] Generate a tile forest node: extract the depth texture from the depth template of the rendering window, evenly take points in the rendering window, calculate the vertex coordinates and texture coordinates and store them in the skeleton information of the tile forest node, and extract the color texture from the color template of the rendering window and store it in the texture information of the tile forest node.
[0155] like Figure 7 As shown, a method for generating and updating a multi-level tile structure of a massive spatial data model, wherein the specific steps of generating a tile forest node are as follows;
[0156] Generate skeleton information of tile forest nodes: After rendering is completed, evenly select points in the rendering window according to the range of the tile forest, calculate the first two dimensions of vertex coordinates and texture coordinates and store them in the skeleton information of the tile forest node, extract the depth texture from the depth template of the rendering window, extract the corresponding depth value from the depth texture according to the first two dimensions of the vertex coordinates, and calculate the third dimension of the vertex coordinates and store it in the skeleton information of the tile forest node. The formula for calculating the third dimension of the vertex coordinates of the tile forest node from the depth value is:
[0157]
[0158] Where:
[0159] z new Represents the third z value of the vertex coordinates of the tile forest node;
[0160] Depth represents the depth value extracted from the depth texture;
[0161] z far Represents the z value of the orthographic projection camera at the far clipping plane;
[0162] z near Represents the z value of the orthographic projection camera at the near clipping plane;
[0163] z max Represents the maximum value of the vertex coordinate z of all branch nodes in the tile forest;
[0164] z min Represents the minimum value of the vertex coordinate z of all branch nodes in the tile forest;
[0165] Generate texture information of tile forest node: extract color texture from the color template of the rendering window and store it in the texture information of the tile forest node, and set the association relationship between the material and color texture in the skeleton information of the tile forest node.
[0166] like Figure 8 As shown, a method for generating and updating a multi-level tile structure of a massive spatial data model, wherein the specific steps of updating the multi-level tile structure are:
[0167] Update grid tile tree: determine whether the tile trees in each grid in the area need to be updated, and classify the categories of tile trees in the grids that need to be updated according to deletion and addition. When it is determined that the tile tree in this grid needs to be deleted and updated, remove the simple model of the spatial data model to be deleted from the leaf node of the next level corresponding to the level of the spatial data model to be deleted, and remove the spatial data model to be deleted from the branch nodes of the same level of the spatial data model to be deleted. When it is determined that the tile tree in this grid needs to be added and updated, add the simple model of the spatial data model to be added from the leaf node of the next level corresponding to the level of the spatial data model to be added, add the spatial data model to be added from the branch nodes of the same level corresponding to the level of the spatial data model to be added, and update the texture sharing library;
[0168] Update tile forest snapshot: re-map the grid tile tree that is determined to be updated according to the steps of generating tile forest snapshot to generate a new tile forest node to replace the original tile forest node.
[0169] like Fig. 9 As shown, a method for generating and updating a multi-level tile structure of a massive spatial data model, wherein the specific steps of updating the grid tile tree are:
[0170] Determine the update category of the grid tile tree: compare the spatial data model to be updated with the existing grid tile tree, determine whether the tile trees in each grid in the area need to be updated, and classify the categories of the tile trees in the grids that need to be updated according to deletion and addition;
[0171] Deleting and updating the grid tile tree nodes: when it is determined that the tile tree within the grid needs to be deleted and updated, the grid code and model level of the spatial data model to be deleted are obtained from the cache of the spatial data model code, the grid code, and the level code of the spatial data model through the spatial data model code, and the simple model of the spatial data model to be deleted is removed from the leaf node of the next level of the spatial data model to be deleted in the grid tile tree corresponding to the grid code of the spatial data model to be deleted; the spatial data model to be deleted is removed from the branch nodes of the same level of the spatial data model to be deleted in the grid tile tree corresponding to the grid code of the spatial data model to be deleted, and the number of times the texture of the spatial data model to be deleted in the texture sharing library corresponds to the number of times the spatial data model is used;
[0172] Add and update the grid tile tree nodes: when it is determined that the tile book within the grid needs to be added and updated, preprocess the spatial data model to be added according to the spatial data model preprocessing step, generate a simplified model for the spatial data model to be added according to the simplified model step of generating the spatial data model of each level of the grid, add the simplified model of the spatial data model to be added from the leaf node of the next level corresponding to the level of the spatial data model to be added in the grid tile tree corresponding to the grid code of the spatial data model to be added, and add the spatial data model to be added from the branch node of the same level corresponding to the level of the spatial data model to be added in the grid tile tree corresponding to the grid code of the spatial data model to be added;
[0173] Update the texture sharing library: remove the textures that have been used 0 times by the spatial data model, and merge the newly added textures in the texture sharing library according to the texture merging step to generate new textures with transparent channels and new textures without transparent channels, and store the corresponding texture matrices in the texture sharing library.
[0174] The following is an example of a specific implementation:
[0175] This method processes the spatial model data. This method can generate a multi-level tile structure with hierarchical node details ranging from simple to complex, and hierarchical scheduling strategies compatible with new addition and replacement methods for massive building model data, and on this basis support local updates of building models.
[0176] First, the grid space data model is prepared. The grid size is calculated by the distribution density rule of massive building model data, the grid is divided and encoded according to the coordinate reference of the building model, and the grid window template is constructed to extract the building model. The building model in the grid is checked and corrected, and the textures of each level of the building model are stretched and copied and spliced one by one. The standardized textures of each level and the corresponding number of times used by each building model are stored in the texture sharing library, the level number of the building model in the grid is calculated, and the building model code, grid code, and level code of the building model are recorded and cached.
[0177] Secondly, generate a grid tile tree. Compress and mix the standardized textures of each level of the building model, shrink the triangular faces of the building model, splice the textures of the building models of the same level in the grid to generate simple models of the building models of each level in the grid, reorganize the building models of each level in the grid to generate leaf nodes of the corresponding level and set the scheduling strategy and spatial error threshold, reorganize the simple models of the building models of each level in the grid to generate the upper-level branch nodes of the corresponding level and set the scheduling strategy, spatial error threshold and the association relationship with the leaf nodes of the corresponding level generated by the reorganization, and merge the textures of the texture sharing library.
[0178] Again, a snapshot of the tile forest is created. An orthographic projection camera is created, a rendering window is constructed, the color template and depth template of the rendering window are initialized, and the branches and trunk nodes of all levels of multiple adjacent grid tile trees are extracted as tile forests for rendering in the snapshot mapping environment. The depth texture is extracted from the depth template of the rendering window, the vertex coordinates and texture coordinates are calculated and stored in the skeleton information of the tile forest node, and the color texture is extracted from the color template of the rendering window and stored in the texture information of the tile forest node.
[0179] Finally, the multi-level tile structure is updated. The update category of the grid tile tree is determined. When it is determined that the tile tree in this grid needs to be deleted and updated, the simple model of the building model to be deleted is removed from the leaf node of the next level corresponding to the level of the building model to be deleted, and the building model to be deleted is removed from the branch node of the same level corresponding to the level of the building model to be deleted. When it is determined that the tile tree in this grid needs to be added and updated, the simple model of the building model to be added is added from the leaf node of the next level corresponding to the level of the building model to be added, and the building model to be added is added from the branch node of the same level corresponding to the level of the building model to be added, the texture sharing library is updated, and the tile forest snapshot is updated.
[0180] In a specific implementation case, the steps of preparing the grid space data model may be:
[0181] 1. Construct a grid window template to extract the spatial data model: According to the density calculation rule grid size of the building model, divide the grid according to the coordinate reference of the building model and encode the grid to obtain the grid code, obtain the covered grid set according to the range of the building model, construct each grid in the set as a grid window template, and extract the building model whose center point of the building model outsourcing range is within the window template;
[0182] 2. Check and correct the geometric information of the spatial data model: Check the building model. When it is determined that the number of vertices of the vertex normal coordinates, the number of vertices of the vertex color coordinates, and the number of vertices of the texture coordinates of each level of texture are not equal to the number of vertices of the vertex coordinates and are not zero, correct the building model, recalculate the vertex index of the building model, and regard two vertices whose vertex coordinates have a distance less than a threshold as the same vertex;
[0183] 3. Standardization of textures at all levels: Get the size of the original textures at all levels of the building model (named Texture00, Texture01, Texture02, etc. in this case), stretch the width and height of a single texture to the nearest power of 2 of the original width and height of the single texture, copy and splice the stretched texture to generate a new texture (named Texture10, Texture11, Texture12, etc. in this case), and the width and height of the new texture are the maximum values of the stretched width and height, and repeatedly process the single texture until all the textures at all levels of the building model are standardized and the process ends; store the standardized textures at all levels and the corresponding number of times used by the building model in the texture sharing library for processing;
[0184] 4. Spatial data model classification: Calculate the level threshold of the grid tile according to the density of the building model in the grid, count the outsourcing range of all building models in the grid, calculate the level number of the building model, record the building model code, grid code, and level code of the building model and cache them; the formula for calculating the level number of the building model is:
[0185] Level Model =floor(log Threshold (max(x max -x min ,y max -y min )))
[0186] Where:
[0187] Level Model Represents the level number of the building model;
[0188] Threshold represents the level threshold of the grid tile;
[0189] x min 、x max Represents the minimum and maximum values of the x-direction of the outer bounds of the building model;
[0190] y min ,y max Represents the minimum and maximum values of the building model's enclosing range in the y direction.
[0191] In the specific implementation case, the steps of generating the grid tile tree may be:
[0192] 1. Generate a simple model of the spatial data model at each level of the grid: compress the standardized textures of each level of the building model (named Texture10, Texture11, Texture12, etc. in this case) to generate new textures (named Texture20, Texture21, Texture22, etc. in this case), and then mix them to generate new textures (named Texture30, Texture31, Texture32, etc. in this case) and the corresponding two-dimensional texture coordinates. According to the texture color mean threshold, the triangular faces of the building model are shrunk to obtain a new set of triangular faces and stored in the simple model of the building model. The building models at the same level in the grid are textured and spliced to generate new textures (named Texture40, Texture41, Texture42, etc. in this case) and the texture matrices corresponding to them are stored in the simple model of the building model.
[0193] 2. Generate nodes at each level of the grid tile tree: call up the building models at each level in the grid, reorganize the building models at the same level to generate leaf nodes at the corresponding level, set the scheduling strategy and spatial error threshold for reorganizing and generating leaf nodes at the corresponding level, call up the simple models of the building models at each level in the grid, reorganize the simple models of the building models at the same level to generate the upper-level branch nodes at the corresponding level, set the scheduling strategy, spatial error threshold and the association relationship with the reorganized leaf nodes at the corresponding level;
[0194] 3. Texture merging in the texture sharing library: extract the standardized textures of each level in the texture sharing library, and merge the textures that have been used more than once by the building model according to the number of times they are used by the building model and whether they contain transparent channels, to generate new textures with transparent channels and new textures without transparent channels. At the same time, generate a one-to-one corresponding texture matrix for the merged new textures with transparent channels and new textures without transparent channels, and store the merged new textures with transparent channels and new textures without transparent channels and the texture matrix in the texture sharing library.
[0195] In the specific implementation case, the steps of generating the simple model of the building model at each level of the grid can be specifically as follows:
[0196] (1) Texture compression and mixing: The standardized textures of each level of the building model (named Texture10, Texture11, Texture12, etc. in this case) are compressed to generate new textures (named Texture20, Texture21, Texture22, etc. in this case), and the width and height of the new textures are half of the width and height of the standardized textures. According to the texture coordinates corresponding to the textures of different levels, the compressed textures of different levels (named Texture20, Texture21, Texture22, etc. in this case) are mixed to generate new textures (named Texture30, Texture31, Texture32, etc. in this case) and the corresponding texture coordinates of two dimensions;
[0197] (2) Triangle face contraction based on texture color mean: The texture color mean of each triangle face of the building model is calculated based on the new texture generated by mixing (named Texture30, Texture31, Texture32, etc. in this case) and the corresponding two-dimensional texture coordinates. The texture color mean threshold is calculated based on the geometric simplification rate of the building model. It is determined whether the difference between the texture color means of two adjacent triangle faces is less than the texture color mean threshold. The two adjacent triangle faces whose texture color mean difference is less than the texture color mean threshold are contracted to generate a new triangle face. The vertex indexes of the two contracted vertices of the building model in other adjacent triangles are updated. The triangle face contraction is repeated in a cycle to obtain a new triangle face set and a vertex index set, which are stored in the simplified model of the building model. The formula for contracting two adjacent triangle faces to generate a new triangle face is:
[0198]
[0199] Where:
[0200] Distance min Represents the shortest distance between the four vertices of two adjacent triangles;
[0201] x A ,y A 、z A Represents the coordinate value of the vertex coordinates of the first vertices of two adjacent triangles;
[0202] x B ,y B , z BRepresents the coordinate value of the vertex coordinates of the second vertices of two adjacent triangles;
[0203] x C ,y C , z C Represents the coordinate value of the vertex coordinates of the third vertex of two adjacent triangles;
[0204] x D ,y D , z D Represents the coordinate value of the fourth vertex of two adjacent triangles;
[0205] x1, y1, z1 represent the coordinate values of the vertex coordinates of the first vertex of the new triangle generated by contraction;
[0206] x2, y2, z2 represent the coordinate values of the vertex coordinates of the second vertex of the new triangle generated by contraction;
[0207] x3, y3, z3 represent the coordinate values of the vertex coordinates of the second vertex of the new triangle generated by contraction;
[0208] (3) Texture stitching: Splice the mixed textures (named Texture30, Texture31, Texture32, etc. in this case) of the building models at the same level in the grid to generate new textures (named Texture40, Texture41, Texture42, etc. in this case), and generate a texture matrix corresponding to each of the mixed new textures (named Texture30, Texture31, Texture32, etc. in this case), store the spliced new textures (named Texture40, Texture41, Texture42, etc. in this case) in the simple model of the building model, and store the texture matrix in the third dimension of the texture coordinates of the corresponding simple model of the building model, where the formula for the texture matrix to calculate the third dimension of the texture coordinates is:
[0209] Texcoord w =(-log2 s)<<16+t1×256+t2
[0210] Where:
[0211] Matrix Texture Represents the texture matrix;
[0212] s represents the scaling amount of the texture matrix;
[0213] t1 represents the translation of the texture matrix in the first dimension u direction of the texture coordinates;
[0214] t2 represents the translation of the texture matrix in the second dimension v direction of the texture coordinates;
[0215] Texcoord w Represents the third dimension w value of the texture coordinate.
[0216] In a specific implementation case, the steps of generating nodes at each level of the grid tile tree may be specifically as follows:
[0217] (1) Generate leaf nodes at each level of the grid tile tree: retrieve building models at each level in the grid, calculate the amount of geometric information data of the building models, compare the amount of geometric information data of the building models at the same level with the leaf node threshold, and determine that when the amount of geometric information data of the building models at the same level is less than the leaf node threshold, reorganize the building models at the same level to generate leaf nodes at the corresponding level, and then recycle and compare the amount of geometric information data of the building models at the same level with the leaf node threshold until all the building models at the same level are reorganized to generate leaf nodes at the corresponding level, then stop the cycle and enter the next step; set the scheduling strategy of the leaf nodes at the corresponding level to the new addition mode, calculate the spatial error threshold of the leaf nodes at the corresponding level according to the outsourcing scope and level number of the leaf nodes at the corresponding level, and store it in the leaf nodes at the corresponding level; wherein the formula for calculating the amount of geometric information data of the building model is:
[0218] Size Geometry =Number Vertex ×10×Size float +Number Index ×Size int
[0219] Where:
[0220] Size Geometry The amount of geometric information data representing the building model;
[0221] Number Vertex The number of vertices representing the vertex coordinates of the building model;
[0222] Size float Represents the unit storage space occupied by float type data in the tile target storage computer system;
[0223] Number Index The number of vertices representing the vertex index of the building model;
[0224] Size int Represents the unit storage space occupied by int type data in the tile target storage computer system;
[0225] (2) Generate branch nodes at each level of the grid tile tree: retrieve the simple models of the building models at each level in the grid, calculate the texture information data volume of the simple models of the building models, compare the texture information data volume of the simple models of the building models at the same level with the branch node threshold, and determine that when the texture information data volume of the building models at the same level is less than the branch node threshold, reorganize the simple models of the building models at the same level to generate the branch nodes of the previous level at the corresponding level, and then cyclically compare the texture information data volume of the simple models of the building models at the same level with the branch node threshold until all the simple models of the building models at the same level are reorganized and generated. When the previous level branch node of the corresponding level is generated, the loop is stopped and the next step is entered; the scheduling strategy of the previous level branch node of the corresponding level is set to the replacement mode, and the spatial error threshold of the previous level branch node of the corresponding level is calculated according to the outsourcing scope and level number of the previous level branch node of the corresponding level and stored in the previous level branch node of the corresponding level, and the association relationship between the previous level branch node of the corresponding level and the leaf node of the corresponding level is stored in the previous level branch node of the corresponding level; the formula for calculating the texture information data volume of the simple model of the building model is:
[0226]
[0227] Where:
[0228] Size Texture The amount of texture information data representing the simple model of the building model;
[0229] N Texture The number of new textures (named Texture40, Texture41, Texture42, etc. in this case) generated by splicing in the simple model of the building model;
[0230] width i Represents the width of the i-th texture generated by splicing new textures (named Texture40, Texture41, Texture42, etc. in this case) in the simple model of the building model;
[0231] Size Pixel Represents the storage space occupied by a unit pixel in the tile target storage computer system.
[0232] In the specific implementation case, the steps of generating a snapshot of a tile forest may be as follows:
[0233] 1. Initialize the snapshot mapping environment: create an orthographic projection camera, input the model view matrix and projection matrix, build a rendering window, and initialize the color template and depth template of the rendering window;
[0234] 2. Extract tile forests for snapshot mapping: According to the regular grid size and building model density, extract all levels of branch nodes of multiple adjacent grid tile trees as tile forests. According to the range of the tile forest, normalize the vertex coordinates of all branch nodes in the tile forest and render them in the snapshot mapping environment.
[0235] 3. Generate a tile forest node: extract the depth texture from the depth template of the rendering window, evenly take points in the rendering window, calculate the vertex coordinates and texture coordinates and store them in the skeleton information of the tile forest node, and extract the color texture from the color template of the rendering window and store it in the texture information of the tile forest node.
[0236] In the specific implementation case, the steps of generating a tile forest node may be:
[0237] (1) Generate skeleton information of tile forest nodes: After rendering is completed, evenly select points in the rendering window according to the range of the tile forest, calculate the first two dimensions of the vertex coordinates and the texture coordinates and store them in the skeleton information of the tile forest node, extract the depth texture from the depth template of the rendering window, extract the corresponding depth value from the depth texture according to the first two dimensions of the vertex coordinates, and calculate the third dimension of the vertex coordinates and store it in the skeleton information of the tile forest node. The formula for calculating the third dimension of the vertex coordinates of the tile forest node by the depth value is:
[0238]
[0239] Where:
[0240] z new Represents the third z value of the vertex coordinates of the tile forest node;
[0241] Depth represents the depth value extracted from the depth texture;
[0242] z far Represents the z value of the orthographic projection camera at the far clipping plane;
[0243] z near Represents the z value of the orthographic projection camera at the near clipping plane;
[0244] z max Represents the maximum value of the vertex coordinate z of all branch nodes in the tile forest;
[0245] z min Represents the minimum value of the vertex coordinate z of all branch nodes in the tile forest;
[0246] (2) Generate texture information of the tile forest node: extract the color texture from the color template of the rendering window and store it in the texture information of the tile forest node, and set the association relationship between the material and the color texture in the skeleton information of the tile forest node.
[0247] In a specific implementation case, the steps of updating the multi-level tile structure may be specifically as follows:
[0248] 1. Update the grid tile tree: determine whether the tile trees in each grid in the area need to be updated, and classify the categories of the tile trees in the grids that need to be updated according to deletion and addition. When it is determined that the tile tree in this grid needs to be deleted and updated, remove the simple model of the building model to be deleted from the leaf node of the next level corresponding to the level of the building model to be deleted, and remove the building model to be deleted from the branch node of the same level corresponding to the level of the building model to be deleted. When it is determined that the tile tree in this grid needs to be added and updated, add the simple model of the building model to be added from the leaf node of the next level corresponding to the level of the building model to be added, add the building model to be added from the branch node of the same level corresponding to the level of the building model to be added, and update the texture sharing library;
[0249] 2. Update tile forest snapshot: Re-map the snapshot of the grid tile tree that is determined to be updated according to the steps of generating tile forest snapshot to generate a new tile forest node to replace the original tile forest node.
[0250] In the specific implementation case, the steps of updating the grid tile tree may be:
[0251] (1) Determine the update category of the grid tile tree: compare the building model to be updated with the existing grid tile tree to determine whether the tile tree in each grid in the area needs to be updated, and classify the tile tree in the grid that needs to be updated into the categories of deletion and addition;
[0252] (2) Deleting and updating the grid tile tree nodes: When it is determined that the tile tree within the grid needs to be deleted and updated, the grid code and model level of the building model to be deleted are obtained from the cache of the building model code, the grid code, and the level code of the building model through the building model code, and the simple model of the building model to be deleted is removed from the leaf node of the next level of the building model to be deleted in the grid tile tree corresponding to the grid code of the building model to be deleted; the building model to be deleted is removed from the branch node of the same level of the building model to be deleted in the grid tile tree corresponding to the grid code of the building model to be deleted, and the number of times the texture of the building model to be deleted in the texture sharing library corresponds to the usage of the building model;
[0253] (3) Adding and updating the grid tile tree nodes: When it is determined that the tile book in the grid needs to be added and updated, the building model to be added is preprocessed according to the building model preprocessing step, and a simplified model of the building model to be added is generated according to the simplified model step of generating the building models of each level of the grid, and the simplified model of the building model to be added is added from the leaf node of the next level corresponding to the level of the building model to be added in the grid tile tree corresponding to the grid code of the building model to be added, and the building model to be added is added from the branch node of the same level corresponding to the level of the building model to be added in the grid tile tree corresponding to the grid code of the building model to be added;
[0254] (4) Update the texture sharing library: remove the textures that have been used 0 times by the building model, and merge the newly added textures in the texture sharing library according to the texture merging step to generate new textures with transparent channels and new textures without transparent channels, and store the corresponding texture matrices in the texture sharing library.
[0255] The foregoing method descriptions and flow charts are provided only as illustrative examples and are not intended to require or imply that the above operations or steps of various aspects must be performed in the order given. As will be appreciated by those skilled in the art, the order of the boxes in the foregoing aspects may be performed in any order. Words such as "thereafter," "then," "next," and the like are not intended to limit the order of operations or steps; these words are only used to guide the reader through the description of the method. In addition, any singular reference to a claim element, for example, the use of the article "a," "an," or "the" is not to be construed as limiting the element to the singular.
[0256] The various illustrative logic blocks, modules, circuits, and algorithm steps described in conjunction with the aspects disclosed herein can all be implemented as electronic hardware, computer software, or a combination thereof. In order to clearly represent the interchangeability between hardware and software, the various illustrative components, blocks, modules, circuits, and steps are generally described above around their functions. Whether such functions are implemented as hardware or software depends on the specific application and the design constraints imposed on the entire method. A skilled person can implement the described functions in an alternative manner for each specific application, but such implementation decisions should not be interpreted as causing a departure from the scope of protection of the present invention.
[0257] The method in the embodiment of the present invention uses a multi-level tile structure to effectively solve the hierarchical and efficient rendering problem of massive spatial data models, and can support the updating of spatial data models and improve the efficiency of tile use; texture sharing within the entire data range is achieved through a texture sharing library, which can greatly reduce the texture information of the tile structure; the simplification of the spatial data model by a triangular face contraction algorithm based on the texture color mean can not only quickly generate a simplified model, but also effectively avoid the problem of missing faces of the simplified model; the texture matrix is stored in the third dimension of the simplified model texture coordinates through texture splicing, which can effectively solve the problem that textures with repeated texture coordinates cannot be merged or need to be copied multiple times when merged, resulting in reduced resolution; each level of the tile tree is composed of leaf nodes with a scheduling strategy of adding a new mode and a branch structure with a scheduling strategy of replacing a mode, which not only retains the advantages of gradually loading and refining spatial data models of different granularities when the camera viewpoint is from far to near, but also effectively reduces the amount of tile data; the use of tile forest snapshots can greatly speed up the rendering efficiency of the spatial data model when the camera viewpoint is far away when loading a large range of massive spatial data models.
[0258] The foregoing description of the disclosed aspects is provided to enable any person skilled in the art to implement or use the present invention. Various modifications to these aspects will be apparent to those skilled in the art, and the general principles defined herein may also be applied to other embodiments without departing from the spirit and scope of the present invention. Therefore, the present invention is not intended to be limited to the aspects provided herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for generating and updating a multi-level tile structure of a massive spatial data model, characterized in that The method comprises the following steps: preparing a grid spatial data model: determining the grid size according to the density operation rule of spatial data, dividing the grid according to the coordinate reference of spatial data and encoding the grid, constructing a grid window template to extract the spatial data model, checking and correcting the spatial data model in the grid, performing standardized processing of stretching and copying and splicing each level texture of the spatial data model one by one, and storing the standardized textures of each level and the corresponding number of times used by the spatial data model in a texture sharing library, calculating the level number of the spatial data model in the grid, recording and caching the spatial data model code, the grid code, and the level code of the spatial data model; Generate a grid tile tree: compress and mix the textures of each level of the standardized spatial data model, shrink the triangular faces of the spatial data model, splice the textures of the spatial data models at the same level in the grid to generate simple models of the spatial data models at each level of the grid, reorganize the spatial data models at each level in the grid to generate leaf nodes at the corresponding level and set the scheduling strategy and spatial error threshold, reorganize the simple models of the spatial data models at each level in the grid to generate the upper-level branch nodes at the corresponding level and set the scheduling strategy, spatial error threshold and the association relationship with the reorganized leaf nodes at the corresponding level, and merge the textures of the texture sharing library; Generate a snapshot of the tile forest: create an orthographic projection camera, build a rendering window, initialize the color template and depth template of the rendering window, extract the branch nodes of all levels of multiple adjacent grid tile trees as tile forests for rendering in the snapshot mapping environment, and extract the depth template of the rendering window from the depth of the rendering window. Extract the depth texture from the template, calculate the vertex coordinates and texture coordinates and store them in the skeleton information of the tile forest node, extract the color texture from the color template of the rendering window and store it in the texture information of the tile forest node; update the multi-level tile structure: determine the update category of the grid tile tree, when it is determined that the tile tree within this grid needs to be deleted and updated, remove the simple model of the spatial data model to be deleted from the next level leaf node of the corresponding level of the spatial data model to be deleted, remove the spatial data model to be deleted from the branch node of the same level of the spatial data model to be deleted, when it is determined that the tile book within this grid needs to be added and updated, add the simple model of the spatial data model to be added from the next level leaf node of the corresponding level of the spatial data model to be added, add the spatial data model to be added from the branch node of the same level of the spatial data model to be added, update the texture sharing library, and update the tile forest snapshot.
2. The method for generating and updating a multi-level tile structure of a massive spatial data model according to claim 1, characterized in that: The specific steps of preparing the grid space data model are: Construct a grid window template to extract the spatial data model: Use the density calculation rule grid size of the spatial data, divide the grid according to the coordinate reference of the spatial data and encode the grid to obtain the grid code, obtain the covered grid set according to the range of the spatial data model, construct each grid in the set as a grid window template, and extract the spatial data model whose center point of the outsourcing range of the spatial data model is within the window template; Check and correct the geometric information of the spatial data model: Check the spatial data model. When it is determined that one or more of the number of vertices of the vertex normal coordinates, the number of vertices of the vertex color coordinates, and the number of vertices of the texture coordinates of each level of texture are not equal to the number of vertices of the vertex coordinates and are not zero, correct the spatial data model, recalculate the vertex index of the spatial data model, and regard two vertices whose vertex coordinates have a distance less than a threshold as the same vertex; Standardization of textures at all levels: Obtain the size of textures at all levels of the spatial data model, stretch the width and height of a single texture to the nearest power of 2 of the original width and height of the single texture, copy and splice the stretched texture to generate a new texture, and the width and height of the new texture are the maximum values of the stretched width and height, and repeatedly process the single texture until all textures at all levels of the spatial data model are standardized and the process ends; store the standardized textures at all levels and the corresponding number of times used by the spatial data model in the texture sharing library for processing; Spatial data model classification: Calculate the level threshold of the grid tile according to the density of spatial data in the grid, count the outsourcing range of all spatial data models in the grid, calculate the level number of the spatial data model, record the spatial data model code, grid code, and level code of the spatial data model and cache them; the formula for calculating the level number of the spatial data model is: Level Model =floor(log Threshold (max(x max -x min ,y max -y min ))) Where: Level Model Represents the level number of the spatial data model; Threshold represents the level threshold of the grid tile; x min 、x max Represents the minimum and maximum values of the x-direction of the outer bounds of the spatial data model; y min ,y max Represents the minimum and maximum values in the y direction of the outer range of the spatial data model.
3. The method for generating and updating a multi-level tile structure of a massive spatial data model according to claim 1, characterized in that: The specific steps of generating the grid tile tree are: Generate a simple model of the spatial data model at each level of the grid: compress and mix the textures of each level of the spatial data model after standardization to generate a new texture and the corresponding two-dimensional texture coordinates, shrink the triangular faces of the spatial data model according to the texture color mean threshold to obtain a new set of triangular faces and store them in the simple model of the spatial data model, perform texture splicing on the spatial data models of the same level in the grid to generate a new texture and a texture matrix corresponding to each of them and store them in the simple model of the spatial data model; Generate nodes at each level of the grid tile tree: call the spatial data models at each level in the grid, reorganize the spatial data models at the same level to generate leaf nodes at the corresponding level, set the scheduling strategy and spatial error threshold for the reorganized leaf nodes at the corresponding level, call the simplified models of the spatial data models at each level in the grid, reorganize the simplified models of the spatial data models at the same level to generate the upper-level branch nodes at the corresponding level, set the scheduling strategy, spatial error threshold and the association relationship with the reorganized leaf nodes at the corresponding level; Texture merging in the texture sharing library: extracting the standardized textures of each level in the texture sharing library, merging the textures that have been used more than once by the spatial data model according to the number of times they have been used by the spatial data model and whether they contain transparent channels, generating new textures with transparent channels and new textures without transparent channels; generating one-to-one corresponding texture matrices for the merged new textures with transparent channels and new textures without transparent channels, and storing the merged new textures with transparent channels and new textures without transparent channels and the texture matrices in the texture sharing library.
4. The method for generating and updating a multi-level tile structure of a massive spatial data model according to claim 3, characterized in that: The specific steps of generating the simplified model of the spatial data model of each level of the grid are: Texture compression and mixing: compress the textures of each level after the normalization of the spatial data model to generate a new texture, and the width and height of the new texture are half of the width and height of the normalized texture. According to the texture coordinates corresponding to the textures of different levels, the new textures generated by compression of different levels are mixed to generate a new texture and the corresponding texture coordinates of two dimensions; Triangular face contraction based on texture color mean: calculate the texture color mean of each triangular face of the spatial data model according to the new texture generated by mixing and the corresponding texture coordinates of the two dimensions, calculate the texture color mean threshold according to the geometric simplification rate of the spatial data model, determine whether the difference between the texture color means of two adjacent triangular faces is less than the texture color mean threshold, contract the two adjacent triangular faces whose texture color mean difference is less than the texture color mean threshold to generate a new triangular face, update the vertex indexes of the two contracted vertices of the spatial data model in other adjacent triangles, repeatedly contract the triangular faces to obtain a new set of triangular faces and a set of vertex indices and store them in the simplified model of the spatial data model; the formula for contracting two adjacent triangular faces to generate a new triangular face is: Where: Distance min Represents the shortest distance between the four vertices of two adjacent triangles; x A ,y A 、z A Represents the coordinate value of the vertex coordinates of the first vertices of two adjacent triangles; x B ,y B , z B Represents the coordinate value of the vertex coordinates of the second vertices of two adjacent triangles; x C ,y C , z C Represents the coordinate value of the vertex coordinates of the third vertex of two adjacent triangles; x D ,y D , z D Represents the coordinate value of the fourth vertex of two adjacent triangles; x1, y1, z1 represent the coordinate values of the vertex coordinates of the first vertex of the new triangle generated by contraction; x2, y2, z2 represent the coordinate values of the vertex coordinates of the second vertex of the new triangle generated by contraction; x3, y3, z3 represent the coordinate values of the vertex coordinates of the second vertex of the new triangle generated by contraction; Texture splicing: Splice the new texture generated by mixing the spatial data models at the same level in the grid to generate a new texture, and generate a texture matrix corresponding to each of the new textures generated by the mixture, store the new texture generated by the splicing in the simple model of the spatial data model, and store the texture matrix in the third dimension of the texture coordinates of the simple model of the corresponding spatial data model, where the formula for the texture matrix to calculate the third dimension of the texture coordinates is: Texcoord w =(-log2 s)<<16+t1×256+t2 Where: Matrix Texture Represents the texture matrix; s represents the scaling amount of the texture matrix; t1 represents the translation of the texture matrix in the first dimension u direction of the texture coordinates; t2 represents the translation of the texture matrix in the second dimension v direction of the texture coordinates; Texcoord w Represents the third dimension w value of the texture coordinate.
5. The method for generating and updating a multi-level tile structure of a massive spatial data model according to claim 3, characterized in that: The specific steps of generating nodes at each level of the grid tile tree are: Generate leaf nodes at each level of the grid tile tree: call the spatial data models at each level in the grid, calculate the geometric information data volume of the spatial data model, compare the geometric information data volume of the spatial data model at the same level with the leaf node threshold, and determine that when the geometric information data volume of the spatial data model at the same level is less than the leaf node threshold, reorganize the spatial data model at the same level to generate leaf nodes at the corresponding level, and then recycle and compare the geometric information data volume of the spatial data model at the same level with the leaf node threshold until all the spatial data models at the same level are reorganized to generate leaf nodes at the corresponding level, then stop the cycle and enter the next step; set the scheduling strategy of the leaf nodes at the corresponding level to be newly added, and calculate the spatial error threshold of the leaf nodes at the corresponding level according to the outsourcing scope and level number of the leaf nodes at the corresponding level, and store it in the leaf nodes at the corresponding level; the formula for calculating the geometric information data volume of the spatial data model is: Size Geometry =Number Vertex ×10×Size float +Number Index ×Size int Where: Size Geometry The amount of geometric information data representing the spatial data model; Number Vertex The number of vertices representing the vertex coordinates of the spatial data model; Size float Represents the unit storage space occupied by float type data in the tile target storage computer system; Number Index The number of vertices representing the vertex index of the spatial data model; Size int Represents the unit storage space occupied by int type data in the tile target storage computer system; Generate branch nodes at each level of the grid tile tree: call the simple model of the spatial data model at each level in the grid, calculate the texture information data volume of the simple model of the spatial data model, compare the texture information data volume of the simple model of the spatial data model at the same level with the branch node threshold, and determine that when the texture information data volume of the spatial data model at the same level is less than the branch node threshold, reorganize the simple model of the spatial data model at the same level to generate the upper-level branch node of the corresponding level, and then cyclically compare the texture information data volume of the simple model of the spatial data model at the same level with the branch node threshold until all the simple models of the spatial data model at the same level are completed. When the previous level branch node of the corresponding level is reorganized and generated, the loop is stopped and the next step is entered; the scheduling strategy of the previous level branch node of the corresponding level is set to the replacement mode, and the spatial error threshold of the previous level branch node of the corresponding level is calculated according to the outsourcing scope and level number of the previous level branch node of the corresponding level and stored in the previous level branch node of the corresponding level, and the association relationship between the previous level branch node of the corresponding level and the leaf node of the corresponding level is stored in the previous level branch node of the corresponding level; wherein the formula for calculating the texture information data volume of the simple model of the spatial data model is: Where: Size Texture The amount of texture information data of the simple model representing the spatial data model; N Texture The number of new textures generated by splicing in the simple model representing the spatial data model; width i The width of the i-th texture in the simple model representing the spatial data model to generate a new texture; Size Pixel Represents the storage space occupied by a unit pixel in the tile target storage computer system.
6. The method for generating and updating a multi-level tile structure of a massive spatial data model according to claim 1, characterized in that: The specific steps of generating a tile forest snapshot are: Initialize the snapshot mapping environment: create an orthographic projection camera, input the model view matrix and projection matrix, build a rendering window, and initialize the color template and depth template of the rendering window; Extract tile forests for snapshot mapping: According to the regular grid size and spatial data model density, extract all levels of branch nodes of multiple adjacent grid tile trees as tile forests, normalize the vertex coordinates of all branch nodes in the tile forests according to the range of the tile forests, and then render them in the snapshot mapping environment; Generate a tile forest node: extract the depth texture from the depth template of the rendering window, evenly take points in the rendering window, calculate the vertex coordinates and texture coordinates and store them in the skeleton information of the tile forest node, and extract the color texture from the color template of the rendering window and store it in the texture information of the tile forest node.
7. The method for generating and updating a multi-level tile structure of a massive spatial data model according to claim 6, characterized in that: The specific steps of generating tile forest nodes are: Generate skeleton information of tile forest nodes: After rendering is completed, evenly select points in the rendering window according to the range of the tile forest, calculate the first two dimensions of vertex coordinates and texture coordinates and store them in the skeleton information of the tile forest node, extract the depth texture from the depth template of the rendering window, extract the corresponding depth value from the depth texture according to the first two dimensions of the vertex coordinates, and calculate the third dimension of the vertex coordinates and store it in the skeleton information of the tile forest node. The formula for calculating the third dimension of the vertex coordinates of the tile forest node from the depth value is: Where: z new Represents the third z value of the vertex coordinates of the tile forest node; Depth represents the depth value extracted from the depth texture; z far Represents the z value of the orthographic projection camera at the far clipping plane; z near Represents the z value of the orthographic projection camera at the near clipping plane; z max Represents the maximum value of the vertex coordinate z of all branch nodes in the tile forest; z min Represents the minimum value of the vertex coordinate z of all branch nodes in the tile forest; Generate texture information of tile forest node: extract color texture from the color template of the rendering window and store it in the texture information of the tile forest node, and set the association relationship between the material and color texture in the skeleton information of the tile forest node.
8. The method for generating and updating a multi-level tile structure of a massive spatial data model according to claim 1, characterized in that: The specific steps of updating the multi-level tile structure are: Update grid tile tree: determine whether the tile trees in each grid in the area need to be updated, and classify the categories of tile trees in the grids that need to be updated according to deletion and addition. When it is determined that the tile tree in this grid needs to be deleted and updated, remove the simple model of the spatial data model to be deleted from the leaf node of the next level corresponding to the level of the spatial data model to be deleted, and remove the spatial data model to be deleted from the branch nodes of the same level of the spatial data model to be deleted. When it is determined that the tile tree in this grid needs to be added and updated, add the simple model of the spatial data model to be added from the leaf node of the next level corresponding to the level of the spatial data model to be added, add the spatial data model to be added from the branch nodes of the same level corresponding to the level of the spatial data model to be added, and update the texture sharing library; Update tile forest snapshot: re-map the grid tile tree that is determined to be updated according to the steps of generating tile forest snapshot to generate a new tile forest node to replace the original tile forest node.
9. The method for generating and updating a multi-level tile structure of a massive spatial data model according to claim 8, characterized in that: The specific steps of updating the grid tile tree are: Determine the update category of the grid tile tree: compare the spatial data model to be updated with the existing grid tile tree, determine whether the tile trees in each grid in the area need to be updated, and classify the categories of the tile trees in the grids that need to be updated according to deletion and addition; Deleting and updating the grid tile tree nodes: when it is determined that the tile tree within the grid needs to be deleted and updated, the grid code and model level of the spatial data model to be deleted are obtained from the cache of the spatial data model code, the grid code, and the level code of the spatial data model through the spatial data model code, and the simple model of the spatial data model to be deleted is removed from the leaf node of the next level of the spatial data model to be deleted in the grid tile tree corresponding to the grid code of the spatial data model to be deleted; Remove the spatial data model to be deleted from the branch nodes at the same level of the spatial data model to be deleted in the grid tile tree corresponding to the grid code of the spatial data model to be deleted, and update the number of times the spatial data model to be deleted is used by the texture corresponding to the spatial data model to be deleted in the texture sharing library; Add and update the grid tile tree nodes: when it is determined that the tile book within the grid needs to be added and updated, preprocess the spatial data model to be added according to the spatial data model preprocessing step, generate a simplified model for the spatial data model to be added according to the simplified model step of generating the spatial data model of each level of the grid, add the simplified model of the spatial data model to be added from the leaf node of the next level corresponding to the level of the spatial data model to be added in the grid tile tree corresponding to the grid code of the spatial data model to be added, and add the spatial data model to be added from the branch node of the same level corresponding to the level of the spatial data model to be added in the grid tile tree corresponding to the grid code of the spatial data model to be added; Update the texture sharing library: remove the textures that have been used 0 times by the spatial data model, and merge the newly added textures in the texture sharing library according to the texture merging step to generate new textures with transparent channels and new textures without transparent channels, and store the corresponding texture matrices in the texture sharing library.