Geographic vector-based large-scale city three-dimensional body generation method and system
By chunking processing and attribute information storage of large-scale two-dimensional vector data, and using glTF format to expand the generation of three-dimensional model data, the problem of low generation and loading efficiency in the existing technology is solved, and efficient three-dimensional model data generation and rendering efficiency is achieved.
Patent Information
- Application Number
- CN202510518745.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2045-04-24
AI Technical Summary
The existing technology is difficult to efficiently generate large-scale urban three-dimensional model data, and the three-dimensional model format is inefficient in loading the front-end web pages, and it is impossible to effectively store and load complex material and animation information.
By obtaining two-dimensional vector data within the target range, performing grid-based chunking processing, and using glTF format extension to generate three-dimensional model data, combining buffers, buffer views, accessors, material objects and primitives to create efficient three-dimensional model files, and improving rendering efficiency through 3D Tiles data organization.
It realizes efficient generation and loading of large-scale three-dimensional model data, improves the rendering speed on the web page and the attribute information integrity of the three-dimensional model, and is suitable for smart cities.
Smart Images

Figure CN120070797A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of GIS, and particularly relates to a method and system for generating large-scale urban three-dimensional models based on geographical vectors. Background Art
[0002] Three-dimensional model data is usually generated by manual modeling. However, in fields such as smart cities, a large amount of three-dimensional model data is required. Manual modeling is inefficient, and the format of the models is not conducive to efficient loading on the front-end web pages. In terms of the storage of three-dimensional model data, many related works have been carried out by domestic and foreign experts, scholars, research institutions, and commercial companies. The existing storage formats of three-dimensional models are mainly the following: OBJ, FBX, DAE, glTF, and 3D Tiles.
[0003] The OBJ format is known for its simplicity and versatility. This format allows users to easily read and edit basic three-dimensional model geometric data, so it becomes an ideal choice for saving and exchanging three-dimensional models. However, although the OBJ format can effectively handle complex structure representations, it is limited in supporting complex material and animation information, and it is difficult to store three-dimensional models containing multiple components.
[0004] Both the FBX and DAE formats have a place in the three-dimensional modeling and animation industries due to their wide support and cross-platform compatibility. They can both effectively handle complex geometric data and texture information, but both of these formats have the problem of large file sizes and low loading efficiency on the front-end web pages.
[0005] The glTF format has become a choice for three-dimensional models due to its relatively lightweight file size and fast loading performance on the web. It supports various functions required for modern three-dimensional models, including textures, animations, and lighting effects, which enables developers to easily load three-dimensional models in this format on various platforms. However, for very complex and high-detail three-dimensional models, the file size of the glTF format may still be relatively large.
[0006] The 3D Tiles format is used for the efficient transmission and rendering of large-scale three-dimensional geospatial data. It supports multiple resolutions and can request three-dimensional tiles at different levels of detail according to the viewing distance and performance requirements. At the same time, it saves memory and improves rendering efficiency through on-demand loading; in addition, this format has good scalability and interoperability, supports various materials, textures, and other attributes, and because it is an open standard, it promotes sharing and integration between different platforms, and glTF can be used as the tile format. However, there is currently a lack of computer programs that directly convert two-dimensional vector data into three-dimensional model data in the 3D Tiles format. Some programs can convert two-dimensional vector data into the 3D Tiles format, but there are problems such as low conversion efficiency and inability to store the original attribute table information of vector data.
[0007] Therefore, the present invention proposes a method and system for generating large-scale urban three-dimensional bodies based on geographical vectors, and constructs a conversion method that meets the efficient loading of three-dimensional models and retains attribute information. Summary of the Invention
[0008] The purpose of the present invention is to solve the problems existing in the prior art, and provide a method and system for generating large-scale urban three-dimensional bodies based on geographical vectors.
[0009] The specific technical solutions adopted by the present invention are as follows:
[0010] In a first aspect, the present invention provides a method and system for generating large-scale urban three-dimensional bodies based on geographical vectors, which includes:
[0011] S1. Obtain two-dimensional vector data composed of vector surface elements of all buildings within the target range and the corresponding vector data attribute table, and divide the vector surface elements into blocks formed by gridifying the target range according to spatial positions;
[0012] S2. Determine an overall center for each block, and create a buffer for storing information, a material object for rendering buildings, and a glTF format extension for storing field information; then, taking the overall center corresponding to the current block as the origin of the current block coordinate system, and combining the height information in the vector data attribute table, convert each vector surface element in the current block into a three-dimensional model, and then calculate the spatial coordinates of each vertex, the vertex indices of each face, the normal vectors of each face, and the element numbers of the vector surface elements in the current block coordinate system, store them in an array form and further convert them into binary data for classified storage in the buffer, and create a first buffer view and an accessor for these four types of data respectively; then store each attribute field in the vector data attribute table and the string length offset in the buffer in string form, and create corresponding second buffer views respectively; finally, create a primitive containing the accessor and a mesh containing the primitive, store the second buffer view in the glTF format extension, combine the buffer, the first buffer view, the second buffer view, the accessor, the material object, the primitive, the mesh, and the glTF format extension to create glTF data and save it as a glb file corresponding to the current block;
[0013] S3. Create a JSON file to organize the glb files corresponding to each block with the longitude and latitude of the overall center of each block as a spatial index, and generate 3D Tiles data.
[0014] Preferably, in the first aspect above, the target range is meshed according to a preset block size, and then all vector surface elements in the two-dimensional vector data are divided into each block according to the spatial topological relationship between the vector surface elements and the blocks.
[0015] Preferably, in the first aspect above, the longitude of the overall center of each block is the average of the maximum longitude and the minimum longitude of all vector surface elements inside the block, and the latitude of the overall center is the average of the maximum latitude and the minimum latitude of all vector surface elements inside the block.
[0016] Preferably, in the first aspect above, for each block, when converting each vector surface element in the current block into a three-dimensional model, a spatial rectangular coordinate system needs to be established with the overall center corresponding to the current block as the origin, with the longitude eastward as the X-axis, vertically upward from the ground surface as the Y-axis, and the latitude southward as the Z-axis. Each block calculates the vertex coordinates of the three-dimensional model in its respective spatial rectangular coordinate system.
[0017] Preferably, in the first aspect above, when converting the vector surface element into a three-dimensional model of a building, the ear clipping algorithm needs to be used to divide the three-dimensional model into multiple triangular faces, and calculate and store the face vertex indices and normals of each triangular face.
[0018] Preferably, in the first aspect above, the buffer views corresponding to the vertex coordinates, each face vertex index, the normal, and the feature number are stored in the attributes of the primitive, and at the same time, the materials used in the three-dimensional model of the building and the attribute fields of the corresponding vector surface elements in the vector data attribute table are also stored.
[0019] In a second aspect, the present invention provides a large-scale urban three-dimensional body generation system based on geographic vectors, which includes:
[0020] A data acquisition module, configured to acquire two-dimensional vector data composed of vector surface elements of all buildings within the target range and the corresponding vector data attribute table, and divide the vector surface elements into blocks formed by meshing the target range according to the spatial positions.
[0021] The block glb file generation module is used to determine an overall center for each block, and create a buffer for storing information, a material object for rendering buildings, and a glTF format extension for storing field information; then, with the overall center corresponding to the current block as the origin of the current block coordinate system, combined with the height information in the vector data attribute table, each vector surface feature in the current block is converted into a 3D model, and then the spatial coordinates of each vertex, the vertex indices of each face, the normal vectors of each face, and the feature numbers of the vector surface features of the 3D model are calculated in the current block coordinate system, and stored in an array and further converted into binary data for classified storage in the buffer, and create a first buffer view and an accessor for these four types of data respectively; then, each attribute field and the string length offset in the vector data attribute table are stored in the buffer in string form, and create corresponding second buffer views respectively; finally, create a primitive containing the accessor and a mesh containing the primitive, store the second buffer view in the glTF format extension, combine the buffer, the first buffer view, the accessor, the material object, the primitive, the mesh, and the glTF format extension to create glTF data and save it as the glb file corresponding to the current block;
[0022] The 3D Tiles data generation module is used to create a JSON file to organize the glb files corresponding to each block with the longitude and latitude of the overall center of each block as the spatial index, and generate 3D Tiles data.
[0023] In a third aspect, the present invention provides a computer program product, including a computer program / instructions, which when executed by a processor, can implement the method for generating a large-scale urban three-dimensional body based on geographic vectors as described in any one of the above first aspect solutions.
[0024] In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it can implement the method for generating a large-scale urban three-dimensional body based on geographic vectors as described in any one of the above first aspect solutions.
[0025] In a fifth aspect, the present invention provides a computer electronic device, which includes a memory and a processor;
[0026] The memory is used to store a computer program;
[0027] The processor is used to, when executing the computer program, be able to implement the method for generating a large-scale urban three-dimensional body based on geographic vectors as described in any one of the above first aspect solutions.
[0028] The present invention has the following beneficial effects compared with the prior art:
[0029] Through the block processing and attribute information storage of large-scale two-dimensional vector data, the present invention realizes the efficient generation of corresponding three-dimensional model data. The present invention takes into account both the speed of converting large-scale vector data into three-dimensional model data and the integrity and efficiency of the three-dimensional model loading on the web page. It not only meets the rapid generation of large-scale three-dimensional models but also solves the problems of slow rendering speed of three-dimensional models loaded on the web page and difficulty in displaying the attribute information of each sub-model. The present invention can improve the efficiency of three-dimensional model generation and the integrity of attribute information, and has fundamental significance for the application of smart cities. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 is a flowchart of the steps of a method for generating large-scale urban three-dimensional bodies based on geographic vectors;
[0031] Figure 2 is the format of 3D Tiles data;
[0032] Figure 3 is a schematic diagram of the module composition of a system for generating large-scale urban three-dimensional bodies based on geographic vectors;
[0033] Figure 4 is a schematic diagram of the structure of a computer electronic device. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0034] In order to make the above objects, features, and advantages of the present invention more obvious and understandable, the following detailed description of the specific embodiments of the present invention will be given in conjunction with the accompanying drawings. Many specific details are set forth in the following description in order to fully understand the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without departing from the connotation of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed below. The technical features in various embodiments of the present invention can be combined correspondingly without conflict.
[0035] The present invention provides a method and system for generating large-scale urban three-dimensional bodies based on geographical vectors. Specifically, this method can be used for the efficient generation of three-dimensional building models in smart cities. The application of smart cities requires large-scale three-dimensional building models, which can not only help decision-makers understand spatial relationships and evaluate design schemes in a more intuitive way, but also help decision-makers quickly locate and evaluate affected areas in case of emergencies such as natural disasters. However, three-dimensional building model data is usually generated by manual modeling, which has low efficiency and the model format is not conducive to efficient loading on the front-end web page. While two-dimensional building vector data is relatively easy to obtain and also contains attribute information such as the name, height, and address of each building. The method provided by the present invention for converting large-scale two-dimensional vector data into three-dimensional model data can make full use of the advantages of two-dimensional vector data, convert it into three-dimensional model data with a large scale, high loading efficiency on the web page, and rich attribute information, providing support for the basic model data of smart cities.
[0036] It should be noted that the so-called "large-scale" in the present invention is only used to describe that the amount of vector data is relatively large, and its data volume is at the petabyte level and above, but it does not limit the specific data size.
[0037] In a preferred embodiment of the present invention, as Figure 1 shown, the steps of the method for generating large-scale urban three-dimensional bodies based on geographical vectors include S1 to S3, and the specific implementation of each step will be described in detail below.
[0038] S1. Obtain two-dimensional vector data composed of vector surface elements of all buildings within the target range and the corresponding vector data attribute table, and divide the vector surface elements into blocks formed by gridifying the target range according to their spatial positions.
[0039] It should be noted that the target range mentioned in the present invention refers to the regional range where urban three-dimensional bodies need to be generated, which can be selected according to the actual situation and does not limit the specific area. Urban three-dimensional bodies refer to three-dimensional models that need to be visually displayed in three dimensions in the city. In the present invention, they refer to buildings. The vector surface elements of buildings generally refer to the projection surface of buildings on the ground, that is, the building bottom surface, which belongs to two-dimensional vector surface elements. The attribute information of all vector surface elements in the two-dimensional vector data is also in the vector data attribute table and needs to be obtained together. In this embodiment, the input two-dimensional vector data contains all the building bottom surface data that needs to be converted into three-dimensional models. Among them, the attribute table of the building bottom surface data must contain a height field, and the building height of each building is stored in the height field.
[0040] In an embodiment of the present invention, the above S1 step can be used to allow a user to specify a target range and input two-dimensional vector data through an interface, a GUI interface, etc., and at the same time, an output path and the grid size of the grid can be set. Thus, the two-dimensional vector data can be directly input or read according to the path specified by the user. Taking the method of specifying the path as an example, based on the two-dimensional vector data, the output path, and the grid size input by the user, the program can read the two-dimensional vector data from the storage end of the two-dimensional vector data, divide each vector surface element in the data into different blocks according to its spatial position, and the vector surface elements allocated in each block can perform subsequent data processing respectively to generate glTF data.
[0041] In the glTF data format, a series of elements such as buffers, buffer views, accessors, materials, primitives, and meshes need to be covered, and they jointly define the geometry, material, and rendering method of the 3D model.
[0042] A buffer is a container for storing raw binary data, such as vertex coordinates, normals, texture coordinates, index data, etc. These data are stored in binary form without any structural information.
[0043] A buffer view is a reference to a part of the data in the buffer, defining the starting offset (byteOffset) and length (byteLength) of the data.
[0044] An accessor defines how to read structured data from the buffer view, including data types (such as FLOAT, UNSIGNED_SHORT), data formats (such as VEC3), quantity (such as the number of vertices), etc.
[0045] A material defines the appearance properties of the model surface, such as color, texture, metallicity, roughness, etc.
[0046] A primitive is the basic unit of geometric data, including a set of vertex attributes (such as position, normal), index data, and associated materials.
[0047] A mesh consists of one or more primitives and represents a complete 3D object (such as a three-dimensional model of a building with a specified material).
[0048] The internal formats and definitions of the above buffers, buffer views, accessors, materials, primitives, and meshes all belong to the prior art and will not be elaborated here. Below, a description will be mainly given on how to construct the glb text in each block.
[0049] S2. Determine a general center for each block, and create a buffer for storing information, a material object for rendering buildings, and a glTF format extension for storing field information. Then, taking the general center corresponding to the current block as the origin of the current block coordinate system, combine the height information in the vector data attribute table to convert each vector surface feature in the current block into a 3D model. Next, calculate the spatial coordinates of each vertex, the vertex indices of each face, the normal vectors of each face, and the feature numbers of the vector surface features of the 3D model in the current block coordinate system, store them in the form of arrays, and further convert them into binary data for classified storage in the buffer. Create a first buffer view and an accessor for these four types of data respectively. Then, store each attribute field in the vector data attribute table and the string length offset in the buffer in the form of a string, and create corresponding second buffer views respectively. Finally, create a primitive containing the accessor and a mesh containing the primitive, store the second buffer view in the glTF format extension, and combine the buffer, the first buffer view, the accessor, the material object, the primitive, the mesh, and the glTF format extension to create glTF data and save it as a glb file corresponding to the current block.
[0050] It should be noted that since a corresponding glb file needs to be generated for each block respectively, this process is equivalent to a process of traversing all blocks. Therefore, for the convenience of description, each block currently generating the corresponding glb file is called the current block. In fact, the processes of generating corresponding glb files between different blocks can be serial or parallel. If the data volume is relatively large, distributed parallel computing can be used to improve the overall generation efficiency.
[0051] In the embodiment of the present invention, for any current block, the preferred process of generating the corresponding glb file is as follows:
[0052] S201. Calculate and store the longitude and latitude of the general center of all vector surfaces in the current block.
[0053] In this embodiment, the general center of the current block can theoretically adopt the geometric center, centroid, etc. Since the current block contains a series of vector surface features with different longitudes and latitudes, a general center can be equivalently determined based on the vertex longitudes and latitudes of these vector surface features. Specifically, when calculating the longitude and latitude of the general center, the longitude of the general center is the average of the maximum longitude and the minimum longitude of the vertices of the vector surface, and the latitude of the general center is the average of the maximum latitude and the minimum latitude of the vertices of the vector surface. The calculation formulas for the longitude and latitude of the general center are as follows:
[0054] (1)
[0055] (2)
[0056] In the formula, and are respectively the longitude and latitude of the overall center of the current block, and are the maximum and minimum longitudes of the vertices of the vector surface in the block, and are the maximum and minimum latitudes of the vertices of the vector surface in the block.
[0057] This equivalent simplified calculation method speeds up the processing speed while ensuring the accuracy of the central longitude and latitude, and is applicable to the processing of large-scale data.
[0058] S202. Create a buffer (Buffer) for storing information, a material object (Material) for rendering buildings, and create a glTF format extension (Extensions) to store field information.
[0059] It should be noted that glTF is an extensible 3D model format. The glTF format extensions used in this embodiment are the extensions "EXT_mesh_features" and "EXT_structural_metadata" in the glTF standard that specifically define attribute information and attribute table fields for 3D models. GlTF format extensions are mainly used to introduce new attributes, parameter semantics, reserved IDs, or new container formats. They are developed for specific glTF versions and may be upgraded to official functions in future versions. Additionally, following general practices, glTF format extensions need to be declared through the extensionsUsed and extensionsRequired fields to ensure that the engine can detect supportability.
[0060] S203. For each vector surface feature in the current block, calculate the spatial coordinates of each vertex after conversion to a 3D model based on the previously calculated longitude and latitude of the overall center of the current block and the height information of the vector surface feature in the vector data attribute table. At the same time, calculate the vertex indices of each face of the 3D model (i.e., the indices of all vertices that make up this face feature), the normal vectors of each face, and the feature numbers corresponding to the vector surface features in the vector data attribute table, and store them in the corresponding arrays respectively.
[0061] In this embodiment, before converting two-dimensional vector surface features into a three-dimensional model, it is necessary to pre-define a spatial rectangular coordinate system. Specifically, when converting each vector surface feature in the current block into a three-dimensional model, the overall center of the current block should be used as the origin. At the same time, the longitude eastward is used as the X-axis, the vertical upward from the ground surface is used as the Y-axis, and the latitude southward is used as the Z-axis. Thus, a three-dimensional spatial rectangular coordinate system is established, and the vertex coordinates of the three-dimensional model are calculated for each block in its respective spatial rectangular coordinate system. Different from the coordinate system where the vertices of the two-dimensional vector surface feature data are located, in this embodiment, the coordinate transformation of each vector surface feature needs to be performed according to the following formula:
[0062] (3)
[0063] (4)
[0064] (5)
[0065] In the formula, ([[]] ) is the longitude and latitude coordinates of the overall center of the current block, ([[]] ) is the vertex coordinates before conversion in the vector surface feature, where the coordinate value z is the height information recorded in the vector data attribute table of the vector surface feature, and ([[]] ) is the vertex coordinates after conversion.
[0066] In addition, it should be noted that each face in the three-dimensional model of a building is generally a polygon with the number of sides greater than or equal to 4. For example, the building facade containing special-shaped structures may form polygon outlines such as pentagons or hexagons. Therefore, when calculating the indices of the vertices of each face of the three-dimensional model, the ear clipping algorithm needs to be used to divide the vector surface of the three-dimensional model into multiple triangles, calculate the face vertex indices and normals of each triangular face, and store the face vertex indices of these triangular faces separately. The vertices of each triangle after triangulation are stored in order as index values (instead of storing coordinates repeatedly) to form the corresponding face vertex indices. For example, after a quadrilateral is decomposed into two triangles, it may be stored as two sets of face vertex indices, such as [0, 1, 2] and [0, 2, 3].
[0067] S204. Convert the vertex coordinates, each face vertex index, normal, and feature number stored in the array into binary data and store them in the buffer separately, and create a buffer view (BufferView) and an accessor (Accessor) for these four types of data respectively.
[0068] S205. Traverse the vector data attribute table of all vector surface elements corresponding to the current block, concatenate each field in it into an attribute string in string form, store the attribute string of each field and the string length offset in the buffer, and create a first buffer view corresponding to each field respectively.
[0069] Specifically, for the vector data attribute table of all vector surface elements corresponding to the current block, each attribute field data can be extracted, and each row in the attribute field data corresponds to the corresponding attribute value of a vector surface element. The program first converts the attribute information of each row in the attribute field data into string form, then concatenates each row of strings into a total attribute string, and at the same time records the string length offset of each row of strings in the attribute string (that is, used to determine the starting position of each row of strings, and each row of strings can be restored from the total attribute string later). Finally, the attribute string and the recorded string length offset are stored in the buffer, and a corresponding second buffer view needs to be created for each attribute field for the attribute string and the string length offset respectively.
[0070] S206. Create a primitive that contains the accessor described in S204.
[0071] S207. Then create a mesh that contains the primitive described in S206.
[0072] S208. Store the second buffer views corresponding to the attribute strings and string offsets of each attribute field in S205 in the glTF format extension created in S202.
[0073] S209. Integrate the buffers, buffer views, accessors, materials, primitives, meshes, and glTF format extensions generated in the above steps S201 - S208 to create glTF data and save it as a glb format file. Thus, the glb file of the current block is successfully created.
[0074] S3. Using the overall central longitude and latitude of each block as a spatial index, create a JSON file to organize the glb files corresponding to each block and generate 3D Tiles data.
[0075] It should be noted that the above specific method of creating a JSON file to organize the glb files corresponding to each block belongs to the standard method of generating 3D Tiles data. Since the entire area is divided into blocks in the present invention and a glb file is generated for each block separately, the longitude and latitude of the overall center of each block need to be used as the spatial index when creating the JSON file. The longitude and latitude of the overall center of each block are recorded as the geographical spatial anchor points of the area in the JSON metadata, providing a basis for LOD (Level of Detail) scheduling for 3D Tiles, enabling the rendering engine to dynamically load the glb files of the corresponding blocks according to the viewpoint position. As Figure 2 shown, the 3D Tiles data file contains the tileset.json file and the glb files of each block. Glbfile 1, glb file 2, glb file n represent the glb files of n all blocks respectively. A single glb file needs to contain Material, Accessor, BufferView, Buffer, Mesh, Nodes, Scenes list, and Current Scene.
[0076] In summary, the present invention performs block processing on large-scale two-dimensional vector data to generate corresponding glb files respectively, thereby forming a segmented three-dimensional urban building model, which can enable the web page to only display the three-dimensional model blocks within the line of sight and improve the loading speed. In addition, the way of storing the building attribute information in the present invention not only ensures that users can query the attribute information of each building by clicking, but also makes the three-dimensional model blocks containing multiple buildings become a primitive, significantly reducing the number of primitives that need to be rendered on the web page, thereby improving the loading and rendering efficiency.
[0077] It should be noted that the method steps shown in S1~S3 above can essentially be implemented in the form of a computer program.
[0078] Thus, based on the same inventive concept, as Figure 3 shown, the present invention also provides a large-scale urban three-dimensional body generation system based on geographical vectors corresponding to the large-scale urban three-dimensional body generation method based on geographical vectors provided in the above embodiment, which includes the following functional modules:
[0079] A data acquisition module, configured to acquire two-dimensional vector data composed of vector surface elements of all buildings within the target range and the corresponding vector data attribute table, and divide the vector surface elements into blocks formed by gridifying the target range according to the spatial position;
[0080] The block glb file generation module is used to determine an overall center for each block, and create a buffer for storing information, a material object for rendering buildings, and a glTF format extension for storing field information. Then, with the overall center corresponding to the current block as the origin of the current block coordinate system, combined with the height information in the vector data attribute table, each vector surface feature in the current block is converted into a 3D model. Next, the spatial coordinates of each vertex, the vertex indices of each face, the normal of each face, and the feature numbers of the vector surface features of the 3D model are calculated in the current block coordinate system, stored in an array form, and further converted into binary data and classified and stored in the buffer. First buffer views and accessors are created for these four types of data respectively. Then, each attribute field and the string length offset in the vector data attribute table are stored in the buffer in string form, and corresponding second buffer views are created respectively. Finally, a primitive containing the accessor and a mesh containing the primitive are created, the second buffer view is stored in the glTF format extension, and combined with the buffer, the first buffer view, the second buffer view, the accessor, the material object, the primitive, the mesh, and the glTF format extension, glTF data is created and saved as the glb file corresponding to the current block.
[0081] The 3D Tiles data generation module is used to create a JSON file to organize the glb files corresponding to each block with the longitude and latitude of the overall center of each block as the spatial index, and generate 3D Tiles data.
[0082] Thus, based on the same inventive concept, as Figure 4 shown, the present invention also provides a computer electronic device corresponding to the method for generating a large-scale urban three-dimensional body based on geographic vectors provided in the above embodiments, which includes a memory and a processor;
[0083] The memory is used to store a computer program;
[0084] The processor is used to implement the method for generating a large-scale urban three-dimensional body based on geographic vectors as described above when executing the computer program;
[0085] In addition, when the logical instructions in the above memory are implemented in the form of software functional units and sold or used as an independent product, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention.
[0086] Accordingly, based on the same inventive concept, the present invention provides a computer-readable storage medium corresponding to a method for generating a large-scale urban three-dimensional model based on geographical vectors. A computer program is stored on the storage medium, and when the computer program is executed by a processor, the method for generating a large-scale urban three-dimensional model based on geographical vectors as described above can be implemented.
[0087] Accordingly, based on the same inventive concept, the present invention provides a computer program product, including a computer program / instructions. When the computer program / instructions are executed by a processor, the method for generating a large-scale urban three-dimensional model based on geographical vectors as described above can be implemented.
[0088] Specifically, in the computer-readable storage media of the above three embodiments, the stored computer program is executed by a processor, and the steps of S1 to S3 described above can be executed.
[0089] It can be understood that the above storage medium may include a random access memory (RAM), and may also include a non-volatile memory (NVM), such as at least one disk memory. At the same time, the storage medium may also be various media that can store program codes, such as a USB flash drive, a mobile hard disk, a magnetic disk, or an optical disc.
[0090] It can be understood that the above-mentioned processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0091] In addition, it should be noted that those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the system described above can refer to the corresponding process in the foregoing method embodiments, and will not be elaborated herein. In each embodiment provided by the present application, the division of steps or modules in the system and method is only a logical function division, and there may be other division methods in actual implementation. For example, multiple modules or steps may be combined or integrated together, and one module or step may also be split.
[0092] The embodiments described above are only a preferred solution of the present invention, but they are not intended to limit the present invention. Those of ordinary skill in the relevant technical field can still make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, all technical solutions obtained by means of equivalent replacement or equivalent transformation fall within the protection scope of the present invention.
Claims
1. A method for generating a large-scale urban three-dimensional volume based on geographic vectors, characterized in that: include: S1. Obtain two-dimensional vector data consisting of vector surface elements of all buildings within the target range and a corresponding vector data attribute table, and divide the vector surface elements into blocks formed by gridding the target range according to spatial positions; S2, determine an overall center for each block, and create a buffer for storing information, a material object for rendering buildings, and a glTF format extension for storing field information; then use the overall center corresponding to the current block as the origin of the current block coordinate system, combine the height information in the vector data attribute table, convert each vector surface element in the current block into a three-dimensional model, and then calculate the spatial coordinates of each vertex of the three-dimensional model, each face vertex index, each face normal, and the element number of the vector surface element in the current block coordinate system, and store them in the form of an array and then further convert them into binary data and store them in the buffer in a classified manner, and create a first buffer view and an accessor for these four types of data respectively; then store each attribute field and string length offset in the vector data attribute table in the form of a string in the buffer, and create corresponding second buffer views respectively; finally, create a primitive containing the accessor and a mesh containing the primitive, store the second buffer view in the glTF format extension, combine the buffer, the first buffer view, the second buffer view, the accessor, the material object, the primitive, the mesh, and the glTF format extension, create glTF data and save it as a glb file corresponding to the current block; S3. Use the overall center longitude and latitude of each block as the spatial index, create a JSON file to organize the glb files corresponding to each block, and generate 3D Tiles data.
2. The method for generating a large-scale urban three-dimensional volume based on geographic vectors according to claim 1, characterized in that: The target range is gridded according to a preset block size, and then all vector surface elements in the two-dimensional vector data are divided into blocks according to the spatial topological relationship between the vector surface elements and the blocks.
3. The method for generating a large-scale urban three-dimensional volume based on geographic vectors according to claim 1, characterized in that: The longitude of the overall center of each block is the average of the maximum longitude and the minimum longitude of all vector surface elements within the block, and the latitude of the overall center is the average of the maximum latitude and the minimum latitude of all vector surface elements within the block.
4. The method for generating a large-scale urban three-dimensional volume based on geographic vectors according to claim 1, characterized in that: For each block, when converting each vector surface feature in the current block into a three-dimensional model, the overall center corresponding to the current block is used as the origin, and a spatial rectangular coordinate system is established with longitude east as the X-axis, vertical surface upward as the Y-axis, and latitude south as the Z-axis. Each block calculates the vertex coordinates of the three-dimensional model in its own spatial rectangular coordinate system.
5. The method for generating a large-scale urban three-dimensional volume based on geographic vectors according to claim 1, characterized in that: When converting vector surface features into a three-dimensional model of a building, you need to first use the ear clipping algorithm to divide the three-dimensional model into multiple triangular faces, and calculate and store the vertex index and normal of each triangular face.
6. The method for generating a large-scale urban three-dimensional volume based on geographic vectors according to claim 1, characterized in that: The attributes of the primitives store vertex coordinates, vertex indices of each face, normals and buffer views corresponding to element numbers, and also store the materials used in the three-dimensional building model and the attribute fields of the corresponding vector surface elements in the vector data attribute table.
7. A large-scale urban three-dimensional volume generation system based on geographic vectors, characterized in that: include: A data acquisition module is used to acquire two-dimensional vector data consisting of vector surface elements of all buildings within the target range and a corresponding vector data attribute table, and divide the vector surface elements into blocks formed by gridding the target range according to spatial positions; The block glb file generation module is used to determine an overall center for each block, and create a buffer for storing information, a material object for rendering buildings, and a glTF format extension for storing field information; then, the overall center corresponding to the current block is used as the origin of the current block coordinate system, and each vector surface element in the current block is converted into a three-dimensional model in combination with the height information in the vector data attribute table, and then the spatial coordinates of each vertex of the three-dimensional model, the index of each face vertex, the normal of each face, and the element number of the vector surface element are calculated in the current block coordinate system, and stored in the form of an array and further converted into binary data for classification storage. The first buffer view and the second buffer view are stored in the buffer, and the first buffer view and the accessor are created for the four types of data respectively; each attribute field and the string length offset in the vector data attribute table are stored in the buffer in the form of a string, and the corresponding second buffer views are created respectively; finally, a primitive including the accessor and a mesh including the primitive are created, the second buffer view is stored in the glTF format extension, and the glTF data is created and saved as a glb file corresponding to the current block by combining the buffer, the first buffer view, the second buffer view, the accessor, the material object, the primitive, the mesh and the glTF format extension; The 3D Tiles data generation module is used to create a JSON file to organize the glb files corresponding to each block, using the overall center longitude and latitude of each block as the spatial index, and generate 3D Tiles data.
8. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, it can implement the large-scale urban three-dimensional body generation method based on geographic vectors as described in any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method for generating a large-scale urban three-dimensional body based on geographic vectors as described in any one of claims 1 to 7 is implemented.
10. A computer electronic device, characterized in that: including memory and processor; The memory is used to store computer programs; The processor is used to implement the large-scale urban three-dimensional body generation method based on geographic vectors as described in any one of claims 1 to 7 when executing the computer program.
Citation Information
Patent Citations
3D Tiles format model bounding box data generation method for realizing oblique photography model based on Cesium
CN112184908A
Method for performing three-dimensional rendering on two-dimensional vector
CN113421338A
Three-dimensional model merging processing method and device and medium
CN115294312A
Method and system for converting DWG model into GLTF model
CN115546399A
Indoor scene wireless channel modeling method based on laser radar sensing reconstruction
CN119853833A
Cited By
Multi-source heterogeneous spatio-temporal data fusion modeling method and system
CN121070899A
A multi-source heterogeneous spatio-temporal data fusion modeling method and system
CN121070899B