A method for constructing 3DTiles data structures
By combining the schema mechanism and the smallest unit, the problem of unified storage and management of different types of 3D Tiles data in geospatial space is solved, and the data is consistently expressed in the real geographical environment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA AERO GEOPHYSICAL SURVEY & REMOTE SENSING CENT FOR LAND & RESOURCES
- Filing Date
- 2025-03-24
- Publication Date
- 2026-06-16
Smart Images

Figure CN120277165B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of digital 3D model construction technology, specifically to a method for constructing a 3D Tiles data structure. Background Technology
[0002] Currently, the technologies related to 3D Tiles on the market mainly focus on coordinate transformation and format conversion. Some invention patents also focus on efficiently converting model data in different formats (such as SZ-IFC, FBX, SHP, BIM) into 3D Tiles format.
[0003] The published patent CN202311376302.4 discloses a method for converting SZ-IFC to 3D Tiles. This method uses a BIM engine to parse SZ-IFC files, obtains geometric and non-geometric information, maps material texture information onto corresponding triangular faces, calculates the Cartesian coordinates of the model origin in the WGS84 system based on the SZ-IFC project base point coordinate information, constructs a LOD data structure, and outputs the 3D Tiles model organized according to spatial index.
[0004] Patent 202311664485.X discloses a method for converting a 3D model in FBX format to 3D Tiles format. The method involves parsing the FBX file, extracting the 3D model data contained therein, performing coordinate system transformation, optimization and compression on the model data, cutting the optimized 3D model into tiles, generating metadata for each tile, and outputting the generated 3D Tiles data in the form of a file.
[0005] Patent 202410472251.3 discloses a method and device for parametric construction of a three-dimensional borehole model. The method constructs a layered and color-coded attribute SHP table for boreholes based on borehole data source data, performs parametric construction of each borehole based on the SHP table to obtain a borehole model object, and then performs Mesh structure conversion based on the borehole model object and outputs it in 3DTiles format to obtain three-dimensional borehole model data.
[0006] The aforementioned patents demonstrate that different model data can be converted into 3D Tiles format; however, these different model data are not geographically unified and cannot be directly correlated. Therefore, in order to maintain consistent geospatial relationships between different types of data and express them in a real geographical environment, it is necessary to establish a data structure based on 3D Tiles to support the indexing of 3D Tiles data. Summary of the Invention
[0007] To address the shortcomings of existing technologies, this invention provides a method for constructing a 3D Tiles data structure, which achieves unified storage and management of different model data in geospatial space through a schema mechanism and the smallest unit.
[0008] This invention provides the following technical solution:
[0009] A method for constructing a 3D Tiles data structure, comprising:
[0010] S1. Acquire data from different sources and of different types, including vector data, image data, and 3D model data;
[0011] S2. Construct corresponding data storage tables for each type of data, read the information of each type of data, and store the information of each type of data into the corresponding data storage tables.
[0012] S3. Transform the coordinate systems of all types of data to the same coordinate system;
[0013] S4. Export the data of each type after coordinate system transformation as glTF models respectively;
[0014] S5. Construct a 3D Tiles extension data structure consisting of an index file and a data file. Add a schema attribute to the index file and define multiple data types in the schema attribute to record data of the corresponding types. Add a minimum unit attribute field to the root attribute of the index file to record the corresponding data type and attribute value.
[0015] S6. Based on the constructed 3D Tiles extension data structure and glTF models of various data types, the datasets of various types are converted into 3D Tiles format data.
[0016] As a further improvement of the present invention, the vector data includes three types: points, lines, and surfaces, and the data format is SHP;
[0017] The image data is high-resolution satellite remote sensing imagery, and the data format is TIF.
[0018] The three-dimensional model data refers to the data of a model with a three-dimensional shape and appearance constructed by software. The model includes point cloud model, oblique photogrammetry model, BIM model, and individual model. The data formats include LAS, OSGB, OBJ, and 3DS.
[0019] As a further improvement of the present invention, S2 includes:
[0020] S2.1 Create a data file table, a geometric information table, and an attribute information table for vector data and image data respectively; the data file table is used to store the files to be processed, the geometric information table is used to store the geometric information of the data, and the attribute information table is used to store the attribute information of the data.
[0021] S2.2 Create a data file table, a geometry information table, an attribute information table, a texture information table, and a model node table for the 3D model data; wherein, the data file table is used to store the 3D model file to be processed, the geometry information table is used to store the geometric information corresponding to the 3D model, the attribute information table is used to store the attribute information of the 3D model and all nodes of the 3D model, the texture information table is used to store the texture mapping information of the 3D model, and the model node table is used to store the information of all nodes of the 3D model.
[0022] S2.3 Read various types of information from vector data, image data, and 3D model data respectively, and store the information from each type of data into the corresponding data storage table.
[0023] As a further improvement of the present invention, S3 includes:
[0024] S3.1 Read the spatial information from the vector data and image data respectively, and transform the vector data and image data from the original coordinate system to the WGS84 coordinate system based on the read spatial information;
[0025] S3.2 Read the spatial information of the 3D model data, obtain the position information of the model data in the original coordinate system and the WGS84 coordinate system, establish the transformation matrix for transforming the model data from the original coordinate system to the WGS84 coordinate system, and transform the model data from the original coordinate system to the WGS84 coordinate system based on the transformation matrix.
[0026] As a further improvement of the present invention, S3.2 includes:
[0027] S3.2.1 Read the spatial information of the 3D model data, obtain the position information of any three non-collinear points in the model in the original coordinate system and the ECEF coordinate system, and calculate the transformation matrix of the model data from the original coordinate system to the ECEF coordinate system based on the positional relationship of these three points in the two coordinate systems.
[0028] S3.2.2. Based on the transformation matrix, transform the model data from the original coordinate system to the ECEF coordinate system, and based on the transformation formula, transform the model data from the ECEF coordinate system to the WGS84 coordinate system;
[0029] S3.2.3. Convert the 3D model data transformed to the ECEF coordinate system into glTF format, and divide the glTF format data into multiple tiles according to the spatial range. Each tile contains geometric information and attribute information, and there is a hierarchical relationship between the tiles.
[0030] S3.2.4 Obtain the ECEF coordinates of the data center point in glTF format. Based on the ECEF coordinates of the data center point in glTF format and the hierarchical relationship between each tile, calculate the global transformation matrix of each tile. The global transformation matrix of each tile = the transformation matrix of its own tile × the transformation matrix of the parent node tile T × … × the transformation matrix of the root node tile. Locate each tile by recursively combining the hierarchical matrices.
[0031] As a further improvement of the present invention, the model data is transformed from the original coordinate system to the ECEF coordinate system in the order of rotation, scaling, and translation. The transformation formula is as follows:
[0032]
[0033]
[0034]
[0035]
[0036] in, The position of the model data in the original coordinate system. To determine the position of the model data in the ECEF coordinate system, Let be the rotation transformation matrix. , , They are respectively , , The rotation transformation matrix of the axis. For scaling transformation matrix, , , They are respectively , , Scaling factor of axis coordinate values The translation transformation matrix is... , , They are respectively , , The amount of translation of the axis coordinate values.
[0037] As a further improvement of the present invention, S4 includes:
[0038] S4.1 Read the attribute information table and geometric information table of the vector data after coordinate system transformation, generate the json file and bin file of the vector data glTF model, and combine the json file and bin file into the vector data glTF model;
[0039] S4.2 Read the attribute information table and geometric information table of the image data after coordinate system transformation, generate json and bin files of the image data glTF model, and combine the json and bin files into the image data glTF model;
[0040] S4.3 Read the attribute information table, model node table, geometric information table and texture information table of the 3D model data after coordinate system transformation, generate json file, bin file and texture file of 3D model data glTF model, and combine json file, bin file and texture file into 3D model data glTF model.
[0041] As a further improvement of the present invention, S4.3 includes:
[0042] S4.3.1 Read the attribute information table and model node table of the 3D model data, and generate a JSON file of the glTF 3D model data.
[0043] S4.3.2 Read the geometric information table of the 3D model data and generate the bin file of the glTF 3D model data;
[0044] S4.3.3 Read the texture information table of the 3D model data and generate the texture file of the glTF model of the 3D model data;
[0045] S4.3.4 Combine the json file, bin file, and texture file into a 3D model data glTF model.
[0046] As a further improvement of the present invention, S5 includes:
[0047] S5.1 Add a schema attribute to the index file, and define two parameters, id and classes, for the schema attribute; among them, the classes parameter is defined as a parameter representing the data type, and the classes parameter includes multiple class parameters used to record the corresponding type of data;
[0048] S5.2 Define three parameters for each class parameter: class name, description, and properties. The properties field includes multiple attribute headers to record the attribute information of the smallest unit of the glTF model.
[0049] S5.3 Add a minimum unit attribute field to the content field of the root attribute of the index file. The number of minimum units in the minimum unit attribute field is the sum of the number of minimum units in each class parameter under the schema attribute.
[0050] S5.4 Define three parameters for the smallest unit: uri, metadata, and group. The uri records the relative path of the binary data file of the min unit, the metadata records the data type and attribute value of the min unit, and the group records the display group of the min unit.
[0051] S5.5 Define two parameters for metadata: class and properties. The class parameter records the data type of the Minunit, and the properties parameter records the attribute information of the property field corresponding to the class parameter.
[0052] As a further improvement of the present invention, S6 includes:
[0053] S6.1 Read the information of the glTF model of each type of data, convert the glTF model of each type of data into glb format, and establish the relationship between the glb format data of each type of data and the data file constructed by S5;
[0054] S6.2 Based on the spatial range and characteristics of various data types, the glTF model of each data type is divided into multiple tiles, each tile contains a content field, and a bounding box is generated for each tile;
[0055] S6.3. Add a minimum unit attribute field to the content field of each tile, set class and properties parameters for each minimum unit attribute field, add the corresponding data type to the class parameter, and add the corresponding attribute information to the properties parameter. The attribute information is read from the data storage table. The class and properties parameters of the minimum unit attribute field are associated with the schema attribute of the index file constructed in S5 to establish the relationship between each tile of each type of data and the index file.
[0056] S6.4 Based on the relationship between each type of data and the index file and data file, each type of data is converted into 3DTiles format data to output 3D Tiles format data of each type of data, and the index file and data file of the 3D Tiles format data of each type of data are saved to the specified directory.
[0057] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0058] While preserving data information, a brand-new schema mechanism is introduced. The smallest unit is built based on the schema mechanism. By combining the smallest unit with the schema mechanism, different types of data can be stored, managed and indexed in a unified geospatial space. This enables different types of data to maintain consistent geospatial relationships and to be expressed in a real geographical environment. Attached Figure Description
[0059] Figure 1 This is a flowchart of the method.
[0060] Figure 2 A schematic diagram of the 3D Tiles extension data structure;
[0061] Figure 3 A diagram showing the structure of the schema attribute;
[0062] Figure 4 This is a structure diagram of the root attribute. Detailed Implementation
[0063] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0064] The present invention will now be described in further detail with reference to the accompanying drawings:
[0065] Please see Figure 1 A method for constructing a 3D Tiles data structure, comprising:
[0066] S1. Acquire data from different sources and of different types, including vector data, image data, and 3D model data.
[0067] Vector data includes three types: points, lines, and surfaces, in SHP format. Vector data can include roads, rivers, towns, etc. Image data consists of high-resolution satellite remote sensing images in TIF format. The spatial resolution of the image data should be better than 1m. Image data can be selected from Gaofen-2, Gaofen-7, or Jilin-1 satellites. 3D model data consists of models with 3D shapes and appearances constructed by software. Models include point cloud models, oblique photogrammetry models, BIM models, and individual models. Data formats include LAS, OSGB, OBJ, and 3DS.
[0068] S2. Construct corresponding data storage tables for each type of data, read the information of each type of data, and store the information of each type of data into the corresponding data storage table; specifically including the following steps:
[0069] S2.1 Create a data file table, a geometric information table, and an attribute information table for vector data and image data respectively; the data file table is used to store the files to be processed, the geometric information table is used to store the geometric information of the data, and the attribute information table is used to store the attribute information of the data.
[0070] S2.2 Create a data file table, a geometry information table, an attribute information table, a texture information table, and a model node table for the 3D model data; wherein, the data file table is used to store the 3D model file to be processed, the geometry information table is used to store the geometric information corresponding to the 3D model, the attribute information table is used to store the attribute information of the 3D model and all nodes of the 3D model, the texture information table is used to store the texture mapping information of the 3D model, and the model node table is used to store the information of all nodes of the 3D model.
[0071] S2.3 Read various types of information from vector data, image data, and 3D model data respectively, and store the information from each type of data into the corresponding data storage table.
[0072] Geometric information includes dimensions, shape, and location; attribute information includes feature name, feature type, feature description, feature height, feature area, and creation date; texture information includes texture and color; and node information includes node level and node name.
[0073] S3. Transform the coordinate systems of all types of data to the same coordinate system.
[0074] Because vector data, image data, and 3D model data use different coordinate systems, and different 3D model data also have coordinate information set according to their respective models, coordinate system transformation is required for all data types to maintain a consistent geospatial relationship. 3D Tiles data is typically displayed using Cesium software, and the Cesium architecture uses the WGS84 geographic coordinate system. Therefore, the coordinate system of all types of data needs to be uniformly converted to the WGS84 coordinate system. The specific conversion steps are as follows:
[0075] For vector data:
[0076] Read the prj file of the vector data to obtain the vector coordinate information; using ArcGIS software, in ArcToolbox, select Data Management Tools>Projections and Transformations>Projection to perform coordinate system transformation, converting the vector data from the original coordinate system to the WGS84 coordinate system.
[0077] For image data: Read the XML file of the image data to obtain the coordinate information of the image; using ArcGIS software, in ArcToolbox, select Data Management Tools>Projections and Transformations>Raster>Define Projection to perform coordinate system transformation, converting the image data from the original coordinate system to the WGS84 coordinate system.
[0078] For 3D model data:
[0079] Read the spatial information of the 3D model data, obtain the position information of any three non-collinear points in the model in the original coordinate system and the ECEF coordinate system. Based on the positional relationship of these three points in the two coordinate systems, calculate the transformation matrix for transforming the model data from the original coordinate system to the ECEF coordinate system. Transform the model data from the original coordinate system to the ECEF coordinate system in the order of rotation, scaling, and translation. The transformation formula is as follows:
[0080]
[0081]
[0082]
[0083]
[0084] in, The position of the model data in the original coordinate system. To determine the position of the model data in the ECEF coordinate system, Let be the rotation transformation matrix. , , They are respectively , , The rotation transformation matrix of the axis. For scaling transformation matrix, , , They are respectively , , Scaling factor of axis coordinate values The translation transformation matrix is... , , They are respectively , , The amount of translation of the axis coordinate values.
[0085] The model data is transformed from the original coordinate system to the ECEF coordinate system based on the transformation matrix, and then transformed from the ECEF coordinate system to the WGS84 coordinate system based on the transformation formula. The WGS84 coordinate system of this invention adopts the LBH latitude and longitude coordinate system. The transformation formula between the ECEF coordinate system and the LBH latitude and longitude coordinate system is as follows:
[0086]
[0087]
[0088]
[0089]
[0090] Where L represents latitude, B represents longitude, H represents altitude, a and b are the Earth's major and minor axes, respectively; N represents the radius of curvature, which is related to latitude L.
[0091] The 3D model data converted to the ECEF coordinate system is converted into glTF format. The glTF format data is divided into multiple tiles according to the spatial range. Each tile contains geometric information and attribute information, and there is a hierarchical relationship between the tiles.
[0092] Obtain the ECEF coordinates of the data center point in glTF format. Based on the ECEF coordinates of the data center point in glTF format and the hierarchical relationship between each tile, calculate the global transformation matrix of each tile. The global transformation matrix of each tile = its own tile's transformation matrix × the transformation matrix of the parent node's tile T × ... × the transformation matrix of the root node's tile. Locate each tile by recursively combining the hierarchical matrices.
[0093] S4. Export the data of each type after coordinate system transformation as glTF models, specifically including the following steps:
[0094] S4.1 Read the attribute information table of the vector data after coordinate system transformation and generate a JSON file of the vector data glTF model; read the geometric information table of the vector data after coordinate system transformation and generate a BIN file of the vector data glTF model; combine the JSON file and the BIN file into a glTF file, and each glTF file is a vector data glTF model;
[0095] S4.2 Read the attribute information table of the image data after coordinate system transformation and generate a JSON file of the image data glTF model; read the geometric information table of the image data after coordinate system transformation and generate a BIN file of the image data glTF model; combine the JSON file and the BIN file into a glTF file, and each glTF file is an image data glTF model;
[0096] S4.3. Read the attribute information table and model node table of the 3D model data after coordinate system transformation, and generate a JSON file of the 3D model data glTF model; read the geometric information table after coordinate system transformation, and generate a BIN file of the 3D model data glTF model; read the texture information table of the 3D model data after coordinate system transformation, and generate a texture file of the 3D model data glTF model; combine the JSON file, BIN file, and texture file into a glTF file, and each glTF file is a 3D model data glTF model.
[0097] S5. Construct a 3D Tilesextension data structure consisting of an index file (Tileset.json) and a data file (glb). Add a schema attribute to the index file and define multiple data types within the schema attribute to record data of corresponding types. Add a minimum unit attribute field to the root attribute of the index file to record the corresponding data type and attribute value. The constructed 3D Tiles extension data structure is as follows: Figure 2 As shown.
[0098] Tileset.json is a JSON file that describes the entire 3D dataset, primarily including six attributes: asset, properties, geometricError, root, groups, and metadata. Building upon this, this invention adds a schema attribute and defines multiple class parameters for schema to record different data types. Each class has a properties parameter that records the attribute information of each model's smallest unit (Min unit). Furthermore, the original root attribute has been improved by adding a Min unit attribute field to record the data type and attribute information of the smallest unit.
[0099] The specific construction steps are as follows:
[0100] S5.1 Add a schema attribute to the index file, defining two parameters for the schema attribute: id and classes. The classes parameter represents the data type, including VectorClass, ImageClass, PointCloudClass, BIMClass, ModelClass, and UndergroundClass, which are used to record vector data, image data, point cloud data, BIM models, modular models, and underground models, respectively. The structure of the schema attribute is as follows: Figure 3 As shown;
[0101] S5.2 Define three parameters for each class parameter: class name (name), description (description), and properties (properties). The properties field includes multiple attribute headers to record the attribute information of the smallest unit of the glTF model. The properties field includes four fixed parameters: x-coordinate, y-coordinate, z-coordinate, and transformation matrix (transform).
[0102] S5.3. Add a minimum unit attribute field to the content field of the root attribute in the index file. The number of minimum units in the minimum unit attribute field is the sum of the number of minimum units in each class parameter under the schema attribute. The structure of the root attribute is as follows: Figure 4 As shown;
[0103] S5.4 Define three parameters for the smallest unit: uri, metadata, and group. The uri records the relative path of the binary data file of the min unit, the metadata records the data type and attribute value of the min unit, and the group records the display group of the min unit.
[0104] S5.5 Define two parameters for metadata: class and properties. The class parameter records the data type of the Minunit (i.e., the class name of the data), and the properties parameter records the attribute information of the property field corresponding to the class parameter, including x value, y value, z value, and transform value.
[0105] S6. Based on the constructed 3D Tiles extension data structure and glTF models of various data types, convert the various datasets into 3D Tiles format data. The specific steps are as follows:
[0106] S6.1 Read the geometry, attributes, texture and other information of the glTF model of each type of data, convert the glTF model of each type of data into glb format, and establish the relationship between the glb format data of each type of data and the data file constructed by S5.
[0107] S6.2 Based on the spatial range and characteristics of various data types, the glTF model of each data type is divided into multiple tiles. Each tile contains a content field, and a bounding box is generated for each tile. A bounding box is an oriented bounding box defined by its center position and three 3D vectors. The 3D vectors define the direction and half-length of the x, y, and z axes.
[0108] S6.3. Add a minimum unit attribute field to the content field of each tile, set class and properties parameters for each minimum unit attribute field, add the corresponding data type to the class parameter, and add the corresponding attribute information to the properties parameter. The attribute information is read from the data storage table. The class and properties parameters of the minimum unit attribute field are associated with the schema attribute of the index file constructed in S5 to establish the relationship between each tile of each type of data and the index file.
[0109] S6.4 Based on the relationship between each type of data and the index file and data file, each type of data is converted into 3DTiles format data to output 3D Tiles format data of each type of data, and the index file and data file of the 3D Tiles format data of each type of data are saved to the specified directory.
[0110] The data structure construction method provided by this invention introduces a novel schema mechanism while preserving data information. The smallest unit is constructed based on the schema mechanism, and the smallest unit is combined with the schema mechanism to achieve unified storage, management and indexing of different types of data in geospatial space. This enables different types of data to maintain consistent geospatial relationships and to express different types of data in real geographical environments.
[0111] Taking data from a certain island region as an example, the process of constructing 3D Tiles format data based on multi-source heterogeneous data is described in detail below:
[0112] Step 1: Obtain GF2 remote sensing imagery of a certain island area, SHP vector data of land use status, and 3D 3DS model data of buildings, vegetation, and corals on the island.
[0113] The island, located in a city of a certain province, is a coral island composed of uplifted reefs and coral shell sand bodies. It is long and narrow, surrounded by sandbars, and covered with lush vegetation and shrubs.
[0114] The spatial resolution of the acquired GF2 image is 0.8 meters, and the time phase is 2024.3.26; the land use status SHP vector is a surface file, obtained by interpreting the GF2 image; the 3D models of the island's buildings, vegetation, and corals are obtained by modeling based on the GF2 image.
[0115] Step 2: Create data storage tables for vector data, image data, and 3D model data respectively.
[0116] Create 3 vector data storage tables: shapefile, shape geometry, and shape properties; create 3 image data storage tables: image file, image geometry, and image properties; and create 5 3D model data storage tables: model file, model geometry, model properties, model textures, and model node.
[0117] Step 3, read the data information:
[0118] Read the XML file of the GF2 image, obtain the geometric information, and record it in the image geometry table. The geometric information includes resolution, spectral range, image swath width, orbital parameters, etc.; obtain the attribute information and record it in the image properties table. The attribute information includes band information, sensor type, imaging time, etc.
[0119] Read the land use status shapefile (shp file), obtain geometric information, and record it in the shapefile geometry table. Geometric information includes the outer contour and inner contour; the outer contour is a list of coordinate points, such as [(0,0),(10,0),(10,10),(0,10)]; the inner contour is also a list of coordinate points, such as [(4,4),(6,4),(6,6),(4,6)]. Read the land use status database file (dbf file), obtain attribute information, and record it in the shapefile properties table. Attribute information includes FID, island name, primary land use type, secondary land use type, area, survey date, etc.
[0120] Read the 3DS file of the 3D model, obtain the geometry, attributes, textures and node information, and record the information in the model geometry, model properties, model textures and model node tables.
[0121] Taking the island building model as an example, the geometric information includes vertices, edges, faces, normals, etc.; the attribute information includes name, type, material, label, height, area, number of layers, etc.; the texture information includes texture image, texture coordinates, texture mapping, etc., and the texture image is in JPG format; the node information includes root node, child nodes, hierarchy, etc.
[0122] Step 4: Transform the coordinate systems of all types of data to the same coordinate system:
[0123] Both GF2 imagery and land use status SHP use the WGS84 coordinate system without conversion.
[0124] Taking a residential model on an island as an example, the steps for establishing a coordinate system for 3D model data are described in detail:
[0125] The transformation process obtains the position information of the origin of the residential model and any three other points (non-collinear) in the original coordinate system and the real world (ECEF coordinate system). Based on the positional relationship of the three points in the two coordinate systems, the rotation transformation matrix R is calculated.
[0126] When rotating around the x-axis, obtain the rotation matrix of the x-axis. The calculation formula is as follows:
[0127]
[0128] When rotating around the y-axis, obtain the rotation matrix of the y-axis. The calculation formula is as follows:
[0129]
[0130] When rotating around the z-axis, obtain the rotation matrix of the z-axis. The calculation formula is as follows:
[0131]
[0132] Multiplying the three rotation matrices above, we obtain the rotation transformation matrix R, calculated as follows:
[0133]
[0134] If a 3D model is not created at a 1:1 scale with the actual dimensions, the model size needs to be scaled. The formula for calculating the scaling transformation matrix S is as follows:
[0135]
[0136] in, For scaling transformation matrix, , , They are respectively , , The factor by which the axis coordinate values are scaled up (scaled down). In this embodiment, the residential model is created at a 1:1 scale to the actual dimensions, therefore... , , The values are all 1.
[0137] Based on the translation transformation matrix, the coordinates are transformed to the ECEF coordinate system, and the calculation formula is as follows:
[0138]
[0139] The translation transformation matrix is... , , They are respectively , , The amount of translation of the axis coordinate values.
[0140] Therefore, following the order of rotation, scaling, and translation, the coordinates A of the 3D model are transformed to obtain the transformed position A'. The calculation formula is as follows:
[0141]
[0142] in, The position of the model data in the original coordinate system. This represents the position of the model data in the ECEF coordinate system.
[0143] Based on the above transformation matrix, the original coordinates of the residential model are transformed to obtain the model space data in the ECEF coordinate system; based on the transformation formula, the model space data is transformed from the ECEF coordinate system to the WGS84 coordinate system.
[0144] The residential model is converted into glTF format. The glTF format data is divided into multiple tiles according to spatial range. Each tile contains geometric information and attribute information, and there is a hierarchical relationship between the tiles (such as building-floor-room).
[0145] Obtain the ECEF coordinates of the center point C of the glTF. Based on the ECEF coordinates of the center point C, the hierarchical relationship between each tile, and the absolute coordinate transformation matrix of each tile, calculate the transformation matrix T of the current tile. The formula for calculating the transformation matrix T is: T = transformation matrix of its own tile × transformation matrix of the parent node tile × ... × transformation matrix of the root node tile. This allows for the recursive combination of hierarchical matrices to locate each tile.
[0146] Step 5: Export different types of data as glTF models:
[0147] Read the vector attribute information table and geometric information table, and export the land use status vector as glTF format; read the image attribute information table and geometric information table, and export the GF2 image as glTF format; read the attribute information table, geometric information table, model node information table, and texture information table of the 3D model, and export the island building model, vegetation model, and coral model as glTF format respectively.
[0148] Step 6: Based on the schema mechanism and the smallest unit, construct the 3D Tiles extension data structure consisting of the tileset.json file and the glb file:
[0149] Create a tileset.json file, add a schema attribute to the tileset.json file, define id and classes parameters for schema, and define 5 classes in classes: VectorClass for recording land use vectors, ImageClass for recording GF2 imagery, PlantClass for recording vegetation models, BuildingClass for recording island building models, and CoralClass for recording coral models.
[0150] For VectorClass, the smallest unit (Min unit) is a patch, and the land use vector has 54 Min units; for ImageClass, the Min unit is a pixel, and the GF2 image has 2,656,900 Min units; for PlantClass, the Min unit is a single tree, and the vegetation model has 1,000 Min units; for BuildingClass, the Min unit is a single house, and the island building model has 15 Min units; for CoralClass, the Min unit is a single coral, and the coral model has 100 Min units.
[0151] Define name, description, and properties parameters for each class.
[0152] Define attribute headers for each class's properties table, totaling 6: name, type, area, x, y, and z.
[0153] In the `content` field of the `root` property in the `tileset.json` file, multiple Min units are defined. The number of Min units is equal to the sum of the number of Min units in `VectorClass`, `ImageClass`, `PlantClass`, `BuildingClass`, and `CoralClass`, totaling 2,658,069.
[0154] Each min unit defines uri, metadata, and group parameters.
[0155] Define class and properties parameters for the metadata. Taking a min unit of a vector as an example, where the min unit is a shrub patch, the class is recorded as VectorClass, and the properties are recorded as shrub, woodland, and 1000m. 2 , 10545000m, 1777600m, 2m.
[0156] Step 7: Integrate various models and data structures into the 3DTiles format.
[0157] Read the land use vector, GF2 image, island buildings, vegetation and coral glTF models, and convert these glTF models into corresponding glb files respectively. Establish the relationship between the glb files and the glb files of the 3D Tiles extension data structure constructed in step 6.
[0158] Based on the spatial extent, each glTF model is divided into multiple tiles. A bounding box is generated for each tile, and a minimum unit (Min unit) is added to all content attributes within each tile. According to the data type of the glLB model connected to each Min unit, a corresponding class type and properties are set for each Min unit. Values are assigned to the properties field corresponding to the class type: name, type, area, x, y, and z. Based on the divided tile file, the relationship between each tile and the tileset.json file of the 3D Tiles extension data structure constructed in step 6 is established.
[0159] The final output is 3D Tiles format data, and the corresponding json and glb files are saved to the specified directory.
[0160] As can be seen from the above examples, the data structure construction method provided by the present invention introduces a brand-new schema mechanism while preserving data information. The smallest unit is constructed based on the schema mechanism, so as to combine the smallest unit with the schema mechanism, thereby realizing the unified storage, management and indexing of different types of data in geographic space.
[0161] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for constructing a 3D Tiles data structure, characterized in that, include: S1. Acquire data from different sources and of different types, including vector data, image data, and 3D model data; S2. Construct corresponding data storage tables for each type of data, read the information of each type of data, and store the information of each type of data into the corresponding data storage tables. S3. Transform the coordinate systems of various data types to the same coordinate system, including: S3.1 Read the spatial information from the vector data and image data respectively, and transform the vector data and image data from the original coordinate system to the WGS84 coordinate system based on the read spatial information; S3.
2. Read the spatial information of the 3D model data, obtain the position information of the model data in the original coordinate system and the WGS84 coordinate system, establish a transformation matrix for transforming the model data from the original coordinate system to the WGS84 coordinate system, and transform the model data from the original coordinate system to the WGS84 coordinate system based on the transformation matrix, including: S3.2.1 Read the spatial information of the 3D model data, obtain the position information of any three non-collinear points in the model in the original coordinate system and the ECEF coordinate system, and calculate the transformation matrix of the model data from the original coordinate system to the ECEF coordinate system based on the positional relationship of these three points in the two coordinate systems. S3.2.
2. Based on the transformation matrix, transform the model data from the original coordinate system to the ECEF coordinate system, and based on the transformation formula, transform the model data from the ECEF coordinate system to the WGS84 coordinate system; S3.2.
3. Convert the 3D model data transformed to the ECEF coordinate system into glTF format, and divide the glTF format data into multiple tiles according to the spatial range. Each tile contains geometric information and attribute information, and there is a hierarchical relationship between the tiles. S3.2.4 Obtain the ECEF coordinates of the data center point in glTF format. Based on the ECEF coordinates of the data center point in glTF format and the hierarchical relationship between each tile, calculate the global transformation matrix of each tile. The global transformation matrix of each tile = the transformation matrix of its own tile × the transformation matrix of the parent node tile T × ... × the transformation matrix of the root node tile. Locate each tile by recursively combining the hierarchical matrix. S4. Export the data of each type after coordinate system transformation as glTF models respectively; S5. Construct a 3D Tiles extension data structure consisting of an index file and a data file. Add a schema attribute to the index file and define multiple data types in the schema attribute to record data of the corresponding types. Add a minimum unit attribute field to the root attribute of the index file to record the corresponding data type and attribute value. S6. Based on the constructed 3D Tiles extension data structure and glTF models of various data types, the datasets of various types are converted into 3D Tiles format data.
2. The method according to claim 1, characterized in that, The vector data includes three types: points, lines, and surfaces, and the data format is SHP. The image data is high-resolution satellite remote sensing imagery, and the data format is TIF. The three-dimensional model data refers to the data of a model with a three-dimensional shape and appearance constructed by software. The model includes point cloud model, oblique photogrammetry model, BIM model, and individual model. The data formats include LAS, OSGB, OBJ, and 3DS.
3. The method according to claim 1 or 2, characterized in that, S2 include: S2.1 Create a data file table, a geometric information table, and an attribute information table for vector data and image data respectively; the data file table is used to store the files to be processed, the geometric information table is used to store the geometric information of the data, and the attribute information table is used to store the attribute information of the data. S2.2 Create a data file table, a geometry information table, an attribute information table, a texture information table, and a model node table for the 3D model data; wherein, the data file table is used to store the 3D model file to be processed, the geometry information table is used to store the geometric information corresponding to the 3D model, the attribute information table is used to store the attribute information of the 3D model and all nodes of the 3D model, the texture information table is used to store the texture mapping information of the 3D model, and the model node table is used to store the information of all nodes of the 3D model. S2.3 Read various types of information from vector data, image data, and 3D model data respectively, and store the information from each type of data into the corresponding data storage table.
4. The method according to claim 1, characterized in that, The model data is transformed from the original coordinate system to the ECEF coordinate system in the order of rotation, scaling, and translation. The transformation formula is as follows: in, The position of the model data in the original coordinate system. To determine the position of the model data in the ECEF coordinate system, Let be the rotation transformation matrix. , , They are respectively , , The rotation transformation matrix of the axis. For scaling transformation matrix, , , They are respectively , , Scaling factor of axis coordinate values The translation transformation matrix is... , , They are respectively , , The amount of translation of the axis coordinate values.
5. The method according to claim 3, characterized in that, S4 includes: S4.1 Read the attribute information table and geometric information table of the vector data after coordinate system transformation, generate the json file and bin file of the vector data glTF model, and combine the json file and bin file into the vector data glTF model; S4.2 Read the attribute information table and geometric information table of the image data after coordinate system transformation, generate json and bin files of the image data glTF model, and combine the json and bin files into the image data glTF model; S4.3 Read the attribute information table, model node table, geometric information table and texture information table of the 3D model data after coordinate system transformation, generate json file, bin file and texture file of 3D model data glTF model, and combine json file, bin file and texture file into 3D model data glTF model.
6. The method according to claim 5, characterized in that, S4.3 includes: S4.3.1 Read the attribute information table and model node table of the 3D model data, and generate a JSON file of the glTF 3D model data. S4.3.2 Read the geometric information table of the 3D model data and generate the bin file of the glTF 3D model data; S4.3.3 Read the texture information table of the 3D model data and generate the texture file of the glTF model of the 3D model data; S4.3.4 Combine the json file, bin file, and texture file into a 3D model data glTF model.
7. The method according to claim 1, characterized in that, S5 include: S5.1 Add a schema attribute to the index file, and define two parameters, id and classes, for the schema attribute; among them, the classes parameter is defined as a parameter representing the data type, and the classes parameter includes multiple class parameters used to record the corresponding type of data; S5.2 Define three parameters for each class parameter: class name, description, and properties. The properties field includes multiple attribute headers to record the attribute information of the smallest unit of the glTF model. S5.3 Add a minimum unit attribute field to the content field of the root attribute of the index file. The number of minimum units in the minimum unit attribute field is the sum of the number of minimum units in each class parameter under the schema attribute. S5.4 Define three parameters for the smallest unit: uri, metadata, and group. The uri records the relative path of the binary data file of the min unit, the metadata records the data type and attribute value of the min unit, and the group records the display group of the min unit. S5.5 Define two parameters for metadata: class and properties. The class parameter records the data type of the Min unit, and the properties parameter records the attribute information of the property field corresponding to the class parameter.
8. The method according to claim 1, characterized in that, S6 include: S6.1 Read the information of the glTF model of each type of data, convert the glTF model of each type of data into glb format, and establish the relationship between the glb format data of each type of data and the data file constructed by S5; S6.2 Based on the spatial range and characteristics of various data types, the glTF model of each data type is divided into multiple tiles, each tile contains a content field, and a bounding box is generated for each tile; S6.
3. Add a minimum unit attribute field to the content field of each tile, set class and properties parameters for each minimum unit attribute field, add the corresponding data type to the class parameter, and add the corresponding attribute information to the properties parameter. The attribute information is read from the data storage table. The class and properties parameters of the minimum unit attribute field are associated with the schema attribute of the index file constructed in S5 to establish the relationship between each tile of each type of data and the index file. S6.4 Based on the relationship between each type of data and the index file and data file, each type of dataset is converted into 3D Tiles format data, so as to output the 3D Tiles format data of each type of data, and save the index file and data file of the 3D Tiles format data of each type of data to the specified directory.