Method and system for generating large-scale urban 3D volumes based on geographic vectors
Through block processing and glTF format expansion, the problems of low generation efficiency and slow loading of three-dimensional model are solved, and the efficient generation and loading of three-dimensional model data is achieved, which is suitable for smart city applications.
Patent Information
- Application Number
- CN202510518745.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2045-04-24
AI Technical Summary
In the prior art, the three-dimensional model data generation efficiency is low, the format is not conducive to efficient loading of front-end web pages, and there is a lack of a method to efficiently convert two-dimensional vector data into 3D Tiles format, resulting in low conversion efficiency and inability to store attribute information.
By blocking the two-dimensional vector data, expanding the storage attribute information using the glTF format, converting it into a three-dimensional model with the block center as the origin, generating a glb file, and combining the 3D Tiles data structure, efficient generation of large-scale urban three-dimensional bodies is achieved.
It realizes the rapid generation of large-scale three-dimensional models and efficient loading of web pages, retains attribute information, and improves the generation efficiency and loading speed of three-dimensional models.
Smart Images

Figure CN120070797B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of GIS, and in particular relates to a method and system for generating large-scale urban three-dimensional bodies based on geographic vectors. Background Art
[0002] 3D model data is typically generated manually. However, in areas like smart cities, the amount of data required is large, manual modeling is inefficient, and the model format is not conducive to efficient loading on front-end web pages. Experts, scholars, research institutions, and commercial companies around the world have conducted extensive research on the storage of 3D model data. The main existing 3D model storage formats are: 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 3D model geometry, making it an ideal choice for storing and exchanging 3D models. However, while the OBJ format can effectively handle complex structural representations, it is limited in its support for complex materials and animation information. Furthermore, the OBJ format has difficulty storing 3D models containing multiple parts.
[0004] Both FBX and DAE formats have gained a place in the 3D modeling and animation industry due to their wide support and cross-platform compatibility. They are both able to effectively process complex geometric data and texture information. However, both formats have the problem of large file size and low loading efficiency on front-end web pages.
[0005] The glTF format has become the preferred format for 3D models due to its relatively lightweight file size and fast loading performance on web pages. It supports many features required for modern 3D, including textures, animations, and lighting effects, making it easy for developers to load 3D models in this format on various platforms. However, the glTF format can still have a relatively large file size for very complex and highly detailed 3D models.
[0006] The 3D Tiles format is used for efficiently transmitting and rendering large-scale three-dimensional geospatial data. It supports multiple resolutions, allowing for the request of 3D tiles at varying levels of detail based on viewing distance and performance requirements. It also saves memory and improves rendering efficiency through on-demand loading. Furthermore, the format offers excellent scalability and interoperability, supporting a variety of materials, textures, and other attributes. Its open standard facilitates sharing and integration across different platforms, and glTF can be used as a tile format. However, there is currently a lack of computer programs that can directly convert 2D vector data into 3D model data in the 3D Tiles format. Some programs are capable of converting 2D vector data to the 3D Tiles format, but these programs suffer from low conversion efficiency and an inability to store the vector data's original attribute table information.
[0007] Therefore, the present invention proposes a method and system for generating large-scale urban three-dimensional bodies based on geographic vectors, and constructs a conversion method that satisfies the requirements of efficient loading of three-dimensional models and retention of 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 geographic vectors.
[0009] The specific technical solutions adopted in the present invention are as follows:
[0010] In a first aspect, the present invention provides a method and system for generating a large-scale urban three-dimensional volume based on geographic vectors, comprising:
[0011] S1. Obtain two-dimensional vector data consisting 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 gridding the target range according to their 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, using the overall center corresponding to the current block as the origin of the current block's coordinate system and combining it with the height information in the vector data attribute table, convert each vector surface feature in the current block into a three-dimensional model. Calculate the spatial coordinates of each vertex, each face vertex index, each face normal, and the element number of the vector surface feature in the three-dimensional model in the current block coordinate system. After storing them in array form, convert them into binary data and classify them in the buffer. Create a first buffer view and an accessor for each of these four types of data. Then, store each attribute field and string length offset in the vector data attribute table in string form in the buffer, and create corresponding second buffer views for each of them. 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 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. Using 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.
[0014] As a preferred embodiment of the first aspect, 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.
[0015] As a preferred embodiment of the above-mentioned first aspect, the longitude of the overall center of each block is the average of the maximum longitude and 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 minimum latitude of all vector surface elements within the block.
[0016] As a preferred embodiment of the above-mentioned first aspect, for each block, when converting each vector surface element 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 the longitude east as the X-axis, the vertical surface upward as the Y-axis, and the latitude south as the Z-axis. Each block calculates the vertex coordinates of the three-dimensional model in its own spatial rectangular coordinate system.
[0017] As a preferred embodiment of the first aspect, when converting vector surface elements into a three-dimensional model of a building, it is necessary to first use an ear clipping algorithm to divide the three-dimensional model into multiple triangular faces, and calculate and store the face vertex index and normal of each triangular face.
[0018] As a preferred embodiment of the above-mentioned first aspect, 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 model of the building and the attribute fields of the corresponding vector surface elements in the vector data attribute table.
[0019] In a second aspect, the present invention provides a large-scale urban three-dimensional volume generation system based on geographic vectors, comprising:
[0020] A data acquisition module is used to obtain two-dimensional vector data consisting 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 the target range grid according to their spatial positions;
[0021] A block glb file generation module is configured 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. The module then uses the overall center corresponding to the current block as the origin of the current block's coordinate system and, in combination with height information in the vector data attribute table, converts each vector surface element in the current block into a three-dimensional model. The module then calculates the spatial coordinates of each vertex, each face vertex index, each face normal, and the element number of each vector surface element in the three-dimensional model in the current block's coordinate system. The calculated data are then stored in array form and further converted into binary data, which are then classified and stored in the buffer. A first buffer view and accessor are created for each of the four types of data. Each attribute field and string length offset in the vector data attribute table are then stored in the buffer in string form, and corresponding second buffer views are created for each of the four types of data. 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 the buffer, first buffer view, accessor, material object, primitive, mesh, and glTF format extension are combined to create glTF data and save it as a 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 using the overall center longitude and latitude of each block as the spatial index to generate 3D Tiles data.
[0023] In a third aspect, the present invention provides a computer program product comprising a computer program / instruction, which, when executed by a processor, can implement the method for generating large-scale urban three-dimensional bodies based on geographic vectors as described in any one of the solutions in the first aspect above.
[0024] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon. 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 the solutions in the first aspect above can be implemented.
[0025] In a fifth aspect, the present invention provides a computer electronic device comprising a memory and a processor;
[0026] The memory is used to store computer programs;
[0027] The processor is configured to implement the method for generating a large-scale urban three-dimensional body based on geographic vectors as described in any one of the solutions of the first aspect above when executing the computer program.
[0028] Compared with the prior art, the present invention has the following beneficial effects:
[0029] The present invention achieves efficient generation of corresponding three-dimensional model data by performing block processing and attribute information storage on large-scale two-dimensional vector data. This invention balances the speed of converting large-scale vector data into three-dimensional model data with the integrity and efficiency of loading three-dimensional models on web pages. This not only satisfies the rapid generation of large-scale three-dimensional models, but also addresses the issues of slow rendering speed and difficulty displaying attribute information for each sub-model when loading three-dimensional models on web pages. This invention can improve the efficiency of three-dimensional model generation and the integrity of attribute information, and is of fundamental significance to smart city applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 A flowchart of the steps of a method for generating large-scale urban 3D volumes based on geographic vectors;
[0031] Figure 2 The format of 3D Tiles data;
[0032] Figure 3 This is a schematic diagram of the module composition of a large-scale urban 3D volume generation system based on geographic vectors;
[0033] Figure 4 It is a structural diagram of computer electronic equipment. DETAILED DESCRIPTION
[0034] In order to make the above-mentioned objects, features and advantages of the present invention more clearly understood, the specific embodiments of the present invention are described in detail below with reference to the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways than those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below. The technical features in the various embodiments of the present invention can be combined accordingly without conflicting with each other.
[0035] The present invention provides a method and system for generating large-scale urban three-dimensional bodies based on geographic vectors. Specifically, the method can be used for the efficient generation of three-dimensional building models for smart cities. The application of smart cities requires large-scale three-dimensional urban building models, which can not only help decision makers understand spatial relationships and evaluate design plans in a more intuitive way, but also help decision makers quickly locate and evaluate affected areas in emergencies such as natural disasters. Three-dimensional building model data is usually generated by manual modeling, but manual modeling is inefficient, and the format of the model is not conducive to efficient loading of front-end web pages. 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 for converting large-scale two-dimensional vector data into three-dimensional model data provided by the present invention can fully utilize the advantages of two-dimensional vector data and convert it into three-dimensional model data with large scale, high web page loading efficiency, and rich attribute information, providing basic model data support for 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 large, and its data volume is at the level of hundreds of PB or above, but does not limit its specific data size.
[0037] In a preferred embodiment of the present invention, Figure 1 As shown, the method for generating a large-scale urban three-dimensional volume based on geographic vectors includes steps S1 to S3, and the specific implementation of each step is described in detail below.
[0038] S1. Obtain two-dimensional vector data consisting 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 gridding the target range according to spatial positions.
[0039] It should be noted that the target range mentioned in the present invention refers to the area range where the urban three-dimensional body needs to be generated, which can be selected according to actual conditions and is not limited to a specific area. The urban three-dimensional body refers to a three-dimensional model in the city that needs to be three-dimensionally visualized, and in the present invention, it refers to a building. The vector surface element of a building generally refers to the projection surface of the building on the ground, that is, the bottom surface of the building, which is a two-dimensional vector surface element. The attribute information of all vector surface elements in the two-dimensional vector data is recorded in the vector data attribute table and also needs to be obtained together. In this embodiment, the input two-dimensional vector data contains all the building bottom surface data that need to be converted into a three-dimensional model. Among them, the attribute table of the building bottom surface data must include a height field, and the height field stores the building height of each building.
[0040] In an embodiment of the present invention, the above-mentioned S1 step can allow the user to specify the target range and input two-dimensional vector data through an interface, a GUI interface, etc., and can also set the output path and the grid size of the grid. Thus, the two-dimensional vector data can be directly input or read according to the path specified by the user. Taking the specified path as an example, the program can read the two-dimensional vector data from the storage end of the two-dimensional vector data based on the two-dimensional vector data, output path and grid size input by the user, and divide each vector surface element in the data into different blocks according to its own spatial position. The vector surface elements allocated in each block can each undergo subsequent data processing to generate glTF data.
[0041] In the glTF data format, a series of elements such as buffers, buffer views, accessors, materials, primitives, meshes, etc. need to be covered, which together define the geometry, materials, and rendering methods 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 and do not contain any structure information.
[0043] A buffer view (BufferView) is a reference to a portion of data in a Buffer, defining the starting offset (byteOffset) and length (byteLength) of the data.
[0044] Accessors define how to read structured data from a BufferView, including data types (such as FLOAT and UNSIGNED_SHORT), data formats (such as VEC3), quantities (such as the number of vertices), and more.
[0045] 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, consisting of a set of vertex attributes (such as position, normal), index data, and an associated material.
[0047] A mesh consists of one or more primitives and represents a complete 3D object (such as a 3D model of a building with a specified material).
[0048] The internal formats and definitions of the above buffers, buffer views, accessors, materials, primitives, and grids are all prior art and will not be described in detail. The following mainly describes how to construct the glb text in each block.
[0049] 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, using the overall center corresponding to the current block as the origin of the current block's coordinate system and combining it with the height information in the vector data attribute table, convert each vector surface feature in the current block into a three-dimensional model. Calculate the spatial coordinates of each vertex, each face vertex index, each face normal, and the element number of the vector surface feature in the three-dimensional model in the current block's coordinate system. After storing them in array form, convert them into binary data and classify them in the buffer. Create first buffer views and accessors for each of these four types of data. Store each attribute field and string length offset in the vector data attribute table in string form in the buffer, and create corresponding second buffer views for each of them. Finally, create a primitive containing the accessor and a mesh containing the primitive, store the second buffer view in the glTF format extension, and create glTF data by combining the buffer, first buffer view, accessor, material object, primitive, mesh, and glTF format extension. Save the data as a glb file corresponding to the current block.
[0050] It should be noted that since each block requires a corresponding GLB file to be generated, this process is equivalent to traversing all blocks. Therefore, for ease of description, each block currently generating a corresponding GLB file is referred to as the current block. However, in reality, the process of generating corresponding GLB files for different blocks can be serial or parallel. If the data volume is large, distributed parallel computing can be used to improve overall generation efficiency.
[0051] In an embodiment of the present invention, for any current block, the preferred process of generating the corresponding glb file is as follows:
[0052] S201, calculating and storing the overall center longitude and latitude of all vector surfaces in the current block;
[0053] In this embodiment, the overall center of the current block can theoretically be a geometric center, centroid, etc. Since the current block contains a series of vector surface elements with different longitudes and latitudes, an overall center can be equivalently determined based on the longitudes and latitudes of the vertices of these vector surface elements. Specifically, when calculating the longitude and latitude of the overall center, the longitude of the overall center is the average of the maximum longitude and minimum longitude of each vertex of the vector surface, and the latitude of the overall center is the average of the maximum latitude and minimum latitude of each vertex of the vector surface. The longitude and latitude calculation formula of the overall center is as follows:
[0054] (1)
[0055] (2)
[0056] Where, and are the overall center longitude and latitude of the current block, and are the maximum and minimum longitudes of the vector surface vertices in the block, and The maximum and minimum latitudes of the vector surface vertices in the block.
[0057] This equivalent simplified calculation method speeds up the processing while ensuring the accuracy of the center longitude and latitude, and is suitable for processing large-scale data.
[0058] S202: Create a buffer for storing information, a material object for rendering the building, and a glTF format extension for storing field information.
[0059] It should be noted that glTF is an extensible 3D model format. The glTF format extensions used in this example are the "EXT_mesh_features" and "EXT_structural_metadata" extensions to the glTF standard, which define attribute information and attribute table fields specifically for 3D models. glTF format extensions are primarily 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 features in future versions. Furthermore, as a general practice, glTF format extensions must be declared using the "extensionsUsed" and "extensionsRequired" fields to ensure that the engine can detect support.
[0060] S203. For each vector surface element in the current block, based on the previously calculated overall center longitude and latitude of the current block and the height information of the vector surface element in the vector data attribute table, calculate the spatial coordinates of each vertex after conversion into a three-dimensional model. At the same time, calculate the vertex index of each face of the three-dimensional model (and the index of all vertices that constitute this face element), the normal of each face, and the element number corresponding to the vector surface element in the vector data attribute table, and store them in the corresponding arrays respectively.
[0061] In this embodiment, before converting the two-dimensional vector surface elements into a three-dimensional model, it is necessary to predefine a spatial rectangular coordinate system. Specifically, when converting each vector surface element in the current block into a three-dimensional model, it is necessary to use the overall center corresponding to the current block as the origin, and at the same time use the longitude eastward as the X-axis, the vertical surface upward as the Y-axis, and the latitude southward as the Z-axis to establish a three-dimensional spatial rectangular coordinate system. Each block calculates the vertex coordinates of the three-dimensional model in its own spatial rectangular coordinate system. Different from the coordinate system of the vertices of the two-dimensional vector surface element data, in this embodiment, it is necessary to perform coordinate conversion on each vector surface element according to the following formula:
[0062] (3)
[0063] (4)
[0064] (5)
[0065] Where, ( ) is the latitude and longitude coordinates of the overall center of the current block, ( ) is the vertex coordinate of the vector surface feature before conversion, where the coordinate value z is the height information recorded in the vector data attribute table of the vector surface feature, ( ) are the transformed vertex coordinates.
[0066] It should also be noted that each face in the three-dimensional model of a building is generally a polygon with four or more sides. For example, the facade of a building containing an irregular structure may form a polygonal outline such as a pentagon or hexagon. Therefore, when calculating the index of the vertices of each face of the three-dimensional model, it is necessary to use the ear clipping algorithm to divide the vector face of the three-dimensional model into multiple triangles, calculate the face vertex index and normal of each triangular face, and store the face vertex index of these triangular faces separately. The vertices of each triangle after triangulation are stored in sequence as index values (rather than repeatedly storing coordinates), forming the corresponding face vertex index. 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 , converting the vertex coordinates, face vertex indices, normals, and element numbers stored in the array into binary data, classifying and storing them in a buffer, and creating buffer views (BufferView) and accessors (Accessor) for these four types of data respectively.
[0068] S205. Traverse the vector data attribute tables of all vector surface elements corresponding to the current block, concatenate each field therein in the form of a string to form an attribute string, store the attribute string and string length offset of each field in a buffer, and create a first buffer view corresponding to each field respectively.
[0069] Specifically, for the vector data attribute table of all vector surface features corresponding to the current block, each attribute field data can be extracted. Each row in the attribute field data corresponds to the corresponding attribute value of a vector surface feature. The program first converts the attribute information of each row in the attribute field data into a string format, then concatenates each row of strings into a total attribute string, and simultaneously records the string length offset of each row of strings in the attribute string (that is, used to determine the starting position of the row of strings, and each row of strings can be subsequently restored from the total attribute string). Finally, the attribute string and the recorded string length offset are stored in the buffer. For each attribute field, a corresponding second buffer view needs to be created for the attribute string and string length offset.
[0070] S206. Create a primitive containing the accessor described in S204.
[0071] S207. Create a mesh containing the primitives described in S206.
[0072] S208. Store the attribute string and the second buffer view corresponding to each attribute field in S205 in the glTF format extension created in S202.
[0073] S209: Integrate the buffer, buffer view, accessor, material, primitive, mesh, and glTF format extension generated in steps S201-S208 to create glTF data and save it as a glb file. The glb file for the current block is now created.
[0074] S3. Using 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.
[0075] It should be noted that the specific practice of creating a JSON file to organize the glb files corresponding to each block is a standard practice for generating 3D Tiles data. Since the entire area is divided into blocks in the present invention, a glb file is generated for each block separately. Therefore, when creating the JSON file, the overall center longitude and latitude of each block needs to be used as the spatial index. The overall center longitude and latitude of each block serves as the geographic spatial anchor point of the area and is recorded in the JSON metadata to provide a LOD (multi-level of detail) scheduling basis for 3D Tiles, so that the rendering engine can dynamically load the glb file of the corresponding block according to the viewpoint position. Figure 2 As shown, the 3D Tiles data file contains the tileset.json file and glb files for each tile. glbfile 1, glb file 2, and glb file n represent the glb files for all n tiles, respectively. A single glb file must contain materials, accessors, buffer views, buffers, meshes, nodes, scenes, and the current scene.
[0076] In summary, the present invention processes large-scale 2D vector data into blocks and generates corresponding glb files, thereby forming a segmented 3D urban building model. This allows web pages to display only the 3D model blocks within the visual range, improving loading speed. Furthermore, the method used to store building attribute information not only ensures that users can query the attribute information of each building with a single click, but also allows 3D model blocks containing multiple buildings to be combined into a single primitive, significantly reducing the number of primitives required for web page rendering, thereby improving loading and rendering efficiency.
[0077] It should be noted that the method steps shown in S1 to S3 above can essentially be implemented in the form of a computer program.
[0078] Therefore, based on the same inventive concept, Figure 3 As shown, the present invention also provides a large-scale urban 3D volume generation system based on geographic vectors corresponding to the large-scale urban 3D volume generation method based on geographic vectors provided in the above embodiment, which includes the following functional modules:
[0079] A data acquisition module is used to obtain two-dimensional vector data consisting 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 the target range grid according to their spatial positions;
[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, the overall center corresponding to the current block is used as the origin of the current block coordinate system, and combined with the height information in the vector data attribute table, each vector surface element in the current block is converted into a three-dimensional model. 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 first buffer views and accessors are created for the four types of data respectively; each attribute field and the string length offset in the vector data attribute table are then 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 the buffer, the first buffer view, the second buffer view, the accessor, the material object, the primitive, the mesh, and the glTF format extension are combined to create glTF data and save it as a 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 using the overall center longitude and latitude of each block as the spatial index to generate 3D Tiles data.
[0082] Therefore, based on the same inventive concept, Figure 4 As shown, the present invention also provides a computer electronic device corresponding to the method for generating a large-scale urban three-dimensional volume based on geographic vectors provided in the above embodiment, which includes a memory and a processor;
[0083] The memory is used to store computer programs;
[0084] The processor is configured to implement the aforementioned method for generating a large-scale urban three-dimensional volume based on geographic vectors when executing the computer program;
[0085] Furthermore, the logic instructions in the aforementioned memory can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention.
[0086] Therefore, 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 body based on geographic vectors, and a computer program is stored on the storage medium. 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 above.
[0087] Therefore, based on the same inventive concept, the present invention provides a computer program product, including a computer program / instruction, which, when executed by a processor, can implement the aforementioned method for generating large-scale urban three-dimensional bodies based on geographic vectors.
[0088] Specifically, in the computer-readable storage medium of the above three embodiments, the stored computer program is executed by the processor to perform the above steps S1 to S3.
[0089] It is understood that the storage medium may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Furthermore, the storage medium may be any medium capable of storing program code, such as a USB flash drive, a mobile hard drive, a magnetic disk, or an optical disk.
[0090] It is understandable that the above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can 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, and discrete hardware components.
[0091] It should also 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 aforementioned method embodiment, and will not be repeated here. In the various embodiments provided in this application, the division of steps or modules in the system and method is only a logical function division. In actual implementation, there may be other division methods, for example, multiple modules or steps can be combined or integrated together, and a module or step can also be split.
[0092] The embodiment described above is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Persons skilled in the art may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, any technical solution obtained by equivalent substitution or equivalent transformation falls within the scope of protection of the present invention.
Claims
1. A method for generating large-scale urban three-dimensional volumes 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 the corresponding vector data attribute table, and divide the vector surface elements into blocks formed by gridding the target range according to their 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, using the overall center corresponding to the current block as the origin of the current block's coordinate system and combining it with the height information in the vector data attribute table, convert each vector surface feature in the current block into a three-dimensional model. Calculate the spatial coordinates of each vertex, each face vertex index, each face normal, and the element number of the vector surface feature in the three-dimensional model in the current block coordinate system. After storing them in array form, convert them into binary data and classify them in the buffer. Create a first buffer view and an accessor for each of these four types of data. Then, store each attribute field and string length offset in the vector data attribute table in string form in the buffer, and create corresponding second buffer views for each of them. 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 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. S3. Using 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, wherein: 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, wherein: The longitude of the overall center of each block is the average of the maximum longitude and 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 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, wherein: For each block, when converting each vector surface feature in the current block into a three-dimensional model, it is necessary to use the overall center corresponding to the current block as the origin, and establish a spatial rectangular coordinate system 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, wherein: When converting vector surface features into a three-dimensional model of a building, you first need to 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, wherein: The attributes of the primitives store the vertex coordinates, vertex indices of each face, normals and buffer views corresponding to the element numbers. They also store 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.
7. A large-scale urban 3D volume generation system based on geographic vectors, characterized by: include: A data acquisition module is used to obtain two-dimensional vector data consisting 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 the target range grid according to their 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 combined with the height information in the vector data attribute table, each vector surface element in the current block is converted into a three-dimensional model. 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 first buffer views and accessors are created for the four types of data respectively; each attribute field and the string length offset in the vector data attribute table are then 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 the buffer, the first buffer view, the second buffer view, the accessor, the material object, the primitive, the mesh, and the glTF format extension are combined to create glTF data and save it as a glb file corresponding to the current block; 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 to 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 method for generating a large-scale urban three-dimensional body based on geographic vectors as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that The storage medium stores a computer program, and when the computer program is executed by the 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 6 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 configured to implement the method for generating a large-scale urban three-dimensional body based on geographic vectors as described in any one of claims 1 to 6 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
Three-dimensional model merging processing method and device and medium
CN115294312A
Indoor scene wireless channel modeling method based on laser radar sensing reconstruction
CN119853833A