3D Map Generation Method, Apparatus, Electronic Device, and Readable Storage Medium

By automatically processing geospatial data, generating three-dimensional model blocks and texture maps, the time-consuming and labor-consuming construction of three-dimensional scenes in the existing technology is solved, and fast and efficient three-dimensional map generation is achieved.

CN119131276BActive Publication Date: 2025-07-22WISDOM FOOTPRINT DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411245734.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2025-07-22
Estimated Expiration
2044-09-06

AI Technical Summary

Technical Problem

In the prior art, three-dimensional scene construction relies on manual modeling, which is time-consuming and labor-intensive, and it is difficult to ensure the consistency and accuracy of the model.

Method used

By obtaining the geospatial data of the target area, performing coordinate transformation and three-dimensional modeling processing, generating three-dimensional model blocks, and performing model refinement and texture maps, and finally stitching to generate a three-dimensional map.

Benefits of technology

It realizes automated geospatial data processing, generates fast three-dimensional maps, avoids artificial operations, and improves model consistency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119131276B_ABST
    Figure CN119131276B_ABST
Patent Text Reader

Abstract

The present invention provides a three-dimensional map generation method, apparatus, electronic device, and readable storage medium, which relate to the field of three-dimensional maps. First, geographical spatial data of a target area is obtained, and the geographical spatial data includes M feature layer data corresponding one-to-one to M geographical entities in the target area; coordinate transformation processing and three-dimensional modeling processing are performed on each feature layer data to obtain a three-dimensional model block corresponding to each feature layer data; after model refinement processing is performed on each three-dimensional model block, texture mapping is performed to obtain M three-dimensional model texture blocks; the M three-dimensional model texture blocks are spliced to obtain a texture three-dimensional model of the target area, and a three-dimensional map of the target area is rendered based on the texture three-dimensional model. The present invention can automatically process geographical spatial data to generate a three-dimensional map of the target area, avoiding the manual operations of three-dimensional modeling personnel and realizing fast map generation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of 3D maps, and more particularly, to a method, device, electronic device, and readable storage medium for generating 3D maps. Background Art

[0002] With the rapid development of geoinformation technology, 3D visualization is closely associated with Geographic Information System (GIS). Among them, geospatial data is the cornerstone of 3D scene visualization. For example, GeoJSON, as a lightweight and easily parsable geospatial data exchange format, has become an important bridge connecting 2D geographic information and the 3D visualization world.

[0003] In the prior art, the construction of 3D scenes relies on 3D modelers to manually model through professional modeling software and process geospatial data to obtain a three-dimensional effect. However, complex manual modeling and cumbersome data processing not only consume time and effort but also make it difficult to ensure the consistency and accuracy of the models. Summary of the Invention

[0004] The purpose of the present invention is to provide a method, device, electronic device, and readable storage medium for generating 3D maps to improve the problems existing in the prior art.

[0005] Embodiments of the present invention may be implemented as follows:

[0006] In a first aspect, the present invention provides a method for generating a 3D map, which is applied to an electronic device and includes:

[0007] Obtain geospatial data of a target area, where the geospatial data includes M feature layer data, and the feature layer data corresponds to a geospatial entity in the target area;

[0008] Perform coordinate transformation processing and 3D modeling processing on each of the feature layer data to obtain a 3D model block corresponding to each of the feature layer data;

[0009] Perform model refinement processing on each of the 3D model blocks and then perform texture mapping to obtain M 3D model texture blocks;

[0010] Stitch the M 3D model texture blocks to obtain a texture 3D model of the target area, and render a 3D map of the target area based on the texture 3D model.

[0011] In an optional implementation, the step of performing coordinate transformation processing and 3D modeling processing on each of the feature layer data to obtain a 3D model block corresponding to each of the feature layer data includes:

[0012] Start the main thread, and the main thread divides each of the feature layer data multiple times according to the set data capacity to obtain a number of sub-data corresponding to all the feature layer data, and sets the file name prefix of the sub-data based on a preset naming rule each time a sub-data is divided;

[0013] Start K sub-threads, and the main thread evenly distributes all the sub-data to each of the sub-threads;

[0014] The sub-thread converts the coordinate data in each of the sub-data assigned to it from the geodetic coordinate system to the Cartesian coordinate system;

[0015] The sub-thread extracts geometric data from each sub-data after coordinate conversion and performs 3D modeling based on the geometric data to obtain sub-3D model blocks corresponding to each of the sub-data assigned to it, and uses the file name prefixes of each of the sub-data as the file name prefixes of the corresponding sub-3D model blocks respectively;

[0016] The main thread receives multiple sub-3D model blocks returned by each of the sub-threads;

[0017] The main thread, based on the file name prefix of each sub-3D model block, finds all the sub-3D model blocks corresponding to each feature layer data, and splices all the sub-3D model blocks corresponding to each feature layer data respectively to obtain a 3D model block corresponding to each feature layer data.

[0018] In an alternative embodiment, the step of the main thread setting the file name prefix of the sub-data based on a preset naming rule each time a sub-data is divided includes:

[0019] When the main thread divides a sub-data each time, it determines the division number of the sub-data;

[0020] The main thread obtains the entity identifier of the corresponding geographical entity from the feature layer data;

[0021] The main thread sets the file name prefix of the sub-data based on the division number and the entity identifier.

