Method, device and equipment for constructing three-dimensional geographic model based on geographic space data
By acquiring geospatial data, extracting and converting it into a 3D OBJ model, and then converting it into GLTF or GLB format to generate a B3DM file, the problems of low efficiency, limited accuracy, and poor compatibility in converting geospatial data into 3D white models are solved, enabling efficient and flexible large-scale 3D geographic model construction.
Patent Information
- Application Number
- CN202511537800.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-24
- Publication Date
- 2026-02-03
AI Technical Summary
Existing technologies struggle to efficiently convert geospatial data such as Shapefile and GeoJSON into 3D white models, resulting in issues like coordinate confusion, low efficiency, limited accuracy, and poor compatibility. In particular, they are costly and difficult to scale in the construction of large-scale 3D geographic models.
By acquiring geospatial data, extracting geometric and attribute information, converting it to the target coordinate system, constructing a 3D OBJ model, and converting it to GLTF or GLB format, a B3DM format file is generated. It supports direct conversion between multiple coordinate systems and uses S2 mesh clipping to split it into tiles, reducing manual intervention and manual modeling.
It achieves efficient conversion from geospatial data to 3D geographic models, reduces the difficulty of data input and reliance on professional modeling, reduces time and economic costs, is suitable for large-scale 3D scene construction at the city or regional level, and improves the flexibility of coordinate transformation and model accuracy.
Smart Images

