Three-dimensional map generation method and device, electronic equipment and readable storage medium
The method automates three-dimensional map generation through multi-threaded processing of geographic spatial data, addressing the inefficiencies of manual methods by ensuring rapid and accurate map creation.
Patent Information
- Application Number
- CN202411245734.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-09-06
AI Technical Summary
Existing three-dimensional map generation methods rely on manual modeling and processing of geographic spatial data, which are time-consuming, labor-intensive, and difficult to ensure consistency and accuracy.
A method involving geographic spatial data acquisition, coordinate conversion, three-dimensional modeling, model refinement, and texture mapping, utilizing multi-threaded processing to automate the generation of three-dimensional maps, including splicing and rendering.
Automates the generation of three-dimensional maps, reducing manual labor and ensuring rapid, accurate, and consistent map creation.
Smart Images

Figure CN119131276A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of three-dimensional maps, and in particular to a three-dimensional map generation method, device, electronic device and readable storage medium. Background Art
[0002] With the rapid development of geographic information technology, three-dimensional visualization is closely related to the geographic information system (GIS). Among them, geospatial data is the cornerstone of three-dimensional scene visualization. For example, GeoJSON, as a lightweight and easy-to-parse geospatial data exchange format, has become an important bridge connecting two-dimensional geographic information and the three-dimensional visualization world.
[0003] In the prior art, the construction of three-dimensional scenes relies on three-dimensional modelers to manually model and process geographic spatial data through professional modeling software to obtain a three-dimensional effect. However, complex manual modeling and tedious data processing are not only time-consuming and labor-intensive, but also difficult to ensure the consistency and accuracy of the model. Summary of the invention
[0004] The purpose of the present invention is to provide a three-dimensional map generation method, device, electronic device and readable storage medium to improve the problems existing in the prior art.
[0005] The embodiments of the present invention can be implemented as follows:
[0006] In a first aspect, the present invention provides a three-dimensional map generation method, applied to an electronic device, comprising:
[0007] Acquire geographic spatial data of a target area, wherein the geographic spatial data includes M feature layer data, and the feature layer data corresponds to geographic entities in the target area;
[0008] Performing 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;
[0009] 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;
[0010] The M three-dimensional model texture blocks are spliced to obtain a textured three-dimensional model of the target area, and a three-dimensional map of the target area is rendered based on the textured three-dimensional model.
[0011] In an optional implementation, the step of performing 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 includes:
[0012] The main thread is started, and the main thread divides each of the feature layer data multiple times according to the set data capacity to obtain a plurality of sub-data corresponding to all the feature layer data, and sets a file name prefix of the sub-data based on a preset naming rule each time a sub-data is divided;
[0013] Open K sub-threads, and the main thread evenly distributes all sub-data to each of the sub-threads;
[0014] The sub-thread converts the coordinate data in each of the sub-data allocated thereto from the geodetic coordinate system to the Cartesian coordinate system;
[0015] The sub-thread extracts geometric data from each sub-data after coordinate transformation and performs 3D modeling based on the geometric data to obtain a sub-3D model block corresponding to each sub-data allocated, and uses the file name prefix of each sub-data as the file name prefix of each corresponding sub-3D model block;
[0016] The main thread receives a plurality of sub-three-dimensional model blocks returned by each of the sub-threads;
[0017] The main thread finds out all sub-3D model blocks corresponding to each of the feature layer data based on the file name prefix of each of the sub-3D model blocks, and respectively splices all sub-3D model blocks corresponding to each of the feature layer data to obtain the 3D model block corresponding to each of the feature layer data.
[0018] In an optional implementation manner, the step of setting a file name prefix of the sub-data based on a preset naming rule each time the main thread divides out the sub-data includes:
[0019] The main thread determines the segmentation number of the sub-data each time the sub-data is segmented;
[0020] The main thread obtains the entity identifier of the corresponding geographic entity from the feature layer data;
[0021] The main thread sets a file name prefix for the sub-data based on the segmentation number and the entity identifier.
[0022] In an optional embodiment, the three-dimensional model block includes a plurality of triangular faces, each of which corresponds to three vertices;
[0023] 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:
[0024] For each of the three-dimensional model blocks, the midpoint of each pair of connected vertices in the three-dimensional model block is used as a pending vertex;
[0025] Based on the adjacent vertices of each of the pending vertices, respectively fitting the coordinates of the newly added vertices corresponding to each of the pending vertices;
[0026] Integrate each of the newly added vertices into the three-dimensional model block to obtain a refined three-dimensional model block;
[0027] 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 the three-dimensional model texture block.
[0028] In an optional embodiment, the three-dimensional map includes a plurality of map blocks, and the method further includes:
[0029] In response to an interactive operation of a user, display processing is performed on the three-dimensional map; the interactive 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 three-dimensional map, the target map block is highlighted in the three-dimensional map.
[0031] In an optional implementation, the three-dimensional map includes map blocks corresponding to M sub-areas in the target area, and one map block represents a geographic entity corresponding to one feature layer data; the method further includes:
[0032] In response to a user's population data viewing operation, obtaining population data of each sub-area in the target area;
[0033] The names and population data of each sub-area in the target area are used as data labels and are superimposed and displayed on each map block in the three-dimensional map; or, the set longitude and latitude in each sub-area are determined to correspond to the reference map positions in the three-dimensional map, and a three-dimensional column is displayed at the reference map position of each map block according to the corresponding population data, wherein 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 population data.
[0034] In an optional embodiment, the method further comprises:
[0035] In response to the user's travel data viewing operation, a query condition pop-up window is displayed;
[0036] Obtain the query period and the grade of the scenic spot to be queried entered and submitted by the user in the query condition pop-up window;
[0037] Obtain the latitude and longitude of multiple tourist attractions to be queried in the target area whose scenic spot level is the same as the level of the tourist attraction to be queried and the reception data during the query period;
[0038] Determine the scenic spot map position of each of the tourist attractions to be queried in the three-dimensional map based on the latitude and longitude of each of the tourist attractions to be queried;
[0039] At each location on the scenic area map, a three-dimensional column is displayed 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.
[0040] In a second aspect, the present invention provides a three-dimensional map generating device, applied to an electronic device, the device comprising:
[0041] A data acquisition module, used to acquire geographic spatial data of a target area, wherein the geographic spatial data includes M feature layer data, and the feature layer data corresponds to geographic entities in the target area;
[0042] A conversion modeling module, used for performing 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;
[0043] A mapping module, used for 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;
[0044] The splicing and rendering module is used to splice the M three-dimensional model texture blocks to obtain a textured three-dimensional model of the target area, and render a three-dimensional map of the target area based on the textured three-dimensional model.
[0045] In a third aspect, the present invention provides an electronic device, comprising: a memory and a processor, wherein the memory stores a software program, and when the electronic device is running, the processor executes the software program to implement the three-dimensional map generation method as described in the first aspect above.
[0046] In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the three-dimensional map generation method described in the first aspect.
[0047] Compared with the prior art, the embodiments of the present invention provide a three-dimensional map generation method, device, electronic device and readable storage medium, firstly obtaining the geospatial data of the target area, the geospatial data including M feature layer data corresponding to M geographic entities in the target area one by one; performing coordinate conversion processing and three-dimensional modeling processing on each feature layer data to obtain a three-dimensional model block corresponding to each feature layer data; performing model refinement processing on each three-dimensional model block and then performing texture mapping to obtain M three-dimensional model texture blocks; splicing the M three-dimensional model texture blocks to obtain a textured three-dimensional model of the target area, and rendering a three-dimensional map of the target area based on the textured three-dimensional model. The present invention can automatically process the geospatial data to generate a three-dimensional map of the target area, avoiding manual operation of three-dimensional modeling personnel, and realizing rapid 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 drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0049] Figure 1 One of the flowchart diagrams of a three-dimensional map generating method provided by an embodiment of the present invention.
[0050] Figure 2 The second flowchart of a three-dimensional map generation method provided by an embodiment of the present invention.
[0051] Figure 3 A schematic diagram of feature layer data of Tianjin City and Hebei Province in geographic spatial data provided by an embodiment of the present invention.
[0052] Figure 4 A schematic diagram of a code for segmenting geographic spatial data provided by an embodiment of the present invention.
[0053] Figure 5 An example diagram of a script code for creating a worker sub-thread provided in an embodiment of the present invention.
[0054] Figure 6 An example of a three-dimensional map provided in an embodiment of the present invention.
[0055] Figure 7 A local example diagram of interaction based on a three-dimensional map provided in an embodiment of the present invention.
[0056] Figure 8This is an example diagram of a map page after querying population data provided by an embodiment of the present invention.
[0057] Fig. 9 A schematic diagram of a query condition pop-up window provided in an embodiment of the present invention.
[0058] Fig.10 A schematic diagram of the structure of a three-dimensional map generating device provided by an embodiment of the present invention.
[0059] Fig.11 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0060] In order to make the purpose, 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 in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the 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 invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0062] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0063] It should be noted that, in the absence of conflict, the features in the embodiments of the present invention may be combined with each other.
[0064] Please refer to Figure 1 , Figure 1 The present invention provides a flow chart of a three-dimensional map generation method according to an embodiment of the present invention. The execution subject of the 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. The three-dimensional map generation method includes the following steps S101 to S104.
[0065] S101. Acquire geographic spatial data of a target area.
[0066] In this embodiment, the geographic spatial data includes M feature layer data, and the feature layer data corresponds to geographic entities in the target area.
[0067] Optionally, the target area may be a national area or a city area. Accordingly, a feature layer data corresponds to a city or a city subdivision in the target area.
[0068] S102: Perform coordinate conversion and three-dimensional modeling processing on each feature layer data to obtain a three-dimensional model block corresponding to each feature layer data.
[0069] S103 , performing model refinement processing on each 3D model block and then performing texture mapping to obtain M 3D model texture blocks.
[0070] S104 , splicing the M three-dimensional model texture blocks to obtain a textured three-dimensional model of the target area, and rendering a three-dimensional map of the target area based on the textured three-dimensional model.
[0071] In this embodiment, the rendered three-dimensional map can clearly show the topographic features of the target area.
[0072] The three-dimensional 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 to M geographic entities in the target area one by one; coordinate conversion 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; texture mapping is performed on each three-dimensional model block after model refinement processing to obtain M three-dimensional model texture blocks; the M three-dimensional model texture blocks are spliced to obtain a textured three-dimensional model of the target area, and a three-dimensional map of the target area is rendered based on the textured three-dimensional model. The present invention can automatically process the geospatial data to generate a three-dimensional map of the target area, avoids manual operation of three-dimensional modeling personnel, and realizes rapid map generation.
[0073] In an optional implementation, the geospatial data may be in a data format such as, but not limited to, GeoJSON format, Shapefile format, GPX format, etc. Next, the process of the three-dimensional map generation method provided in an embodiment of the present invention is introduced by taking GeoJSON format as an example.
[0074] After executing the above step S101, the geospatial data of the target area in GeoJSON format can be obtained. In order to ensure the accuracy and availability of the GeoJSON data, preprocessing is required, and the steps include:
[0075] (1) Data validation: Check whether the format of GeoJSON data is correct, including the integrity of the JSON structure, the legitimacy of the geometry type, and the integrity of the attribute information;
[0076] (2) Data cleaning: Remove duplicate or invalid data items, correct erroneous or inconsistent data values, and ensure data accuracy and consistency.
[0077] Since the amount of GeoJSON data may be large in different regions, and since HTML is applied in single-threaded mode, if the complete geographic spatial data is processed directly, the entire page will be stuck and the efficiency will be low, resulting in a long time spent on data parsing and a very poor user experience.
[0078] Therefore, in the above step S102, in order to improve the data processing efficiency, the present invention adopts a multi-threaded parallel processing mechanism. Figure 1 Based on 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 the preset naming rule each time a sub-data is divided.
[0080] In this embodiment, the target area has different sizes of different geographic entities. In order to ensure that the amount of data processed in parallel is balanced, the main thread needs to split 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 It shows the characteristic layer data diagram of Tianjin and Hebei Province in the geographic spatial data corresponding to the national region. Figure 3 The feature layer data of Tianjin and Hebei Province shown in the figure are only examples, and some data have been collapsed.
[0081] The set data capacity refers to the data size, which can be flexibly set, for example, it can be set to 20MB, 50MB, 100MB, etc. This example is only an example and is not limited here.
[0082] The process of the main thread setting the file name prefix of the sub-data based on the preset naming rule each time a sub-data is split out may include the following steps:
[0083] (1) Each time the main thread splits out a sub-data, it determines the split number of the sub-data;
[0084] (2) The main thread obtains the entity identifier of the corresponding geographic entity from the feature layer data;
[0085] (3) The main thread sets the file name prefix of the sub-data based on the segmentation number and entity identifier.
[0086] In this embodiment, taking the geographic entity as a city as an example, the entity identifier is the unique identification code of the city. In the optional example, the entity identifier of Province A is 110000, then the file names of the N sub-data obtained after segmenting the feature layer data corresponding to Province A are: 110000-1.geojson, 110000-2.geojson...110000-N.geojson, where the data size of the last sub-data 110000-N.geojson obtained by segmentation may be lower than the set data capacity. Taking 110000-n.geojson as an example, "n" is the segmentation number, "110000-n" is the file name prefix, and ".geojson" is the file name suffix. This example is only an example and is not limited here.
[0087] Optionally, the main thread's code for splitting can be as follows Figure 4 shown.
[0088] S1022. Start K sub-threads, and the main thread distributes all sub-data to each sub-thread evenly.
[0089] In this embodiment, in addition to the main thread, K sub-threads are started at the same time using the HTML5 Web Workers mechanism, and the main thread evenly distributes all sub-data to each sub-thread. This ensures that the amount of data processed by each sub-thread is consistent, and the final completion time is also consistent, without imbalance.
[0090] Optionally, the number of child threads started can be determined by the size of the geospatial data and is not limited here. The script code for creating a worker child thread can be as follows: Figure 5 As shown, Figure 5 The distances shown are only distances and are not intended to be limiting.
[0091] S1023. The sub-thread converts the coordinate data in each allocated sub-data from the geodetic coordinate system to the Cartesian coordinate system.
[0092] Since the geographic coordinates in GeoJSON data are usually expressed in the longitude and latitude of the geodetic coordinate system, and the coordinates in the three-dimensional scene are usually the XYZ coordinates of the Cartesian coordinate system, the child thread needs to convert the coordinate data in each assigned child data from the geodetic coordinate system to the Cartesian coordinate system.
[0093] S1024. 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 a sub-3D model block corresponding to each assigned sub-data, and uses the file name prefix of each sub-data as the file name prefix of each corresponding sub-3D model block.
[0094] GeoJSON is a JSON-based geospatial data exchange format that allows people to use a simple text format to represent geographic features such as points, lines, polygons, etc., with associated attribute information.
[0095] In this embodiment, the sub-data also belongs to GeoJSON data, so the sub-thread will extract geometric data, such as points, lines, polygons, etc., from each sub-data after coordinate conversion, and then perform 3D modeling based on the geometric data to obtain the sub-3D model block corresponding to the sub-data, and then use the file name prefix of the sub-data 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 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 processes each allocated sub-data into a sub-3D model block in turn, and after the processing is completed, returns all the sub-3D model blocks to the main thread.
[0098] S1026. The main thread finds out all sub-3D model blocks corresponding to each feature layer data based on the file name prefix of each sub-3D model block, and respectively splices all sub-3D model blocks corresponding to each feature layer data to obtain the 3D model block corresponding to each feature layer data.
[0099] In this embodiment, the main thread can classify all sub-3D model blocks according to the entity identifiers in the file name prefix to obtain M model groups, and then for all sub-3D model blocks in each model group: splice them in sequence according to the segmentation number in the file name prefix, so as to obtain the 3D model block of the geographic entity.
[0100] If the feature layer data of each geographic entity is processed at the same time, although the processing efficiency can be accelerated to a certain extent, due to the different sizes of the areas of different geographic entities in the target area, the amount of data processed in parallel is also uneven. Therefore, in the present invention, 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 feature layer data. In addition, since GeoJSON data has a topological relationship and the order cannot be disrupted, the main thread sets the file name prefix of the sub-data based on the segmentation number and the entity identifier to which it belongs each time a sub-data is divided, which can ensure that after each sub-thread is processed, the sub-3D model blocks belonging to different geographic entities can be classified based on the entity identifier in the file name, and then for each category: the sub-3D model blocks are spliced in order according to the segmentation number in the file name of the sub-3D model block. In this way, multi-threaded fast processing of geographic spatial data is achieved. 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 low, the terrain undulation feature will not be obvious enough. In order to enhance the display effect of the terrain undulation feature, the three-dimensional model block can be subdivided into models 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, respectively fit the coordinates of the newly added vertices corresponding to each pending vertex.
[0104] S1033: Integrate 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 by using Loop mesh subdivision technology. The specific implementation of each step is the existing technology and will not be described in detail 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 geographic entity can be pre-stored or obtained from a server. Based on the preset texture image of the corresponding feature layer data, the refined 3D model block is texture mapped to obtain a 3D model texture block.
[0108] By executing the above steps S1031 to S1034 for each 3D model block, M 3D model texture blocks can be obtained.
[0109] In the above step S104, the textured 3D model of the target area is obtained by splicing the M 3D model texture blocks, and a 3D map of the target area can be rendered based on the textured 3D model. The 3D map includes M map blocks corresponding to the M sub-areas in the target area, and one map block represents a geographic entity corresponding to one feature layer data.
[0110] After triangulation, each 3D model block can be overlaid with texture to restore the local terrain to the maximum extent, achieving the effect of simulating the real world. For example, assuming that the target area is Beijing, which includes 16 urban districts, the corresponding rendered 3D map is as follows: 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 a map page, and users can be supported to interact based on the three-dimensional map. Correspondingly, the three-dimensional map generation method can also include the following steps S201 or S202.
[0113] S201. In response to a user's interactive operation, display a three-dimensional map.
[0114] In this embodiment, the interactive operation may be one of a rotation operation, a zoom-in operation, and a zoom-out operation. If the interactive operation is a zoom-in operation or a zoom-out operation, the three-dimensional map may be zoomed in or out with the user's interactive click (mouse position or touch position) as the center.
[0115] S202: In response to a user selecting any target map block in the three-dimensional map, highlighting and displaying the target map block 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 3D map, the following will be displayed: Figure 7 The highlighted map block shows the location of Sichuan Province. It should be noted that Figure 7 Only a portion of the national regional three-dimensional map is captured.
[0117] In an optional implementation, a map page including a three-dimensional map can also support users to perform data queries.
[0118] Optionally, if the three-dimensional map is combined with a population data query scenario, the three-dimensional map generation method may further include the following steps S301 to S303.
[0119] S301. In response to a user's population data viewing operation, obtain population data of each sub-area in a target area.
[0120] Optionally, the map page may include a population query button. When a user clicks the population query button, a query list may pop up. The query list may include multiple buttons such as population percentage query, total population query, and male-female ratio query. The population data viewing operation may be a user clicking operation on any button in the query list. Therefore, the population data may be population percentage, total population, male-female ratio, etc.
[0121] S302: Use the name and population data of each sub-region in the target region as data labels, and overlay and display them on each map block in the three-dimensional map.
[0122] In this embodiment, taking the population data as population percentage as an example, the data label may be “name of sub-region: population data”.
[0123] S303, determining the reference map positions corresponding to the set longitude and latitude in each sub-area in the three-dimensional map, and displaying a three-dimensional column according to the corresponding population data at the reference map position of each map block, wherein 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 population data.
[0124] In this embodiment, the set longitude and latitude in the sub-area may be a specific location in the sub-area.
[0125] In the optional example, the target area is Beijing, and the population data is the male-female ratio. Then, when the user generates a population data viewing operation, the map page can be changed to the following: Figure 8 As shown, Figure 8 In the figure, each area includes two three-dimensional columns of different colors, representing the male and female proportions respectively. Figure 8 The examples shown are merely examples and are not intended to be limiting.
[0126] Optionally, if the three-dimensional map is combined with a tourism data query scenario, the three-dimensional map generation method may further include the following steps S401 to S405.
[0127] S401. In response to the user's travel data viewing operation, a query condition pop-up window is displayed.
[0128] Optionally, the map page may include a tourism data query button. When the user clicks the tourism data query button, a pop-up window with the query conditions may be displayed on the map page. Fig. 9The query condition pop-up window may include two time selection boxes, a level input box, and a submit button. The two time selection boxes include calendar buttons, which are used to call up logs to select the query start time and the query end time.
[0129] S402: Obtain the query period and the grade of the scenic spot to be queried inputted and submitted by the user in the query condition pop-up window.
[0130] Combination Fig. 9 The user enters and submits the query period and the level of the scenic spot to be queried in the query condition pop-up window. 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, obtaining the latitude and longitude of multiple tourist attractions to be queried in the target area whose scenic spot level is the same as the level of the tourist attraction to be queried and the reception data during the query period.
[0132] In this embodiment, the reception data may be the number of visitors received, the growth in the number of visitors received during the same period, the ratio of male to female tourists, etc.
[0133] S404: Determine the scenic spot map position of each tourist attraction to be queried in the three-dimensional map based on the latitude and longitude of each tourist attraction to be queried.
[0134] S405 , displaying a three-dimensional column at each scenic spot map location according to the corresponding reception data, wherein 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] Assuming that the target area is the national area, the query period entered by the user is 2023.10.1-2023.10.7 (i.e., during the National Day of 2023), and the grade of the scenic spot to be queried is 5A, then it is necessary to obtain the reception data of each 5A scenic spot in the country during the National Day of 2023, and then display it on the three-dimensional map of the national area. This example is only an example and is not limited here.
[0136] In the above two scenarios of data query based on three-dimensional maps, data display is combined with geographic 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 to that shown in the drawings, and the execution order of each step shall be based on the actual application situation.
[0138] In order to execute the corresponding steps in the above method embodiment and various possible implementation modes, an implementation method of a three-dimensional map generating device is provided below.
[0139] See also Fig.10 , Fig.10The schematic diagram of the structure of the three-dimensional map generation device provided by the embodiment of the present invention is shown. The three-dimensional map generation device 200 comprises:
[0140] The data acquisition module 210 is used to acquire the geographic spatial data of the target area, the geographic spatial data includes M feature layer data, and the feature layer data corresponds to the geographic entities in the target area;
[0141] The conversion modeling module 220 is used to perform coordinate conversion processing and three-dimensional modeling processing on each feature layer data to obtain a three-dimensional model block corresponding to each feature layer data;
[0142] A mapping module 230 is used to perform model refinement processing on each 3D model block and then perform texture mapping to obtain M 3D model texture blocks;
[0143] The splicing and rendering module 240 is used to splice the M three-dimensional model texture blocks to obtain a textured three-dimensional model of the target area, and render a three-dimensional map of the target area based on the textured three-dimensional model.
[0144] Optionally, the conversion modeling module 220 is used for performing coordinate conversion processing and three-dimensional modeling processing on each feature layer data to obtain a three-dimensional model block corresponding to each feature layer data. Specifically, it can be used to: start the main thread, the main thread divides each feature layer data multiple times according to the set data capacity, obtains a number of sub-data corresponding to all 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 sub-thread;
[0145] The sub-thread converts the coordinate data in each assigned 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 a sub-3D model block corresponding to each assigned sub-data, and uses the file name prefix of each sub-data as the file name prefix of each corresponding sub-3D model block; the main thread receives multiple sub-3D model blocks returned by each sub-thread; the main thread finds out all 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 sub-3D model blocks corresponding to each feature layer data to obtain a three-dimensional model block corresponding to each feature layer data.
[0146] Optionally, the main thread sets the file name prefix of the sub-data based on a preset naming rule each time a sub-data is split. Specifically, the main thread determines the split number of the sub-data each time a sub-data is split; the main thread obtains the entity identifier of the corresponding geographic entity from the feature layer data; the main thread sets the file name prefix of the sub-data based on the split number and the entity identifier.
[0147] Optionally, the three-dimensional model block includes a plurality of triangular faces, each of which corresponds to three vertices. The mapping module 230 can be specifically used to: for each three-dimensional model block, use the midpoint of each pair of connected vertices in the three-dimensional model block as pending vertices; based on the adjacent vertices of each pending vertex, fit the coordinates of the newly added vertices corresponding to each pending vertex; integrate each newly added vertex into the three-dimensional model block to obtain a refined three-dimensional model block; based on the preset texture image of the corresponding feature layer data, perform texture mapping on the refined three-dimensional model block to obtain a three-dimensional model texture block.
[0148] Optionally, the three-dimensional map includes a plurality of map blocks. The three-dimensional map generating device 200 may further include an interactive module, which is used to: display the three-dimensional map in response to an interactive operation of a user; the interactive operation is one of a rotation operation, a zoom-in operation, and a zoom-out operation; or, in response to a user's selection operation for any target map block in the three-dimensional map, highlight and display the target map block in the three-dimensional map.
[0149] Optionally, the three-dimensional map includes map blocks corresponding to M sub-areas in the target area, and one map block represents a geographic entity corresponding to one feature layer data. The three-dimensional map generation device 200 may also include a query module for: in response to the user's population data viewing operation, obtaining the population data of each sub-area in the target area; using the name and population data of each sub-area in the target area as data labels, respectively superimposed and displayed on each map block in the three-dimensional map; or, determining the corresponding reference map positions of the set longitude and latitude in each sub-area in the three-dimensional map, and displaying a three-dimensional column according to the corresponding population data at the reference map position of each map block, wherein 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 population data.
[0150] Optionally, the three-dimensional map generating device 200 may also include a query module, which is used to: display a query condition pop-up window in response to a user's tourism data viewing operation; obtain the query time period and the level of the scenic spot to be queried input and submitted by the user in the query condition pop-up window; obtain the longitude and latitude of multiple tourist attractions to be queried in the target area whose scenic spot level is the same as the level of the scenic spot to be queried and the reception data during the query period; determine the scenic spot map position of each tourist attraction to be queried in the three-dimensional map based on the longitude and latitude of each tourist attraction to be queried; display a three-dimensional column at each scenic spot 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.
[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 generating device 200 described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0152] See also Fig.11 , Fig.11 The electronic device 300 includes a processor 310 , a memory 320 , and a bus 330 , wherein the processor 310 is connected to the memory 320 via the bus 330 .
[0153] The memory 320 may be used to store software programs, for example, software programs corresponding to the three-dimensional map generating apparatus 200 provided in the embodiment of the present invention. The processor 310 executes various functional applications and data processing to implement the three-dimensional map generating method provided in the embodiment of the present invention by running the software programs stored in the memory 320.
[0154] Among them, the memory 320 can 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 may be an integrated circuit chip with signal processing capability. The processor 310 may be a general-purpose processor, including: CPU (Central Processing Unit), NP (Network Processor), etc.; it may 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] Understandably, Fig.11 The structure shown is for illustration only. The electronic device 300 may also include Fig.11 More or fewer components as shown, or with Fig.11 Different configurations shown. Fig.11 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0157] The embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the three-dimensional map generation method disclosed in the above embodiment is implemented. The computer-readable storage medium can be, but is not limited to, various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a PROM, an EPROM, an EEPROM, a FLASH disk, or an optical disk.
[0158] In summary, the embodiments of the present invention provide a three-dimensional map generation method, device, electronic device and readable storage medium, firstly obtaining the geospatial data of the target area, the geospatial data including M feature layer data corresponding to M geographic entities in the target area; performing coordinate conversion processing and three-dimensional modeling processing on each feature layer data to obtain a three-dimensional model block corresponding to each feature layer data; performing model refinement processing on each three-dimensional model block and then performing texture mapping to obtain M three-dimensional model texture blocks; splicing the M three-dimensional model texture blocks to obtain a textured three-dimensional model of the target area, and rendering a three-dimensional map of the target area based on the textured three-dimensional model. The present invention can automatically process the geospatial data to generate a three-dimensional map of the target area, avoiding manual operation of three-dimensional modeling personnel, and realizing rapid 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 a person skilled in the art within the technical scope disclosed by the present invention should be included in 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: Used in electronic equipment, including: Acquire geographic spatial data of a target area, wherein the geographic spatial data includes M feature layer data, and the feature layer data corresponds to geographic entities in the target area; Performing 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; 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; The M three-dimensional model texture blocks are spliced to obtain a textured three-dimensional model of the target area, and a three-dimensional map of the target area is rendered based on the textured three-dimensional model.
2. The method according to claim 1, characterized in that The step of performing 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 includes: The main thread is started, and the main thread divides each of the feature layer data multiple times according to the set data capacity to obtain a plurality of sub-data corresponding to all the feature layer data, and sets a file name prefix of the sub-data based on a preset naming rule each time a sub-data is divided; Open K sub-threads, and the main thread evenly distributes all sub-data to each of the sub-threads; The sub-thread converts the coordinate data in each of the sub-data allocated thereto from the geodetic coordinate system to the Cartesian coordinate system; The sub-thread extracts geometric data from each sub-data after coordinate transformation and performs 3D modeling based on the geometric data to obtain a sub-3D model block corresponding to each sub-data allocated, and uses the file name prefix of each sub-data as the file name prefix of each corresponding sub-3D model block; The main thread receives a plurality of sub-three-dimensional model blocks returned by each of the sub-threads; The main thread finds out all sub-3D model blocks corresponding to each of the feature layer data based on the file name prefix of each of the sub-3D model blocks, and respectively splices all sub-3D model blocks corresponding to each of the feature layer data to obtain the 3D model block corresponding to each of the feature layer data.
3. The method according to claim 2, characterized in that The step of setting a file name prefix of the sub-data based on a preset naming rule each time the main thread divides out the sub-data comprises: The main thread determines the segmentation number of the sub-data each time the sub-data is segmented; The main thread obtains the entity identifier of the corresponding geographic entity from the feature layer data; The main thread sets a file name prefix for the sub-data based on the segmentation number and the entity identifier.
4. The method according to claim 1, characterized in that: The three-dimensional model block includes a plurality of triangular faces, each of which 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, the midpoint of each pair of connected vertices in the three-dimensional model block is used as a pending vertex; Based on the adjacent vertices of each of the pending vertices, respectively fitting 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; 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 the three-dimensional model texture block.
5. The method according to claim 1, characterized in that The three-dimensional map includes a plurality of map blocks, and the method further includes: In response to an interactive operation of a user, display processing is performed on the three-dimensional map; the interactive 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, the target map block is highlighted in the three-dimensional map.
6. The method according to claim 1, characterized in that The three-dimensional map includes map blocks corresponding to M sub-areas in the target area, and one map block represents a geographic entity corresponding to one feature layer data; the method further includes: In response to a user's population data viewing operation, obtaining population data of each sub-area in the target area; The names and population data of each sub-area in the target area are used as data labels and are superimposed and displayed on each map block in the three-dimensional map; or, the set longitude and latitude in each sub-area are determined to correspond to the reference map positions in the three-dimensional map, and a three-dimensional column is displayed at the reference map position of each map block according to the corresponding population data, wherein 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 population data.
7. The method according to claim 1, characterized in that The method further comprises: In response to the user's travel data viewing operation, a query condition pop-up window is displayed; Obtain the query period and the grade of the scenic spot to be queried entered and submitted by the user in the query condition pop-up window; Obtain the latitude and longitude of multiple tourist attractions to be queried in the target area whose scenic spot level is the same as the level of the tourist attraction to be queried and the reception data during the query period; Determine the scenic spot map position of each of the tourist attractions to be queried in the three-dimensional map based on the latitude and longitude of each of the tourist attractions to be queried; At each location on the scenic area map, a three-dimensional column is displayed 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.
8. A three-dimensional map generating device, characterized in that: Applied to electronic equipment, the device comprises: A data acquisition module, used to acquire geographic spatial data of a target area, wherein the geographic spatial data includes M feature layer data, and the feature layer data corresponds to geographic entities in the target area; A conversion modeling module, used for performing 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 mapping module, used for 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; The splicing and rendering module is used to splice the M three-dimensional model texture blocks to obtain a textured three-dimensional model of the target area, and render a three-dimensional map of the target area based on the textured three-dimensional model.
9. An electronic device, characterized in that: include: A memory and a processor, wherein the memory stores a software program, and when the electronic device is running, the processor executes the software program to implement the three-dimensional map generation method as described in any one of claims 1-7.
10. 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, the three-dimensional map generating method according to any one of claims 1 to 7 is implemented.
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