[0022] In an alternative embodiment, the 3D model block includes a number of triangular faces, and each triangular face corresponds to three vertices;

[0023] The step of performing texture mapping on each 3D model block after model refinement processing to obtain M 3D model texture blocks includes:

[0024] For each 3D model block, the midpoint of each pair of connected vertices in the 3D model block is used as a pending vertex;

[0025] Based on the adjacent vertices of each of the to-be-determined vertices, respectively fit the coordinates of the newly added vertices corresponding to each of the to-be-determined vertices;

[0026] Integrate each of the newly added vertices into the 3D model block to obtain a refined 3D model block;

[0027] Perform texture mapping on the refined 3D model block based on the preset texture image of the corresponding feature layer data to obtain the 3D model texture block.

[0028] In an alternative embodiment, the 3D map includes a plurality of map blocks, and the method further includes:

[0029] In response to a user's interaction operation, perform display processing on the 3D map; the interaction operation is one of a rotation operation, a zoom-in operation, and a zoom-out operation;

[0030] Alternatively, in response to a user's selection operation on any target map block in the 3D map, prominently highlight the target map block in the 3D map.

[0031] In an alternative embodiment, the 3D map includes map blocks corresponding to M sub-regions in the target area, and one map block represents a geographical entity corresponding to the corresponding feature layer data; the method further includes:

[0032] In response to a user's operation of viewing population data, obtain the population data of each sub-region in the target area;

[0033] Use the names and population data of each sub-region in the target area as data labels, and superimpose and display them on each map block in the 3D map respectively; or, determine the corresponding reference map positions in the 3D map for the set longitude and latitude within each sub-region, and display a three-dimensional column at the reference map position of each map block according to the corresponding population data, where the three-dimensional column is perpendicular to the horizontal plane of the 3D map and the height of the three-dimensional column represents the magnitude of the population data.

[0034] In an alternative embodiment, the method further includes:

[0035] In response to a user's operation of viewing tourism data, display a query condition pop-up window;

[0036] Obtain the query time period and the scenic area level to be queried input and submitted by the user in the query condition pop-up window;

[0037] Obtain the longitude and latitude of multiple tourism scenic areas to be queried in the target area with the same scenic area level as the scenic area level to be queried and the reception data during the query time period;

[0038] Determine the scenic area map positions of each of the to-be-query tourist scenic areas in the 3D map based on the longitude and latitude of each of the to-be-query tourist scenic areas respectively;

[0039] Display a three-dimensional column at each of the scenic area map positions according to the corresponding reception data, where the three-dimensional column is perpendicular to the horizontal plane of the 3D map and the height of the three-dimensional column represents the magnitude of the reception data.

[0040] In a second aspect, the present invention provides a 3D map generation device, which is applied to an electronic device. The device includes:

[0041] A data acquisition module, configured to acquire geospatial data of a target area, where the geospatial data includes M feature layer data, and the feature layer data corresponds to a geographical entity in the target area;

[0042] A conversion and modeling module, configured to perform coordinate conversion processing and 3D modeling processing on each of the feature layer data to obtain a 3D model block corresponding to each of the feature layer data;

[0043] A texture mapping module, configured to perform model refinement processing on each of the 3D model blocks and then perform texture mapping to obtain M 3D model texture blocks;

[0044] A splicing and rendering module, configured to splice the M 3D model texture blocks to obtain a texture 3D model of the target area, and render a 3D map of the target area based on the texture 3D model.

[0045] In a third aspect, the present invention provides an electronic device, including: a memory and a processor, where the memory stores a software program, and when the electronic device runs, the processor executes the software program to implement the 3D map generation method as described in the first aspect above.

[0046] In a fourth aspect, the present invention provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the 3D map generation method as described in the first aspect above.

[0047] Compared with the prior art, the embodiments of the present invention provide a three-dimensional map generation method, apparatus, electronic device and readable storage medium. First, geographical spatial data of a target area is obtained, and the geographical spatial data includes M feature layer data corresponding one-to-one to M geographical entities in the target area; coordinate transformation processing and three-dimensional modeling processing are performed on each feature layer data to obtain a three-dimensional model block corresponding to each feature layer data; after model refinement processing is performed on each three-dimensional model block, texture mapping is performed to obtain M three-dimensional model texture blocks; the M three-dimensional model texture blocks are spliced to obtain a texture three-dimensional model of the target area, and a three-dimensional map of the target area is rendered based on the texture three-dimensional model. The present invention can automatically process geographical spatial data to generate a three-dimensional map of the target area, avoiding manual operations of three-dimensional modeling personnel and realizing fast map generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for use in the embodiments. It should be understood that the following drawings only show some embodiments of the present invention, and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.

[0049] Figure 1 FIG. 9 is one of the schematic flowcharts of a three-dimensional map generation method provided by an embodiment of the present invention.

[0050] Figure 2 FIG. 13 is another schematic flowchart of a three-dimensional map generation method provided by an embodiment of the present invention.

[0051] Figure 3 FIG. 17 is a schematic diagram of the feature layer data of Tianjin and Hebei in the geographical spatial data provided by an embodiment of the present invention.

[0052] Figure 4 FIG. 21 is a schematic diagram of the code for segmenting geographical spatial data provided by an embodiment of the present invention.

[0053] Figure 5 FIG. 25 is an example diagram of the script code for creating a worker sub-thread provided by an embodiment of the present invention.