Figure CN121458897A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of geographic information technology, specifically to a method, apparatus, and equipment for constructing a three-dimensional geographic model based on geospatial data. Background Technology
[0002] The demand for 3D geographic information models is growing in fields such as smart cities, digital twins, and emergency command. However, geospatial data (such as Shapefile and GeoJSON) is the most common raw data format in many Geographic Information Systems (GIS). How to efficiently convert this geospatial data into 3D white models has become a technical problem that needs to be solved. Summary of the Invention
[0003] This disclosure provides a method, apparatus, and device for constructing a three-dimensional geographic model based on geospatial data.
[0004] In a first aspect, this disclosure provides a method for constructing a three-dimensional geographic model based on geospatial data, comprising: Acquire geospatial data; Extract the geometric and attribute information of geographic objects from the geospatial data; The coordinates of the geometric information are transformed to the target coordinate system; the target coordinate system is determined based on user-configured parameters. A 3D OBJ model is constructed based on the geometric information and the attribute information; Export the 3D OBJ model as an OBJ file that records the basic information of the 3D OBJ model and an MTL file that records the attribute information of the 3D OBJ model; The content of the OBJ file is converted into GLTF or GLB format to obtain a GLTF or GLB file, and the attribute information of the geographic object is associated with the corresponding node in the GLTF or GLB file, and the attribute information of the 3D OBJ model in the MTL file is associated with the corresponding node in the GLTF or GLB file. Generate a B3DM format file based on the GLTF or GLB file.
[0005] Furthermore, the geospatial data includes raster and / or vector information of the geographic object.
[0006] Furthermore, a three-dimensional OBJ model is constructed based on the geometric information and the attribute information, including: Based on the height value provided in the attribute information, the geometry of the geographic object is generated by stretching the geometric information of the geographic object. The latitude and longitude in the geometric information and the height value in the attribute information are converted into three-dimensional coordinates by a pre-set coordinate transformation operator. The normal of each vertex of the geographic object in the geometric information is calculated using a pre-set normal calculation operator. The polygons included in the geometry of the geographic object are cut into triangular indices using a pre-set triangular face generation operator.
[0007] Furthermore, before converting the content of the OBJ file to GLTF or GLB format to obtain a GLTF or GLB file, the method further includes: The 3D OBJ model is cut and split into multiple small tiles according to the S2 mesh element affiliation, and the generated tiles correspond one-to-one with the S2 mesh.
[0008] Secondly, embodiments of the present invention provide an apparatus for constructing a three-dimensional geographic model based on geospatial data, comprising: The acquisition module is configured to acquire geospatial data. The extraction module is configured to extract the geometric information and attribute information of geographic objects in the geospatial data; The first transformation module is configured to transform the coordinates of the geometric information to a target coordinate system; the target coordinate system is determined based on user-configured parameters. The building module is configured to build a 3D OBJ model based on the geometric information and the attribute information; The export module is configured to export the 3D OBJ model as an OBJ file that records the basic information of the 3D OBJ model and an MTL file that records the attribute information of the 3D OBJ model. The second conversion module is configured to convert the content of the OBJ file into GLTF or GLB format to obtain a GLTF or GLB file, and to associate the attribute information of the geographic object with the corresponding node in the GLTF or GLB file, and to associate the attribute information of the 3D OBJ model in the MTL file with the corresponding node in the GLTF or GLB file. The generation module is configured to generate a B3DM format file based on the GLTF file or GLB file.
[0009] Furthermore, the geospatial data includes raster and / or vector information of the geographic object.
[0010] Furthermore, the building module is implemented as follows: Based on the height value provided in the attribute information, the geometry of the geographic object is generated by stretching the geometric information of the geographic object. The latitude and longitude in the geometric information and the height value in the attribute information are converted into three-dimensional coordinates by a pre-set coordinate transformation operator. The normal of each vertex of the geographic object in the geometric information is calculated using a pre-set normal calculation operator. The polygons included in the geometry of the geographic object are cut into triangular indices using a pre-set triangular face generation operator.
[0011] Furthermore, prior to the second conversion module, the device further includes: The trimming module is configured to trim and split the 3D OBJ model into multiple small-area tiles according to the S2 mesh unit affiliation, and the generated tiles correspond one-to-one with the S2 mesh.
[0012] The function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above function.
[0013] In one possible design, the above-described device includes a memory and a processor. The memory stores one or more computer instructions that support the device in performing the corresponding methods described above, and the processor is configured to execute the computer instructions stored in the memory. The device may also include a communication interface for communicating with other devices or communication networks.
[0014] Thirdly, embodiments of this disclosure provide an electronic device including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the method described in any of the above aspects.
[0015] Fourthly, embodiments of this disclosure provide a computer-readable storage medium for storing computer instructions used by any of the above-described devices, which, when executed by a processor, are used to implement the methods described in any of the above aspects.
[0016] Fifthly, embodiments of this disclosure provide a computer program product comprising computer instructions which, when executed by a processor, are used to implement the methods described in any of the preceding aspects.
[0017] The technical solutions provided in this disclosure may have the following beneficial effects: This disclosure supports direct processing of widely used geospatial data formats such as Shapefile and GeoJSON without the need for complex data format conversion or preprocessing, reducing the difficulty of data input and the reliance on professional modeling. For scenarios with relatively regular building shapes or only basic white models, this method can replace a large amount of manual 3D modeling work, reducing the reliance on external professional modeling resources, thereby reducing time and economic costs.
[0018] This disclosure automates the entire process from geospatial data parsing, 3D geometry generation, texture processing to B3DM format packaging through programming, significantly reducing the time and effort required for manual intervention and modeling. This method can efficiently process data containing numerous buildings, generating corresponding 3D white models in a single step. It is suitable for large-scale 3D scene construction at the city or regional level, greatly shortening the data preparation cycle. This disclosure offers greater flexibility in geographic coordinate transformation. While CesiumLab supports coordinate transformation, it typically relies on its built-in transformation tools, whereas this disclosure allows users to customize coordinate transformation logic according to actual needs. For example, when processing data from different sources, the solution in this disclosure supports direct conversion between various coordinate systems, including but not limited to WGS84, ECEF, Mercator, etc., without intermediate steps or additional tools. This flexibility makes this disclosure more convenient for processing cross-regional or cross-platform data.
[0019] In application scenarios, this disclosure can more efficiently meet the practical needs of large-scale data processing. For example, when generating 3D white models of urban buildings, this disclosure can quickly process thousands of building foundation data and generate loadable B3DM files in a short time, while other platforms may require batch processing or rely on additional performance optimizations. In addition, when processing cross-regional data, this application can flexibly adjust coordinate transformation parameters to better adapt to the data characteristics of different geographical regions.
[0020] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0021] Other features, objects, and advantages of this disclosure will become more apparent from the following detailed description of non-limiting embodiments, taken in conjunction with the accompanying drawings. The following is a description of the accompanying drawings.
[0022] Figure 1 A flowchart illustrating a method for constructing a three-dimensional geographic model based on geospatial data according to an embodiment of the present disclosure is shown.
[0023] Figure 2 A flowchart illustrating the effect of a three-dimensional modeling process according to an embodiment of the present disclosure is shown.
[0024] Figure 3A and Figure 3B A schematic diagram showing the effect of a white model of a building and a three-dimensional geographic model according to an embodiment of the present disclosure is provided.
[0025] Figure 4 A structural block diagram of an apparatus for constructing a three-dimensional geographic model based on geospatial data according to an embodiment of the present disclosure is shown.
[0026] Figure 5 This is a schematic diagram of the structure of an electronic device suitable for implementing a method for constructing a three-dimensional geographic model based on geospatial data according to an embodiment of the present disclosure. Detailed Implementation
[0027] In the following, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings to enable those skilled in the art to readily implement them. Furthermore, for clarity, portions unrelated to the description of the exemplary embodiments have been omitted from the drawings.
[0028] In this disclosure, it should be understood that terms such as “comprising” or “having” are intended to indicate the presence of features, figures, steps, behaviors, components, parts or combinations thereof disclosed in this specification, and do not preclude the possibility of the presence or addition of one or more other features, figures, steps, behaviors, components, parts or combinations thereof.
[0029] It should also be noted that, unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other. This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.
[0030] The conversion from geospatial data to a 3D white model essentially involves combining geospatial information such as raster and vector data (e.g., the base geometry of a building) with height attributes (e.g., floors, altitude) to generate a 3D model containing only shape and height information. This type of model can quickly provide visualization support for spatial layout and overall form in scenarios such as urban planning, virtual reality, and simulation, and is the foundation for many complex 3D modeling projects.
[0031] Existing methods for building 3D geographic models, especially for modeling large-scale scenes, have the following problems: Coordinate inconsistency: There are problems with the transformation of different geographical coordinates for massive amounts of data, making it difficult to accurately locate the correct position in the display system.
[0032] Low efficiency: It relies on manual operation or semi-automated tools, such as ArcScene and CityEngine, and requires processing building models one by one, which is time-consuming and difficult to scale to a city-level scale.
[0033] Limited accuracy: Manual modeling is prone to human error and it is difficult to guarantee that the height and shape of all models are completely consistent with the original geographic data.
[0034] High cost: The high cost of professional modeling software and labor limits its application in large-scale projects.
[0035] Poor platform compatibility: The generated models come in various formats and often require additional optimization to be compatible with mainstream 3D geographic information platforms (such as Cesium).
[0036] This disclosure addresses the problems of low efficiency, limited accuracy, and poor compatibility in existing technologies, achieving efficient conversion from geospatial data to 3D geographic models, and integrating the Cesium platform to develop a visualization system. This solution not only improves modeling efficiency but also provides technical support for the development and promotion of large-scale 3D geographic information applications.
[0037] The details of the embodiments of this disclosure are described in detail below through specific examples.
[0038] Figure 1 A flowchart illustrating a method for constructing a three-dimensional geographic model based on geospatial data according to an embodiment of the present disclosure is shown. Figure 1 As shown, the method includes the following steps: In step S101, geospatial data is acquired; In step S102, the geometric information and attribute information of geographic objects in the geospatial data are extracted; In step S103, the coordinates of the geometric information are transformed to the target coordinate system; the target coordinate system is determined based on user-configured parameters. In step S104, a three-dimensional OBJ model is constructed based on the geometric information and the attribute information; In step S105, the OBJ model is exported as an OBJ file that records the basic information of the three-dimensional OBJ model and an MTL file that records the attribute information of the three-dimensional OBJ model. In step S106, the content of the OBJ file is converted into GLTF or GLB format to obtain a GLTF or GLB file, and the attribute information of the geographic object is associated with the corresponding node in the GLTF or GLB file, and the attribute information of the 3D OBJ model in the MTL file is associated with the corresponding node in the GLTF or GLB file. In step S107, a B3DM format file is generated based on the GLTF file or GLB file.
[0039] In this embodiment, the geospatial data may be the content of a data file containing information about geographic objects, such as buildings. The data file may be in the format of a Shapefile (.shp and its associated files), GeoJSON (.json), or other formats (such as .tif) that include building outline coordinates and heights. In some embodiments, the geospatial data includes raster and / or vector information of geographic objects.
[0040] In some embodiments, see Figure 2 As shown, Python libraries (such as GDAL / OGR, GeoPandas, etc.) can be used to read and parse the aforementioned data files, extracting geometric information and related attribute information of geographic objects, such as buildings. Geometric information includes information such as polygons and polylines representing building outlines, roofs, floors, etc., while attribute information includes additional information such as geographic object ID, height, and floor number. During the data file parsing process, key geometric elements that define the three-dimensional form of geographic objects can be identified, i.e., the three-dimensional framework information of geographic objects, such as the base polygon of a building, the roof polygon, and possible connecting lines or polylines between floors.
[0041] In some embodiments, the present disclosure transforms the coordinates of the extracted geometric information to a target coordinate system. The target coordinate system is preset by the user according to actual needs. That is, the solution of the present disclosure provides a configuration interface for the user. The user configures the user configuration parameters corresponding to the target coordinate system through the configuration interface. For example, the user can configure the target coordinate system to be the base map coordinate system of the geographic information system display platform to be exhibited by the three-dimensional geographic model to be constructed. This can ensure that the coordinate system of the constructed three-dimensional geographic model is consistent with the base map coordinate system of the geographic information system display platform, such as the global geographic coordinate system WGS84 of the Cesium base map, and can achieve accurate geospatial positioning.
[0042] Subsequently, this embodiment constructs a three-dimensional OBJ model based on the geometric and attribute information extracted from the data file.
[0043] In some embodiments, constructing a 3D OBJ model based on the geometric information and the attribute information includes: Based on the height value provided in the attribute information, the geometry of the geographic object is generated by stretching the geometric information of the geographic object. The latitude and longitude in the geometric information and the height value in the attribute information are converted into three-dimensional coordinates by a pre-set coordinate transformation operator. The normal of each vertex of the geographic object in the geometric information is calculated using a pre-set normal calculation operator. The polygons included in the geometry of the geographic object are cut into triangular indices using a pre-set triangular face generation operator.
[0044] In this process, vector or raster information is first converted into a simple 3D model with height information, i.e., a 3D OBJ model in OBJ format. This can be achieved by using the geometric base polygon of the geographic object as a foundation, and extruding it based on the height values provided in the attribute information (e.g., when the geographic object is a building, the height values include the total building height and floor height) to generate a geometry that includes the side profile of the geographic object, such as a geometry including the main walls of a building. This process is calculated by pre-programmed coordinate transformation algorithms, normal calculation operators, and triangular face generation operators, and records the basic information of the 3D OBJ model, such as vertex coordinates, normals, and triangular face indices.
[0045] In some embodiments, the 3D OBJ model generated in the above manner will also be organized according to the OBJ file format specification and exported as an OBJ file and an MTL file. The OBJ file records basic information such as vertex coordinates, normals, and triangle indices of the 3D OBJ model, while the MTL file records attribute information such as color of the 3D OBJ model, and the attributes can be freely modified as needed.
[0046] It should be noted that the 3D OBJ model is a 3D white model; see [link / reference]. Figure 3A As shown, a white model of a building, also known as a 3D OBJ model, represents the outer shell of a geographic object, displaying its shape and space. Therefore, the OBJ file stores the data of the 3D white model. The MTL file, on the other hand, is a description of the OBJ file, used to describe the material information and other attributes of the geographic object. Since the 3D white model does not have textures or skins, the MTL file can record information about the outer skin (such as PNG or JPG).
[0047] Next, the 3D OBJ model is converted to GLTF or GLB format to obtain GLTF or GLB files. GLTF or GLB files are derived from the content recorded in the OBJ file; therefore, they only record the geometric information of the 3D OBJ model. Thus, it is necessary to associate some attribute information extracted from the data file, such as the ID of geographic objects, with the corresponding nodes in the GLTF or GLB file. Simultaneously, attribute information of the 3D OBJ model in the MTL file, such as color and ambient light, is read and also associated with the corresponding nodes in the GLTF or GLB file. This yields a 3D geographic model with complete information. See [link to documentation]. Figure 3B As shown, the data of this 3D geographic model is recorded in binary form in a GLTF file or a GLB file.
[0048] In some embodiments, before converting the content of the OBJ file to GLTF or GLB format to obtain a GLTF or GLB file, the method further includes: The 3D OBJ model is cut and split into multiple small tiles according to the S2 mesh unit, and the generated tiles correspond one-to-one with the S2 mesh.
[0049] In this embodiment, the geometric and attribute information (including vertices, faces, materials, etc.) of a large-scale 3D OBJ model is clipped and split into multiple small-scale tiles according to S2 mesh units, and the generated tiles correspond one-to-one with the S2 mesh.
[0050] The S2 mesh ensures a crack-free global environment, with each mesh having a unique identifier for easy management; it also eliminates area distortion, resolving the area expansion problem of traditional quadtrees in high-latitude regions, reducing file size in high-latitude areas, and facilitating file transfer and loading. This disclosure allows for mesh trimming at levels 12-14 for different data ranges, so that the data corresponding to each tile is stored in a small file (including an OBJ file and an MTL file), and each small file is saved independently. In other words, after tileization, the 3D OBJ model is trimmed into multiple tiles corresponding one-to-one with the S2 mesh, with each tile corresponding to an OBJ file recording its geometric information and an MTL file recording its attribute information.
[0051] Table 1. S2 Grid Hierarchy Division Table (12-14)
[0052] It should be noted that when converting a 3D OBJ model to GLTF or GLB format, the OBJ file and MTL file corresponding to each tile are formed in the manner described in the above embodiments to form a corresponding GLTF or GLB file. That is to say, the converted 3D geographic model corresponds to multiple tiles, and the information of different tiles is recorded in their respective GLTF or GLB files. Compared with 3D OBJ models, 3D geographic models in GLTF or GLB format can better support scene, material, animation and other information, and the file structure is clearer and easier to process later.
[0053] The ultimate goal of this disclosure is to generate B3DM (Batched 3D Model) format files. Therefore, this disclosure generates B3DM files based on GLTF or GLB files. B3DM is an efficient type of 3D tile geometry, particularly suitable for batch processing of large numbers of similar or repetitive models (such as buildings in a city).
[0054] In some embodiments, by calculating the parameters of each tile model (such as spatial positioning, geometric error, hierarchical relationship, etc.) and generating an "entry file" for B3DM according to file specifications, such as generating a JSON file and saving it as a Tileset.json file, the model parameters and storage address of each B3DM file are recorded. The geographic information system display platform can load the corresponding B3DM by retrieving this file.
[0055] This disclosure will also publish the generated B3DM file (i.e., the B3DM corresponding to each tile) and its corresponding tileset (i.e., the Tileset.json file) directory, or send it to the geographic information system display platform for publication, so that the system front-end can call and display it in real time.
[0056] In some embodiments, the Cesium 3D Geographic Information System (GIS) display platform interface can be invoked to establish a system for displaying 3D scenes, loading and displaying the aforementioned 3D Tiles data. Cesium's 3D Tiles support dynamic loading and unloading of tiles based on the viewpoint, ensuring efficient rendering of large-scale building data and avoiding memory overflows and performance bottlenecks.
[0057] This disclosure offers greater flexibility in geographic coordinate transformation. While CesiumLab supports coordinate transformation, it typically relies on its built-in transformation tools, whereas this disclosure allows users to customize coordinate transformation logic according to their specific needs. For example, when processing data from different sources, the solution in this disclosure supports direct conversion between various coordinate systems, including but not limited to WGS84, ECEF, Mercator, etc., without intermediate steps or additional tools. This flexibility makes this disclosure more convenient for processing cross-regional or cross-platform data.
[0058] In application scenarios, this disclosure can more efficiently meet the practical needs of large-scale data processing. For example, when generating 3D white models of urban buildings, this disclosure can quickly process thousands of building foundation data and generate loadable B3DM files in a short time, while other platforms may require batch processing or rely on additional performance optimizations. In addition, when processing cross-regional data, this application can flexibly adjust coordinate transformation parameters to better adapt to the data characteristics of different geographical regions.
[0059] This disclosure automates the entire process from geospatial data parsing, 3D geometry generation, texture processing to B3DM format packaging through programming, significantly reducing the time and effort required for manual intervention and modeling. This method can efficiently process data containing a large number of buildings, generating corresponding 3D white models in a single step. It is suitable for large-scale 3D scene construction at the city or regional level, greatly shortening the data preparation cycle.
[0060] This disclosure uses Cesium's B3DM format for storage. This format is optimized for large-scale 3D scenes, has an extremely high compression ratio, significantly reduces model data size, and lowers network transmission and storage costs. The B3DM format supports efficient batch rendering, reducing the number of GPU rendering calls. When loading and rendering large-scale architectural white models on the Cesium platform, it can maintain a smooth frame rate and good performance, improving the user experience.
[0061] This disclosure supports direct processing of widely used geospatial data formats such as Shapefile and GeoJSON without the need for complex data format conversion or preprocessing, reducing the difficulty of data input and the reliance on professional modeling. For scenarios with relatively regular building shapes or only basic white models, this method can replace a large amount of manual 3D modeling work, reducing the reliance on external professional modeling resources, thereby reducing time and economic costs.
[0062] The B3DM model generated in this publication can be seamlessly integrated into the Cesium system to establish a display system. Combined with its powerful 3D visualization capabilities, it can quickly construct 3D city or region models with realistic geographical backgrounds.
[0063] The following are embodiments of the apparatus disclosed herein, which can be used to execute embodiments of the method disclosed herein.
[0064] Figure 4 This diagram illustrates a structural block diagram of an apparatus for constructing a three-dimensional geographic model based on geospatial data according to an embodiment of the present disclosure. This apparatus can be implemented as part or all of an electronic device through software, hardware, or a combination of both. Figure 4 As shown, the apparatus for constructing a three-dimensional geographic model based on geospatial data includes: Module 401 is configured to acquire geospatial data. Extraction module 402 is configured to extract geometric information and attribute information of geographic objects in the geospatial data; The first transformation module 403 is configured to transform the coordinates of the geometric information to a target coordinate system; the target coordinate system is determined based on user-configured parameters. Module 404 is configured to construct a 3D OBJ model based on the geometric information and the attribute information; The export module 405 is configured to export the 3D OBJ model as an OBJ file that records the basic information of the 3D OBJ model and an MTL file that records the attribute information of the 3D OBJ model. The second conversion module 406 is configured to convert the content of the OBJ file into GLTF or GLB format to obtain a GLTF or GLB file, and to associate the attribute information of the geographic object with the corresponding node in the GLTF or GLB file, and to associate the attribute information of the 3D OBJ model in the MTL file with the corresponding node in the GLTF or GLB file. The generation module 407 is configured to generate a B3DM format file based on the GLTF file or GLB file.
[0065] In an optional implementation of this embodiment, the geospatial data includes raster and / or vector information of the geographic object.
[0066] In an optional implementation of this embodiment, the building module is implemented as follows: Based on the height value provided in the attribute information, the geometry of the geographic object is generated by stretching the geometric information of the geographic object. The latitude and longitude in the geometric information and the height value in the attribute information are converted into three-dimensional coordinates by a pre-set coordinate transformation operator. The normal of each vertex of the geographic object in the geometric information is calculated using a pre-set normal calculation operator. The polygons included in the geometry of the geographic object are cut into triangular indices using a pre-set triangular face generation operator.
[0067] In an optional implementation of this embodiment, before the second conversion module, the device further includes: The trimming module is configured to trim and split the 3D OBJ model into multiple small-area tiles according to the S2 mesh unit affiliation, and the generated tiles correspond one-to-one with the S2 mesh.
[0068] The apparatus for constructing a three-dimensional geographic model based on geospatial data in this embodiment corresponds to the method for constructing a three-dimensional geographic model based on geospatial data described above. For specific details, please refer to the description of the method for constructing a three-dimensional geographic model based on geospatial data above, which will not be repeated here.
[0069] Figure 5 This is a schematic diagram of the structure of an electronic device suitable for implementing a method for constructing a three-dimensional geographic model based on geospatial data according to an embodiment of the present disclosure.
[0070] like Figure 5As shown, the electronic device 500 includes a processing unit 501, which can be implemented as a CPU, GPU, FPGA, NPU, or other processing unit. The processing unit 501 can execute various processes according to any of the methods described above in this disclosure, based on a program stored in the read-only memory (ROM) 502 or a program loaded from the storage portion 508 into the random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the electronic device 500. The processing unit 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0071] The following components are connected to I / O interface 505: an input section 506 including a keyboard, mouse, etc.; an output section 507 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to I / O interface 505 as needed. A removable medium 511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 510 as needed so that computer programs read from it can be installed into storage section 508 as needed.
[0072] In particular, according to embodiments of this disclosure, any of the methods described above in the embodiments of this disclosure can be implemented as a computer software program. For example, embodiments of this disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program containing program code for performing any of the methods in the embodiments of this disclosure. In such an embodiment, the computer program can be downloaded and installed from a network via communication section 509, and / or installed from removable medium 511.
[0073] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0074] The units or modules described in the embodiments of this disclosure can be implemented in software or hardware. The described units or modules can also be located in a processor, and the names of these units or modules do not necessarily constitute a limitation on the unit or module itself.
[0075] In another aspect, this disclosure also provides a computer-readable storage medium, which may be a computer-readable storage medium included in the apparatus described in the above embodiments; or it may be a standalone computer-readable storage medium not assembled into a device. The computer-readable storage medium stores one or more programs that are used by one or more processors to perform the methods described in this disclosure.
[0076] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
Claims
1. A method for constructing a three-dimensional geographic model based on geospatial data, wherein, include: Acquire geospatial data; Extract the geometric and attribute information of geographic objects from the geospatial data; Transform the coordinates of the geometric information to the target coordinate system; The target coordinate system is determined based on user-configured parameters; A 3D OBJ model is constructed based on the geometric information and the attribute information; Export the 3D OBJ model as an OBJ file that records the basic information of the 3D OBJ model and an MTL file that records the attribute information of the 3D OBJ model; The content of the OBJ file is converted into GLTF or GLB format to obtain a GLTF or GLB file, and the attribute information of the geographic object is associated with the corresponding node in the GLTF or GLB file, and the attribute information of the 3D OBJ model in the MTL file is associated with the corresponding node in the GLTF or GLB file. Generate a B3DM format file based on the GLTF or GLB file.
2. The method according to claim 1, wherein, The geospatial data includes raster and / or vector information of the geographic objects.
3. The method according to claim 1, wherein, Constructing a 3D OBJ model based on the geometric information and the attribute information includes: Based on the height value provided in the attribute information, the geometry of the geographic object is generated by stretching the geometric information of the geographic object. The latitude and longitude in the geometric information and the height value in the attribute information are converted into three-dimensional coordinates by a pre-set coordinate transformation operator. The normal of each vertex of the geographic object in the geometric information is calculated using a pre-set normal calculation operator. The polygons included in the geometry of the geographic object are cut into triangular indices using a pre-set triangular face generation operator.
4. The method according to claim 1, wherein, Before converting the contents of the OBJ file to GLTF or GLB format to obtain a GLTF or GLB file, the method further includes: The 3D OBJ model is cut and split into multiple small tiles according to the S2 mesh element affiliation, and the generated tiles correspond one-to-one with the S2 mesh.
5. An apparatus for constructing a three-dimensional geographic model based on geospatial data, wherein, include: The acquisition module is configured to acquire geospatial data. The extraction module is configured to extract the geometric information and attribute information of geographic objects in the geospatial data; The first transformation module is configured to transform the coordinates of the geometric information to the target coordinate system; The target coordinate system is determined based on user-configured parameters; The building module is configured to build a 3D OBJ model based on the geometric information and the attribute information; The export module is configured to export the 3D OBJ model as an OBJ file that records the basic information of the 3D OBJ model and an MTL file that records the attribute information of the 3D OBJ model. The second conversion module is configured to convert the content of the OBJ file into GLTF or GLB format to obtain a GLTF or GLB file, and to associate the attribute information of the geographic object with the corresponding node in the GLTF or GLB file, and to associate the attribute information of the 3D OBJ model in the MTL file with the corresponding node in the GLTF or GLB file. The generation module is configured to generate a B3DM format file based on the GLTF file or GLB file.
6. The apparatus according to claim 5, wherein, The geospatial data includes raster and / or vector information of the geographic objects.
7. The apparatus according to claim 5, wherein, The building module is implemented as follows: Based on the height value provided in the attribute information, the geometry of the geographic object is generated by stretching the geometric information of the geographic object. The latitude and longitude in the geometric information and the height value in the attribute information are converted into three-dimensional coordinates by a pre-set coordinate transformation operator. The normal of each vertex of the geographic object in the geometric information is calculated using a pre-set normal calculation operator. The polygons included in the geometry of the geographic object are cut into triangular indices using a pre-set triangular face generation operator.
8. The method according to claim 5, wherein, Prior to the second conversion module, the device further includes: The trimming module is configured to trim and split the 3D OBJ model into multiple small-area tiles according to the S2 mesh unit affiliation, and the generated tiles correspond one-to-one with the S2 mesh.
9. An electronic device, wherein, The method includes a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the method of any one of claims 1-4.
10. A computer-readable storage medium having stored thereon computer instructions, wherein, When executed by a processor, the computer instructions implement the method described in any one of claims 1-4.