[0054] Figure 6 FIG. 29 is an example diagram of a three-dimensional map provided by an embodiment of the present invention.

[0055] Figure 7 FIG. 33 is a partial example diagram of interaction based on the three-dimensional map provided by an embodiment of the present invention.

[0056] Figure 8An example diagram of a map page after querying population data provided by an embodiment of the present invention.

[0057] Figure 9 A schematic diagram of a query condition pop-up window provided by an embodiment of the present invention.

[0058] Figure 10 A schematic structural diagram of a three-dimensional map generation device provided by an embodiment of the present invention.

[0059] Figure 11 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. Detailed implementation manners

[0060] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are some, but not all, of the embodiments of the present invention. Usually, the components of the embodiments of the present invention described and illustrated in the accompanying drawings here can be arranged and designed in various different configurations.

[0061] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed present invention, but merely represents selected embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.

[0062] It should be noted that: like reference numerals and letters denote like items in the following drawings, and thus, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.

[0063] It should be noted that, without conflict, the features in the embodiments of the present invention can be combined with each other.

[0064] Please refer to Figure 1 , Figure 1 A schematic flowchart of a three-dimensional map generation method provided by an embodiment of the present invention. The execution subject of this three-dimensional map generation method can be an electronic device, such as a smart tablet, a smart phone, a personal notebook, a server, or other devices with computing capabilities. This three-dimensional map generation method includes the following steps S101 to S104.

[0065] S101. Obtain the geospatial data of the target area.

[0066] In this embodiment, the geospatial data includes M feature layer data, and the feature layer data corresponds to the geographical entities in the target area.

[0067] Optionally, the target area can be the national area or a city area. Correspondingly, a feature layer data corresponds to a city or a city sub - district within the target area.

[0068] S102. Perform coordinate transformation processing and 3D modeling processing on each feature layer data to obtain a 3D model block corresponding to each feature layer data.

[0069] S103. After performing model refinement processing on each 3D model block, perform texture mapping to obtain M 3D model texture blocks.

[0070] S104. Piece together the M 3D model texture blocks to obtain a texture 3D model of the target area, and render a 3D map of the target area based on the texture 3D model.

[0071] In this embodiment, the topographic and geomorphic features of the target area can be clearly seen from the rendered 3D map.

[0072] The 3D map generation method provided by the embodiment of the present invention first obtains the geospatial data of the target area, and the geospatial data includes M feature layer data corresponding one - to - one to M geographical entities in the target area; perform coordinate transformation processing and 3D modeling processing on each feature layer data to obtain a 3D model block corresponding to each feature layer data; perform model refinement processing on each 3D model block and then perform texture mapping to obtain M 3D model texture blocks; piece together the M 3D model texture blocks to obtain a texture 3D model of the target area, and render a 3D map of the target area based on the texture 3D model. The present invention can automatically process geospatial data to generate a 3D map of the target area, avoiding the manual operation of 3D modeling personnel and realizing fast map generation.

[0073] In an optional implementation manner, the geospatial data can be, but is not limited to, data formats such as GeoJSON format, Shapefile format, GPX format, etc. Next, taking the GeoJSON format as an example, the process of the 3D map generation method provided by the embodiment of the present invention will be introduced.

[0074] After performing the above - mentioned step S101, GeoJSON - format geospatial data of the target area can be obtained. In order to ensure the accuracy and availability of the GeoJSON data, pre - processing is required, and the steps include:

[0075] (1) Data verification: Check whether the format of the GeoJSON data is correct, including the integrity of the JSON structure, the legality of the geometric type, and the integrity of the attribute information, etc.

[0076] (2) Data cleaning: Remove duplicate or invalid data items, correct incorrect or inconsistent data values, and ensure the accuracy and consistency of the data.

[0077] Since the GeoJSON data volume may be relatively large in different regions, and since the HTML application is in single-thread mode, directly processing the complete geospatial data will cause the entire page to freeze, with low efficiency, resulting in a long time spent in the data parsing process and a very poor user experience.

[0078] Therefore, in the above step S102, in order to improve data processing efficiency, the present invention adopts a multi-thread parallel processing mechanism. Correspondingly, on the basis of Figure 1 please refer to Figure 2 , the sub-steps of step S102 may include S1021 to S1026.

[0079] S1021. Start the main thread. The main thread divides each feature layer data multiple times according to the set data capacity to obtain a number of sub-data corresponding to all the feature layer data, and sets the file name prefix of the sub-data based on a preset naming rule each time a sub-data is divided.

[0080] In this embodiment, in the target area, the area sizes of different geographical entities are different. In order to ensure the balance of the data volume for parallel processing, the main thread needs to divide each feature layer data multiple times according to the set data capacity. Taking the target area as the national area as an example, Figure 3 shows a schematic diagram of the feature layer data of Tianjin and Hebei provinces in the geospatial data corresponding to the national area, Figure 3 The feature layer data of Tianjin and Hebei provinces shown in is only an example, and some data has been folded.

[0081] Among them, the set data capacity refers to the data size, which can be flexibly set. For example, the setting can be 20MB, 50MB, 100MB, etc. This example is only for illustration and is not limited here.

[0082] Among them, the process of the main thread setting the file name prefix of the sub-data based on a preset naming rule each time a sub-data is divided may include the following steps:

[0083] (1) Each time the main thread divides out a sub-data, determine the division number of the sub-data;

[0084] (2) The main thread obtains the entity identifier of the corresponding geographical entity from the feature layer data;

[0085] (3) The main thread sets the file name prefix of the sub-data based on the division number and the entity identifier.

[0086] In this embodiment, taking a city as an example of a geographical entity, the entity identifier is the unique identification code of the city. In an optional example, if the entity identifier of Province A is 110000, then the file names of the N sub-data obtained after splitting the feature layer data corresponding to Province A are: 110000-1.geojson, 110000-2.geojson... 110000-N.geojson. Among them, the data size of the last sub-data 110000-N.geojson obtained by splitting may be lower than the set data capacity. Taking 110000-n.geojson as an example, "n" is the splitting number, "110000-n" is the file name prefix, and ".geojson" is the file name suffix. This example is only for illustration and is not limited here.

[0087] Optionally, the code for the main thread to perform splitting can be as Figure 4 shown.

[0088] S1022. Start K sub-threads, and the main thread evenly distributes all the sub-data to each sub-thread.

[0089] In this embodiment, outside the main thread, K sub-threads are simultaneously started using the Web Workers mechanism of HTML5, and the main thread evenly distributes all the sub-data to each sub-thread. This ensures that the amount of data processed by each sub-thread is the same, and the final completion times tend to be the same, without imbalance.

[0090] Optionally, the number of sub-threads started can be determined according to the data size of the geographical spatial data and is not limited here. The script code for creating worker sub-threads can be as Figure 5 shown, Figure 5 The shown is only for illustration and is not limited here.

[0091] S1023. The sub-threads convert the coordinate data in each of the allocated sub-data from the geodetic coordinate system to the Cartesian coordinate system.

[0092] Since the geographical coordinates in GeoJSON data are usually represented by the longitude and latitude of the geodetic coordinate system, while the coordinates in a three-dimensional scene are usually the XYZ coordinates of the Cartesian coordinate system. Therefore, the sub-threads need to convert the coordinate data in each of the allocated sub-data from the geodetic coordinate system to the Cartesian coordinate system.

[0093] S1024. The sub-threads extract geometric data from each sub-data after coordinate conversion and perform three-dimensional modeling based on the geometric data to obtain sub-three-dimensional model blocks corresponding to each of the allocated sub-data, and use the file name prefixes of the respective sub-data as the file name prefixes of the corresponding sub-three-dimensional model blocks.

[0094] GeoJSON is a JSON-based geospatial data interchange format that allows people to represent geographical features, such as points, lines, polygons, etc., in a simple text format, along with associated attribute information.

[0095] In this embodiment, the sub-data also belongs to GeoJSON data. Therefore, for each sub-data after coordinate transformation, the sub-thread extracts geometric data from it, such as points, lines, polygons, etc., and then performs 3D modeling based on the geometric data to obtain the sub-3D model block corresponding to the sub-data. Then, the file name prefix of the sub-data is used as the file name prefix of each corresponding sub-3D model block. For example, if the file name of the sub-data is 110000-1.geojson, then correspondingly, the file name of the sub-3D model block corresponding to the sub-data is 110000-1.geometry.

[0096] S1025. The main thread receives multiple sub-3D model blocks returned by each sub-thread.

[0097] In this embodiment, each sub-thread sequentially processes each sub-data assigned to it into a sub-3D model block. After processing, all the sub-3D model blocks are returned to the main thread.

[0098] S1026. The main thread finds all the sub-3D model blocks corresponding to each feature layer data based on the file name prefix of each sub-3D model block, and splices all the sub-3D model blocks corresponding to each feature layer data respectively to obtain the 3D model block corresponding to each feature layer data.

[0099] In this embodiment, the main thread can classify all the sub-3D model blocks according to the different entity identifiers in the file name prefix to obtain M model groups, and then for all the sub-3D model blocks in each model group respectively: splice them sequentially according to the split numbers in the file name prefix, so as to obtain the 3D model block of the geographical entity.

[0100] If the feature layer data of each geographical entity is processed simultaneously, although the processing efficiency can be improved to a certain extent, due to the different sizes of different geographical entities in the target area, the amount of data processed in parallel is also unbalanced. Therefore, in the present invention, the main thread divides each feature layer data into multiple parts according to the set data capacity, and obtains a number of sub-data corresponding to all the feature layer data. And, since GeoJSON data has a topological relationship and the order cannot be disrupted, when the main thread divides out a sub-data each time, it sets the file name prefix of the sub-data based on the division number and the entity identifier to which it belongs, which can ensure that after each sub-thread finishes processing, the sub-three-dimensional model blocks belonging to different geographical entities can be classified based on the entity identifier in the file name, and then for each category, they are sequentially spliced according to the division number in the sub-three-dimensional model block file name. In this way, the multi-threaded fast processing of geographical space data is realized. Each of the above-obtained three-dimensional model blocks includes a number of triangular faces, and each triangular face corresponds to three vertices. In the three-dimensional model block, if the number of triangular faces is relatively low, the terrain undulation characteristics will not be obvious enough. In order to enhance the display effect of the terrain undulation characteristics, the three-dimensional model block can be model-subdivided and then texture mapped.

[0101] Correspondingly, the sub-steps of the above step S103 may include S1031 to S1034.

[0102] S1031. For each three-dimensional model block, the midpoint of each pair of connected vertices in the three-dimensional model block is used as a pending vertex.

[0103] S1032. Based on the adjacent vertices of each pending vertex, the coordinates of the newly added vertex corresponding to each pending vertex are respectively fitted.

[0104] S1033. Incorporate each newly added vertex into the three-dimensional model block to obtain a refined three-dimensional model block.

[0105] In this embodiment, steps S1031 to S1033 are used to refine the three-dimensional model block, and the method used is the Loop mesh subdivision technology. The specific implementation of each step is the prior art and will not be elaborated here.

[0106] S1034. Based on the preset texture image of the corresponding feature layer data, texture mapping is performed on the refined three-dimensional model block to obtain a three-dimensional model texture block.

[0107] In this embodiment, the preset texture image prepared for each geographical entity can be pre-stored or obtained from the server. Based on the preset texture image of the corresponding feature layer data, texture mapping is performed on the refined three-dimensional model block, and a three-dimensional model texture block can be obtained.

[0108] Executing the above steps S1031 to S1034 for each three-dimensional model block, M three-dimensional model texture blocks can be obtained.

[0109] In the above step S104, the M three-dimensional model texture blocks are stitched together to obtain a textured three-dimensional model of the target area. Based on the textured three-dimensional model, a three-dimensional map of the target area can be rendered. This three-dimensional map includes M map blocks corresponding to M sub-areas in the target area, and one map block represents a geographical entity corresponding to the feature layer data.

[0110] After triangulation subdivision, overlaying textures on each three-dimensional model block can maximize the restoration of the local terrain and achieve the effect of simulating the real world. For example, assuming the target area is Beijing, which includes 16 urban areas, the rendered three-dimensional map is as Figure 6 shown.

[0111] It should be noted that the above steps S101, S103, and S104 are all executed in the main thread.

[0112] In an optional implementation, the rendered three-dimensional map can be displayed on the map page and support user interaction based on this three-dimensional map. Correspondingly, this three-dimensional map generation method can also include the following steps S201 or S202.

[0113] S201. In response to the user's interaction operation, perform display processing on the three-dimensional map.

[0114] In this embodiment, the interaction operation can be one of a rotation operation, a zoom-in operation, and a zoom-out operation. If the interaction operation is a zoom-in operation or a zoom-out operation, then the three-dimensional map can be zoomed in or out centered on the user's interaction click location (the location of the mouse or touch).

[0115] S202. In response to the user's selection operation on any target map block in the three-dimensional map, highlight the target map block prominently in the three-dimensional map.

[0116] Assuming the target area is the national area, if the user clicks on the map block where Sichuan Province is located in the three-dimensional map, then the map block where Sichuan Province is located will be prominently highlighted as shown in Figure 7 shown. It should be noted that Figure 7 only a part of the three-dimensional map of the national area is intercepted.

[0117] In an optional implementation, on the map page including the three-dimensional map, the user can also be supported to perform data query.

[0118] Optionally, if the three-dimensional map is combined with the population data query scenario, then this three-dimensional map generation method can also include the following steps S301 to S303.

[0119] S301. In response to the user's operation of viewing population data, obtain the population data of each sub-region in the target area.

[0120] Optionally, the map page may include a population query button. When the user clicks the population query button, a query list may pop up. The query list may include multiple buttons such as population proportion query, total population query, male-female ratio query, etc. The operation of viewing population data may be the user's click operation on any button in the query list. Therefore, the population data may be population proportion, total population, male-female ratio, etc.

[0121] S302. Use the names and population data of each sub-region in the target area as data labels, and superimpose and display them on each map block in the 3D map respectively.

[0122] In this embodiment, taking the population data as the population proportion as an example, the data label may be "name of the sub-region: population data".

[0123] S303. Determine the corresponding positions of the set longitude and latitude in each sub-region in the 3D map, and display a three-dimensional column at the corresponding position of each map block according to the corresponding population data, where the three-dimensional column is perpendicular to the horizontal plane of the 3D map and the height of the three-dimensional column represents the magnitude of the population data.

[0124] In this embodiment, the set longitude and latitude in the sub-region may be a specific location in the sub-region.

[0125] In an optional example, taking the target area as Beijing and the population data as the male-female ratio as an example, then after the user generates an operation of viewing population data, the map page may become as Figure 8 shown Figure 8 in which each area includes two three-dimensional columns of different colors, representing the male ratio and the female ratio respectively. Figure 8 The above is only an example and is not limited here.

[0126] Optionally, if the 3D map is combined with the tourism data query scenario, then the method for generating the 3D map may further include the following steps S401 to S405.

[0127] S401. In response to the user's operation of viewing tourism data, display a query condition pop-up window.

[0128] Optionally, the map page may include a tourism data query button. When the user clicks the tourism data query button, the query condition pop-up window may be displayed on the map page. Please refer to Figure 9, the query condition pop-up window may include two time selection boxes, a level input box, and a submit button. Each of the two time selection boxes includes a calendar button, which is respectively used to pop up a log to select the query start time and the query end time.

[0129] S402. Obtain the query period and the scenic area level to be queried input and submitted by the user in the query condition pop-up window.

[0130] Combined with Figure 9 , the query period input and submitted by the user in the query condition pop-up window and the scenic area level to be queried. The query period is the time period between the query start time and the query end time selected by the user in the two time selection boxes.

[0131] S403. Obtain the longitude and latitude of multiple tourist scenic areas to be queried in the target area with the same scenic area level as the scenic area level to be queried and the reception data during the query period.

[0132] In this embodiment, the reception data may be the number of receptions, the growth rate of the number of receptions in the same period, the ratio of male and female tourists, etc.

[0133] S404. Respectively determine the scenic area map positions of each tourist scenic area to be queried in the three-dimensional map based on the longitude and latitude of each tourist scenic area to be queried.

[0134] S405. Display a three-dimensional column at each scenic area map position according to the corresponding reception data. The three-dimensional column is perpendicular to the horizontal plane of the three-dimensional map and the height of the three-dimensional column represents the size of the reception data.

[0135] Assume that the target area is the national area, the query period input by the user is October 1, 2023 - October 7, 2023 (i.e., during the National Day holiday in 2023), and the scenic area level to be queried is 5A level. Then it is necessary to obtain the reception data of each 5A-level scenic area in the country during the National Day holiday in 2023, and then display it on the three-dimensional map of the national area. This example is only for illustration and is not limited here.

[0136] In the above two scenarios of data query based on the three-dimensional map, the data display is combined with the geographical location, making the data display more intuitive.

[0137] It should be noted that the execution order of each step in the above method embodiment is not limited by the figures shown, and the execution order of each step is subject to the actual application situation.

[0138] To execute the corresponding steps in the above method embodiment and each possible implementation manner, the following gives an implementation manner of a three-dimensional map generation device.

[0139] Please refer to Figure 10 , Figure 10The structural schematic diagram of the 3D map generation device provided by the embodiment of the present invention is shown. The 3D map generation device 200 includes:

[0140] A data acquisition module 210, configured to acquire geospatial data of a target area, where the geospatial data includes M feature layer data, and the feature layer data corresponds to geographical entities in the target area;

[0141] A conversion and modeling module 220, configured to perform coordinate conversion processing and 3D modeling processing on each feature layer data to obtain a 3D model block corresponding to each feature layer data;

[0142] A texture mapping module 230, configured to perform model refinement processing on each 3D model block and then perform texture mapping to obtain M 3D model texture blocks;

[0143] A splicing and rendering module 240, configured to splice the M 3D model texture blocks to obtain a texture 3D model of the target area, and render a 3D map of the target area based on the texture 3D model.

[0144] Optionally, the conversion and modeling module 220, in the process of performing coordinate conversion processing and 3D modeling processing on each feature layer data to obtain a 3D model block corresponding to each feature layer data, may specifically be configured to: start a main thread, and the main thread divides each feature layer data into multiple parts according to a set data capacity to obtain a number of sub-data corresponding to all the feature layer data, and set a file name prefix for the sub-data based on a preset naming rule each time a sub-data is divided; start K sub-threads, and the main thread evenly distributes all the sub-data to each sub-thread;

[0145] The sub-thread converts the coordinate data in each allocated sub-data from the geodetic coordinate system to the Cartesian coordinate system; the sub-thread extracts geometric data from each sub-data after coordinate conversion and performs 3D modeling based on the geometric data to obtain a sub-3D model block corresponding to each allocated sub-data, and uses the file name prefixes of the respective sub-data as the file name prefixes of the corresponding sub-3D model blocks; the main thread receives multiple sub-3D model blocks returned by each sub-thread; the main thread searches for all the sub-3D model blocks corresponding to each feature layer data based on the file name prefixes of each sub-3D model block, and splices all the sub-3D model blocks corresponding to each feature layer data respectively to obtain a 3D model block corresponding to each feature layer data.

[0146] Optionally, the process of the main thread setting the file name prefix of the sub-data based on a preset naming rule each time a sub-data is split can be specifically used for: when the main thread splits out a sub-data each time, determining the split number of the sub-data; the main thread obtaining the entity identifier of the corresponding geographical entity from the feature layer data; and the main thread setting the file name prefix of the sub-data based on the split number and the entity identifier.

[0147] Optionally, the 3D model block includes a number of triangular faces, and each triangular face corresponds to three vertices. The texture mapping module 230 can be specifically used for: for each 3D model block, taking the midpoint of each pair of adjacent vertices in the 3D model block as a pending vertex; respectively fitting the coordinates of the new vertex corresponding to each pending vertex based on the adjacent vertices of each pending vertex; integrating each new vertex into the 3D model block to obtain a refined 3D model block; and performing texture mapping on the refined 3D model block based on the preset texture image of the corresponding feature layer data to obtain a 3D model texture block.

[0148] Optionally, the 3D map includes a plurality of map blocks. The 3D map generation device 200 may further include an interaction module for: in response to a user's interaction operation, performing display processing on the 3D map; the interaction operation being one of a rotation operation, a zoom-in operation, and a zoom-out operation; or, in response to a user's selection operation on any target map block in the 3D map, prominently highlighting the target map block in the 3D map.

[0149] Optionally, the 3D map includes map blocks corresponding to M sub-regions in the target area, and one map block represents a geographical entity corresponding to a feature layer data. The 3D map generation device 200 may further include a query module for: in response to a user's operation of viewing population data, obtaining the population data of each sub-region in the target area; taking the names and population data of each sub-region in the target area as data labels and respectively superimposing and displaying them on each map block in the 3D map; or determining the corresponding reference map positions in the 3D map for the set longitude and latitude within each sub-region, and displaying a three-dimensional column at the reference map position of each map block according to the corresponding population data, the three-dimensional column being perpendicular to the horizontal plane of the 3D map and the height of the three-dimensional column representing the magnitude of the population data.

[0150] Optionally, the three-dimensional map generation device 200 may further include a query module, configured to: in response to a user's operation of viewing tourism data, display a query condition pop-up window; obtain the query time period and the scenic spot level to be queried input and submitted by the user in the query condition pop-up window; obtain the latitudes and longitudes of multiple tourism scenic spots to be queried in the target area with the same scenic spot level as the scenic spot level to be queried and the reception data during the query time period; respectively determine the scenic spot map positions of each tourism scenic spot to be queried in the three-dimensional map based on the latitudes and longitudes of each tourism scenic spot to be queried; and display a three-dimensional column at each scenic spot map position according to the corresponding reception data, the three-dimensional column being perpendicular to the horizontal plane of the three-dimensional map and the height of the three-dimensional column representing the magnitude of the reception data.

[0151] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the three-dimensional map generation device 200 described above can refer to the corresponding process in the foregoing method embodiment, and will not be elaborated herein.

[0152] Please refer to Figure 11 , Figure 11 which is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. The electronic device 300 includes a processor 310, a memory 320, and a bus 330, and the processor 310 is connected to the memory 320 through the bus 330.

[0153] The memory 320 can be used to store software programs, for example, the software program corresponding to the three-dimensional map generation device 200 provided by the embodiment of the present invention. The processor 310 executes various functional applications and data processing by running the software program stored in the memory 320, so as to implement the three-dimensional map generation method provided by the embodiment of the present invention.

[0154] Among them, the memory 320 may be, but is not limited to: RAM (Random Access Memory), ROM (Read Only Memory), FLASH (Flash Memory), PROM (Programmable Read-Only Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electric Erasable Programmable Read-Only Memory), etc.

[0155] The processor 310 can be an integrated circuit chip with signal processing capabilities. The processor 310 can be a general-purpose processor, including: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be: DSP (Digital Signal Processing), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0156] It can be understood that Figure 11 The structure shown is only schematic, and the electronic device 300 may also include more or fewer components than those shown Figure 11 in the figure, or have a different configuration from that shown Figure 11 in the figure. Figure 11 Each component shown in the figure can be implemented by hardware, software, or a combination thereof.

[0157] An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, it implements the three-dimensional map generation method disclosed in the above embodiment. The computer-readable storage medium can be, but is not limited to: various media such as USB flash drives, external hard drives, ROM, RAM, PROM, EPROM, EEPROM, FLASH disks, or optical discs that can store program codes.

[0158] In summary, an embodiment of the present invention provides a three-dimensional map generation method, apparatus, electronic device, and readable storage medium. First, geographical spatial data of a target area is obtained, and the geographical spatial data includes M feature layer data corresponding one-to-one to M geographical entities in the target area; coordinate transformation processing and three-dimensional modeling processing are performed on each feature layer data to obtain a three-dimensional model block corresponding to each feature layer data; after model refinement processing on each three-dimensional model block, texture mapping is performed to obtain M three-dimensional model texture blocks; the M three-dimensional model texture blocks are spliced to obtain a texture three-dimensional model of the target area, and a three-dimensional map of the target area is rendered based on the texture three-dimensional model. The present invention can automatically process geographical spatial data to generate a three-dimensional map of the target area, avoiding the manual operations of three-dimensional modeling personnel and realizing fast map generation.

[0159] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A three-dimensional map generation method, characterized in that, Applied to an electronic device, including: Obtain geospatial data of a target area, where the geospatial data includes M feature layer data, and the feature layer data corresponds to geographical entities in the target area; Perform coordinate transformation processing and three-dimensional modeling processing on each of the feature layer data to obtain three-dimensional model blocks corresponding to each of the feature layer data; Perform model refinement processing on each of the three-dimensional model blocks and then perform texture mapping to obtain M three-dimensional model texture blocks; Stitch the M three-dimensional model texture blocks to obtain a texture three-dimensional model of the target area, and render a three-dimensional map of the target area based on the texture three-dimensional model; Among them, the step of performing coordinate transformation processing and three-dimensional modeling processing on each of the feature layer data to obtain three-dimensional model blocks corresponding to each of the feature layer data includes: Start the main thread, and the main thread divides each of the feature layer data into multiple parts according to a set data capacity to obtain a number of sub-data corresponding to all the feature layer data, and set the file name prefix of the sub-data based on a preset naming rule each time a sub-data is divided; Start K sub-threads, and the main thread evenly distributes all the sub-data to each of the sub-threads; The sub-thread converts the coordinate data in each of the allocated sub-data from the geodetic coordinate system to the Cartesian coordinate system; The sub-thread extracts geometric data from each sub-data after coordinate conversion and performs three-dimensional modeling based on the geometric data to obtain sub-three-dimensional model blocks corresponding to each of the allocated sub-data, and uses the file name prefixes of the respective sub-data as the file name prefixes of the corresponding sub-three-dimensional model blocks; The main thread receives multiple sub-three-dimensional model blocks returned by each sub-thread; The main thread finds all the sub-three-dimensional model blocks corresponding to each of the feature layer data based on the file name prefixes of each sub-three-dimensional model block, and stitches all the sub-three-dimensional model blocks corresponding to each of the feature layer data respectively to obtain three-dimensional model blocks corresponding to each of the feature layer data.

2. The method according to claim 1, wherein The step that the main thread sets the file name prefix of the sub-data based on a preset naming rule each time a sub-data is divided includes: When the main thread divides a sub-data each time, determine the division number of the sub-data; The main thread obtains the entity identifier of the corresponding geographical entity from the feature layer data; The main thread sets the file name prefix of the sub-data based on the division number and the entity identifier.

3. The method according to claim 1, wherein The three-dimensional model block includes a number of triangular faces, and each triangular face corresponds to three vertices; The step of performing model refinement processing on each of the three-dimensional model blocks and then performing texture mapping to obtain M three-dimensional model texture blocks includes: For each of the three-dimensional model blocks, take the midpoint of each pair of adjacent vertices in the three-dimensional model block as a pending vertex; Based on the adjacent vertices of each of the pending vertices, respectively fit the coordinates of the newly added vertices corresponding to each of the pending vertices; Integrate each of the newly added vertices into the three-dimensional model block to obtain a refined three-dimensional model block; Perform texture mapping on the refined three-dimensional model block based on the preset texture image of the corresponding feature layer data to obtain the three-dimensional model texture block.

4. The method according to claim 1, wherein The three-dimensional map includes a plurality of map blocks, and the method further includes: In response to a user's interaction operation, perform display processing on the three-dimensional map; the interaction operation is one of a rotation operation, a zoom-in operation, and a zoom-out operation; Alternatively, in response to a user's selection operation on any target map block in the three-dimensional map, prominently highlight the target map block in the three-dimensional map.

5. The method according to claim 1, characterized in that, The three-dimensional map includes map blocks corresponding to M sub-regions in the target area, and one map block represents a geographical entity corresponding to the feature layer data; the method further includes: In response to a user's population data viewing operation, obtain the population data of each sub-region in the target area; Use the names and population data of each sub-region in the target area as data labels, and superimpose and display them on each map block in the three-dimensional map respectively; or, determine the corresponding reference map positions in the three-dimensional map for the set longitude and latitude within each sub-region, and display a three-dimensional column at the reference map position of each map block according to the corresponding population data, where the three-dimensional column is perpendicular to the horizontal plane of the three-dimensional map and the height of the three-dimensional column represents the magnitude of the population data.

6. The method according to claim 1, wherein The method further includes: In response to a user's tourism data viewing operation, display a query condition pop-up window; Obtain the query period and the scenic area level to be queried input and submitted by the user in the query condition pop-up window; Obtain the longitude and latitude of multiple tourist scenic areas to be queried in the target area with the same scenic area level as the scenic area level to be queried and the reception data during the query period; Based on the longitude and latitude of each tourist scenic area to be queried, determine the scenic area map position of each tourist scenic area to be queried in the three-dimensional map; Display a three-dimensional column at each scenic area map position according to the corresponding reception data, where the three-dimensional column is perpendicular to the horizontal plane of the three-dimensional map and the height of the three-dimensional column represents the magnitude of the reception data.

7. A three-dimensional map generation device, characterized in that, Applied to an electronic device, the device includes: A data acquisition module, configured to acquire the geospatial data of the target area, where the geospatial data includes M feature layer data, and the feature layer data corresponds to geographical entities in the target area; A conversion and modeling module, configured to perform coordinate conversion processing and three-dimensional modeling processing on each of the feature layer data to obtain a three-dimensional model block corresponding to each of the feature layer data; A texture mapping module, configured to perform model refinement processing on each of the three-dimensional model blocks and then perform texture mapping to obtain M three-dimensional model texture blocks; A splicing and rendering module, configured to splice the M three-dimensional model texture blocks to obtain the texture three-dimensional model of the target area, and render the three-dimensional map of the target area based on the texture three-dimensional model; Among them, the conversion and modeling module is specifically configured to: Start the main thread, and the main thread divides each of the feature layer data multiple times according to the set data capacity to obtain a number of sub-data corresponding to all the feature layer data, and sets the file name prefix of the sub-data based on a preset naming rule each time a sub-data is divided; Start K sub-threads, and the main thread evenly distributes all the sub-data to each of the sub-threads; The sub-threads convert the coordinate data in each of the allocated sub-data from the geodetic coordinate system to the Cartesian coordinate system; The sub-threads extract geometric data from each sub-data after coordinate conversion and perform 3D modeling based on the geometric data to obtain sub-3D model blocks corresponding to each of the allocated sub-data, and use the file name prefixes of the respective sub-data as the file name prefixes of the corresponding sub-3D model blocks; The main thread receives multiple sub-3D model blocks returned by each of the sub-threads; The main thread, based on the file name prefixes of each of the sub-3D model blocks, finds all the sub-3D model blocks corresponding to each of the feature layer data, and splices all the sub-3D model blocks corresponding to each of the feature layer data respectively to obtain 3D model blocks corresponding to each of the feature layer data.

8. An electronic device, characterized in that, Comprising: A memory and a processor, the memory stores a software program, and when the electronic device runs, the processor executes the software program to implement the 3D map generation method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the 3D map generation method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Population data rendering method and device and electronic equipment

    CN112347156A

  • Urban three-dimensional building visualization construction method, terminal equipment and storage medium

    CN113470171A