A method and device for rendering multi-type map services in two and three dimensions
By employing a layered hybrid rendering method for 2D and 3D rendering scenes, the problem of separation between 2D and 3D rendering is solved, achieving integrated 2D and 3D rendering and improving user experience and information acquisition efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-09
- Publication Date
- 2026-03-24
AI Technical Summary
In multi-task map rendering scenarios, the disconnect between 2D and 3D rendering forces users to repeatedly verify information, impacting the user experience.
Two-dimensional rendering scenes are generated by rendering two-dimensional sub-services in two dimensions, and three-dimensional rendering scenes are generated by rendering three-dimensional sub-services in three dimensions. The two-dimensional and three-dimensional rendering scenes are then merged through layered hybrid rendering to form an integrated two-dimensional and three-dimensional rendering.
It achieves seamless integration of 2D and 3D rendering scenes, improves user experience, avoids misalignment and confusion when switching perspectives, and improves information acquisition efficiency.
Smart Images

Figure CN121280587B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of map rendering, in particular to a two-three-dimensional integrated rendering method and device for multi-type map services. BACKGROUND
[0002] With the development of information technology, map rendering technology has also developed from the early stage of only realizing the static plane presentation of basic geographic spatial information to the expansion to two-dimensional and three-dimensional forms, and its presentation capability continues to upgrade. It is widely used in urban daily management, public travel navigation, emergency event disposal and many other fields, and through the conversion of complex spatial information into intuitive visual pictures, it provides a basic support for the efficient operation of various fields.
[0003] However, in the multi-task map rendering scene, due to the differences in the logic and rhythm of picture generation between two-dimensional and three-dimensional rendering, the two-dimensional rendering scene and the three-dimensional rendering scene may present a picture split situation, which affects the overall user experience when the user obtains information. SUMMARY
[0004] The problem solved by the present application is how to improve the user experience of map rendering services.
[0005] To solve the above problems, the present application provides a two-three-dimensional integrated rendering method and device for multi-type map services.
[0006] In a first aspect, the present application provides a two-three-dimensional integrated rendering method for multi-type map services, comprising:
[0007] performing two-dimensional rendering on the obtained two-dimensional sub-service of the to-be-loaded service to obtain a two-dimensional rendering scene, and performing three-dimensional rendering on the three-dimensional sub-service of the to-be-loaded service to obtain a three-dimensional rendering scene;
[0008] According to the two-dimensional rendering scene and the three-dimensional rendering scene, a two-three-dimensional rendering scene is generated through layered mixed rendering.
[0009] Optionally, the two-dimensional rendering on the obtained two-dimensional sub-service of the to-be-loaded service to obtain a two-dimensional rendering scene comprises:
[0010] generating corresponding two-dimensional grid data according to the two-dimensional service type of the two-dimensional sub-service;
[0011] determining corresponding tile pictures according to the two-dimensional grid data;
[0012] splicing all the tile pictures according to the corresponding grid positions to obtain the two-dimensional rendering scene.
[0013] Optionally, the two-dimensional grid data comprises dynamic service two-dimensional grid data and static service two-dimensional grid data; and the generating of the corresponding two-dimensional grid data according to the two-dimensional service type of the two-dimensional sub-service comprises:
[0014] When the two-dimensional service type is dynamic service, the dynamic service two-dimensional grid data is generated according to dynamic service metadata of the two-dimensional sub-service through a preset dynamic service division rule;
[0015] When the two-dimensional service type is static service, the static service two-dimensional grid data is generated according to static service metadata of the two-dimensional sub-service through a preset static service division rule.
[0016] Optionally, the dynamic service metadata comprises a display range, an initial hierarchical grid number and a current dynamic service display level of the two-dimensional sub-service; and the generating of the dynamic service two-dimensional grid data according to the metadata of the two-dimensional sub-service through a preset dynamic service slicing rule comprises:
[0017] a dynamic service grid number is obtained according to the initial hierarchical grid number and the current dynamic service display level through a preset dynamic service grid number relationship;
[0018] a dynamic service grid position number of each grid is obtained according to the dynamic service grid number through row and column indexes;
[0019] a corresponding grid range is obtained according to the dynamic service grid position number and the display range through a preset dynamic service boundary relationship;
[0020] the dynamic service two-dimensional grid data is generated according to all the grid ranges.
[0021] Optionally, the dynamic service grid number relationship satisfies:
[0022] N x =n x ×2 L ;
[0023] N y =n y ×2 L ;
[0024] The dynamic service boundary relationship satisfies:
[0025] ;
[0026] ;
[0027] ;
[0028] ;
[0029] wherein, N x is a horizontal grid number in the dynamic service grid number, N y is a vertical grid number in the dynamic service grid number, n x is a horizontal grid number in the initial hierarchical grid number, n y is a vertical grid number in the initial hierarchical grid number, L is the current dynamic service display level, X i,min is the minimum longitude corresponding to the i-th grid, X i,max is the maximum longitude corresponding to the i-th grid, Y i,min is the minimum latitude corresponding to the i-th grid, Y i,max is the maximum latitude corresponding to the i-th grid, x max is the maximum longitude of the display range, y max is the maximum latitude of the display range, x min is the minimum longitude of the display range, y min is the minimum latitude of the display range, x i is the horizontal position of the i-th dynamic service grid position number, y i is the vertical position of the i-th dynamic service grid position number.
[0030] Optionally, the static service metadata includes the full-range of the two-dimensional sub-service, the origin position, the initial layer tile resolution, the tile pixel, and the current static service display level; and the static service two-dimensional grid data is generated according to the static service metadata of the two-dimensional sub-service through a preset static service division rule, including:
[0031] determining the static service grid number through a preset static service grid number relationship according to the full-range, the origin position, the initial layer tile resolution, and the tile pixel;
[0032] determining the static service grid position number of each grid according to the static service grid number and the display level;
[0033] generating the static service two-dimensional grid data according to all the static service grid position numbers.
[0034] Optionally, the static service grid number relationship satisfies:
[0035] ;
[0036] ;
[0037] wherein, M xM is a horizontal grid number in the static service grid number y E is a longitudinal grid number in the static service grid number x,max E is a maximum longitude of the full range y,min O is a minimum latitude of the full range x O is a longitude of the origin position y R is a latitude of the origin position x C is a horizontal pixel of the tile pixel y C is a longitudinal pixel of the tile pixel.
[0038] Optionally, the determining the corresponding tile picture according to the two-dimensional grid data comprises:
[0039] When the two-dimensional grid data is the dynamic service two-dimensional grid data, the corresponding tile picture is generated in real time according to the dynamic service two-dimensional grid data;
[0040] When the two-dimensional grid data is the static service two-dimensional grid data, the corresponding tile picture is determined according to the static service two-dimensional grid data through a preset index relationship, wherein the index relationship comprises a one-to-one correspondence relationship between a grid in the static service grid data and a pre-stored tile picture.
[0041] Optionally, the three-dimensional rendering of the three-dimensional sub-service of the to-be-loaded service comprises:
[0042] obtaining a screen space error of a three-dimensional tile of the three-dimensional sub-service;
[0043] optimizing the three-dimensional tile according to a comparison result of the screen space error and a preset threshold to obtain an optimized three-dimensional tile;
[0044] generating the three-dimensional rendering scene through three-dimensional rendering according to all the optimized three-dimensional tiles.
[0045] In a second aspect, the application provides a two-dimensional and three-dimensional integrated rendering device for a multi-type map service, comprising:
[0046] a processing module configured to perform two-dimensional rendering on a two-dimensional sub-service of a to-be-loaded service to obtain a two-dimensional rendering scene, and perform three-dimensional rendering on a three-dimensional sub-service of the to-be-loaded service to obtain a three-dimensional rendering scene;
[0047] a fusion module configured to generate a two-dimensional and three-dimensional rendering scene through layered mixed rendering according to the two-dimensional rendering scene and the three-dimensional rendering scene.
[0048] In a third aspect, the present application provides an electronic device comprising a memory and a processor;
[0049] The memory is configured to store a computer program.
[0050] The processor is configured to implement the method for two-three-dimensional integration rendering of multi-type map services according to the first aspect when executing the computer program.
[0051] In a fourth aspect, the present application provides a computer readable storage medium, wherein the storage medium stores a computer program, and the computer program, when executed by a processor, implements the method for two-three-dimensional integration rendering of multi-type map services according to the first aspect.
[0052] The method for two-three-dimensional integration rendering of multi-type map services has the following advantages: when rendering a two-dimensional sub-service of a to-be-loaded service in two dimensions, a two-dimensional rendering scene is generated, which can be a planar view map picture and clearly show the planar layout and correlation of various elements. When rendering a three-dimensional sub-service in three dimensions, a three-dimensional rendering scene is generated, which can be a stereoscopic picture with a spatial depth and can intuitively present three-dimensional information such as terrain undulation and building height. By layering and mixing, the two-dimensional rendering scene and the three-dimensional rendering scene are fused to obtain a two-three-dimensional rendering scene, breaking the fragmentation of the two-dimensional and three-dimensional scenes and bringing a more coherent cognitive experience. By layering and mixing rendering of the two-dimensional rendering scene and the three-dimensional rendering scene, the two-dimensional scene can be used as a spatial reference layer, and the three-dimensional scene can be accurately superimposed thereon, avoiding dislocation and confusion when the user switches the view. At the same time, the layering and mixing rendering can present the priorities according to the visual logic, so that the user does not need to frequently switch between the two-dimensional scene and the three-dimensional scene, and does not need to repeatedly check the dislocation of the two types of scene information. The picture is coherent and has no discontinuity during operation, the efficiency of obtaining spatial information is greatly improved, and the user experience of map rendering service is improved. BRIEF DESCRIPTION OF DRAWINGS
[0053] Figure 1 FIG. 1 is a flowchart of a method for two-three-dimensional integration rendering of multi-type map services according to an embodiment of the present application;
[0054] Figure 2 FIG. 2 is a structural diagram of map level segmentation according to an embodiment of the present application;
[0055] Figure 3 FIG. 3 is a structural diagram of a device for two-three-dimensional integration rendering of multi-type map services according to an embodiment of the present application;
[0056] Figure 4 FIG. 4 is a structural diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0057] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Although some embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the accompanying drawings and embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.
[0058] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0059] The term "comprising" and its variations as used herein are open-ended, meaning "including but not limited to"; the term "based on" means "at least partially based on"; the term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments"; and the term "optionally" means "optional embodiments". Definitions of other terms will be given in the following description. It should be noted that the concepts of "first," "second," etc., mentioned in this invention are used only to distinguish different devices, modules, or units, and are not intended to limit the order of functions performed by these devices, modules, or units or their interdependencies.
[0060] It should be noted that the terms "a" and "a plurality of" used in this invention are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0061] The names of the messages or information exchanged between the multiple devices in the embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of these messages or information.
[0062] like Figure 1 As shown in the figure, an embodiment of the present invention provides a method for integrated 2D and 3D rendering of multiple map services, including:
[0063] S100, perform two-dimensional rendering on the two-dimensional sub-service of the service to be loaded to obtain a two-dimensional rendering scene, and perform three-dimensional rendering on the three-dimensional sub-service of the service to be loaded to obtain a three-dimensional rendering scene.
[0064] Specifically, the service to be loaded includes multiple sub-services that need to be rendered, such as 2D sub-services and 3D sub-services. These include 2D sub-services carrying planar spatial information and 3D sub-services carrying three-dimensional spatial information, each corresponding to different data formats and rendering logics. Alternatively, it can include either a 2D rendering service or a 3D rendering service separately. The rendering of 2D sub-services focuses on presenting basic information such as planar layout and location relationships. This can be achieved through methods such as tile (tile image) loading (e.g., raster tiles or vector tiles) and symbolic processing (e.g., road markings, administrative division coloring) to transform 2D geographic data into an intuitive planar visualization scene, ensuring that planar information such as road networks and point distributions are clearly identifiable. The rendering of 3D sub-services, on the other hand, focuses on dimensions such as three-dimensional form and height relationships. This requires loading 3D model data (e.g., building models, terrain elevation data) and using techniques such as Level of Detail (LOD) optimization, lighting and material effect processing to construct a three-dimensional visualization scene with spatial depth, intuitively presenting three-dimensional features such as building height and terrain undulations.
[0065] S200, Based on the two-dimensional rendering scene and the three-dimensional rendering scene, a two-dimensional and three-dimensional rendering scene is generated through layered hybrid rendering.
[0066] Specifically, based on information attributes, 2D and 3D rendering scenes are divided into different logical layers. The 2D rendering scene can serve as the base layer, carrying the planar coordinate reference (such as road networks, administrative boundaries, etc.), providing a spatial positioning reference for the entire scene; while the 3D rendering scene, as an overlay layer, relies on the coordinate reference of the base layer to precisely place 3D elements (such as architectural models, terrain undulations) on their corresponding planar positions, avoiding "floating in the air" or "embedded underground" appearances due to dimensional differences. Spatial misalignment can be addressed. Next, collaborative calibration, using unified spatial coordinate mapping rules, ensures that the latitude and longitude of the 2D base map correspond to the spatial coordinate system of the 3D model, guaranteeing that 2D annotations (such as road signs and location markers) accurately fall into their corresponding positions within the 3D scene. Simultaneously, the detail precision of the two layers can be dynamically adjusted based on the view zoom level. For example, when the view zooms out, subtle textures in the 3D model are weakened, while the overall layout of the 2D base layer is enhanced; when the view zooms in, the detail rendering of the 3D model is improved while maintaining the clarity of 2D elements (such as road names), avoiding a blurry 3D image up close and a cluttered 2D image from a distance due to precision mismatch. Finally, through the collaborative scheduling of the rendering pipeline, the two scene layers are composited into a unified image. The view prioritizes presentation based on visual logic. For example, nearby 3D buildings will naturally obscure the 2D roads behind them (in line with human visual habits), while key 2D information (such as real-time traffic signs) will be overlaid with semi-transparent elements or highlighted to avoid being completely obscured by 3D elements. At the same time, through the linkage of lighting and shadow effects (such as the shadows of 3D buildings projected onto the 2D base map), the two types of scenes are visually integrated into an organic whole. The final scene presented to the user retains the clarity of planar information in the 2D scene (such as quickly identifying route directions) and has the sense of depth in the 3D scene (such as intuitively perceiving building height), without any obvious sense of dimensional separation. This solves the problems of switching misalignment and screen chaos that may occur when rendering independently.
[0067] In this embodiment, when rendering the two-dimensional sub-services to be loaded, a two-dimensional rendering scene is generated. This two-dimensional rendering scene can be a map view from a planar perspective, clearly showing the planar layout and relationships of various elements. For the three-dimensional rendering of the three-dimensional sub-services, the rendering revolves around the construction of a three-dimensional scene, generating a three-dimensional rendering scene. This three-dimensional rendering scene can have a sense of spatial depth, intuitively presenting three-dimensional information such as terrain undulations and building heights. Through layered blending, the two-dimensional and three-dimensional rendering scenes are merged to obtain a two-dimensional and three-dimensional rendering scene, breaking the abrupt separation between the two-dimensional scenes and bringing a more coherent cognitive experience. By layering and blending the two-dimensional and three-dimensional rendering scenes, the two-dimensional scene can serve as a spatial reference layer, with the three-dimensional scene precisely superimposed on it, avoiding the disjointed and confusing feeling when users switch perspectives. Simultaneously, layered blending rendering can coordinate presentation priorities according to visual logic. Users do not need to frequently switch between two-dimensional and three-dimensional scenes, nor do they need to repeatedly check information due to misalignment between the two types of scenes. The operation is smooth and seamless, significantly improving the efficiency of obtaining spatial information and enhancing the user experience of the map rendering service.
[0068] Optionally, the step of performing two-dimensional rendering on the obtained two-dimensional sub-services of the service to be loaded to obtain a two-dimensional rendering scene includes:
[0069] Generate corresponding two-dimensional grid data based on the two-dimensional service type of the two-dimensional sub-service;
[0070] Determine the corresponding tile image based on the two-dimensional grid data;
[0071] All the tile images are stitched together according to their corresponding grid positions to obtain the two-dimensional rendered scene.
[0072] In this optional embodiment, differences in two-dimensional service types directly affect the generation logic of grid data. That is, the service type determines the grid division rules of the map, and the two-dimensional grid data generated by dividing the area to be rendered according to these rules. For example... Figure 2As shown, the grid data can generate a pyramid-shaped quadtree grid based on the corresponding level. The initial level corresponding to the area to be rendered in the service to be loaded is level 0 (L0). L0 is divided into 4 grids using a quadtree splitting method. Then, each grid in L1 is further divided into 4 grids in the same way, resulting in level 2 (L2) with 16 tiles. This process continues, dividing the area to be rendered layer by layer according to actual needs to obtain the required level and the corresponding number of grids. In other words, the area to be rendered is divided into multiple grids, and corresponding tiles (images) are generated based on the data of each grid. Finally, these are stitched together to obtain the final 2D rendering result. The display precision of the corresponding tiles can also be adjusted based on the grid data. For example, each grid may correspond to a fixed geographical range (e.g., a grid at a certain level represents an area of 1 square kilometer). If it is a vector service (e.g., a service containing real-time road data), the service type is related to the geometric precision requirements of the data. The grid data will dynamically adjust the grid granularity according to the distribution density of the vector features to avoid feature fragmentation due to an overly coarse grid. This step generates a grid by adapting to the service type, providing a precise spatial reference for subsequent tile matching and preventing misalignment between subsequent tiles and geographical areas.
[0073] Furthermore, after clarifying the spatial coordinates (such as level L, row and column X / Y) of each grid through grid data, the corresponding tiles are matched according to the coordinates: for static services, the tile images of the corresponding L / X / Y grids are directly retrieved from the cache or Content Delivery Network (CDN); for dynamic services, vector data is extracted based on the grid range, and the corresponding tile images are generated in real time by the client rendering engine, ensuring that each grid corresponds to accurate visualization content. This avoids redundant tile loading (only the required grid tiles are retrieved) and ensures the spatial correspondence between the image and the grid. Since the size and coordinates of each tile image have been calibrated through grid data (such as the row and column positions of a 256×256 pixel tile), during stitching, the edges only need to be aligned according to the row and column order of the grid. For example, the tile of level 3 with X=10 and Y=8 is connected to the right with the tile with X=11 and Y=8, and the tile below is connected to the tile with X=10 and Y=9, achieving seamless stitching through coordinate anchoring. The final 2D rendered scene has no obvious tile seams, and the planar elements such as roads and administrative divisions are continuous and complete. Users can see a continuous map view when browsing, avoiding problems such as scene offset and fragmentation caused by splicing misalignment, and intuitively improving the readability and browsing smoothness of planar information.
[0074] Optionally, the two-dimensional mesh data includes dynamic service two-dimensional mesh data and static service two-dimensional mesh data; the step of generating corresponding two-dimensional mesh data according to the two-dimensional service type of the two-dimensional sub-service includes:
[0075] When the two-dimensional service type is a dynamic service, the dynamic service two-dimensional grid data is generated according to the dynamic service metadata of the two-dimensional sub-service through a preset dynamic service partitioning rule;
[0076] When the two-dimensional service type is a static service, the static service two-dimensional grid data is generated according to the static service metadata of the two-dimensional sub-service through a preset static service partitioning rule.
[0077] In this optional embodiment, when the 2D service type is dynamic, there is no pre-generated grid and corresponding tile images. It relies on real-time updated data sources (such as real-time traffic flow, temporary event control areas, etc.). When a user initiates a request, dynamic service 2D grid data is calculated and generated in real-time based on dynamic service metadata (such as real-time data range, current request parameters) and flexible dynamic service partitioning rules (such as adjusting grid precision on demand, temporarily expanding data range). There are no pre-generated fixed resources. A corresponding 2D rendering scene is further generated based on the dynamic service 2D grid data. Static services are based on fixed geographic datasets (such as basic administrative divisions, permanent road networks, etc.). Before the service goes online, a set of tiles matching the static service 2D grid data is pre-generated. When the 2D service type is static, corresponding 2D static service grid data is generated according to preset static service partitioning rules. Each grid data in the 2D static service grid data is matched with corresponding tiles in a preset set of tiles through an index relationship. This index relationship includes a one-to-one correspondence between static grid data and preset tiles. All matched tiles are stitched together according to their corresponding grid positions to obtain the final 2D rendering scene. By generating corresponding mesh data for different service types, the 2D rendering service can adapt to different types, thus improving the adaptability of 2D rendering.
[0078] Optionally, the dynamic service metadata includes the display range of the two-dimensional sub-service, the initial number of hierarchical grids, and the current dynamic service display level; generating the dynamic service two-dimensional grid data based on the metadata of the two-dimensional sub-service using preset dynamic service slicing rules includes:
[0079] The number of dynamic service grids is obtained based on the initial number of grid levels and the current dynamic service display level through a preset relationship between the number of dynamic service grids.
[0080] The location number of each dynamic service grid is obtained by using row and column indexing based on the number of dynamic service grids.
[0081] The corresponding grid range is obtained based on the dynamic service grid location number and the display range through a preset dynamic service boundary relationship;
[0082] The dynamic service two-dimensional grid data is generated based on the entire grid range.
[0083] Optionally, the relationship between the number of dynamic service meshes satisfies:
[0084] Nx = nx × 2 L ;
[0085] Ny = ny × 2 L ;
[0086] The dynamic service boundary relationship satisfies:
[0087] ;
[0088] ;
[0089] ;
[0090] ;
[0091] Where, N x N represents the number of horizontal grids in the dynamic service grid count. y n represents the number of vertical grids in the dynamic service grid count. x n is the number of horizontal grids in the initial hierarchical grid size. y L is the number of vertical grids in the initial hierarchical grid count, and X is the current dynamic service display level. i,min X is the minimum longitude corresponding to the i-th grid. i,max Y represents the maximum longitude corresponding to the i-th grid. i,min Y is the minimum latitude corresponding to the i-th grid. i,max x is the maximum latitude corresponding to the i-th grid. max The maximum longitude of the displayed range, y max x is the maximum latitude of the displayed range. min The minimum longitude of the displayed range, y min x is the minimum latitude of the displayed range. i y represents the horizontal position of the i-th dynamic service mesh location number. i The vertical position of the i-th dynamic service mesh location number.
[0092] Specifically, based on the initial layer grid quantity and the current display layer, the number of dynamic service grids is determined through a preset grid quantity relationship, thus clarifying the grids that the entire dynamic service needs to be divided under the current display layer. The initial layer grid quantity refers to the total number of grids under the baseline layer set by the dynamic service (usually the lowest zoom level, which can be understood as the most basic view level). This is generally expressed as horizontal number × vertical number; for example, if the initial layer has 1 horizontal and 2 vertical grids, then the initial layer has 1 × 2 = 2 grids. The current dynamic service display layer refers to the layer currently viewed by the user (similar to the zoom level of a map; the higher the layer, the finer the view and the denser the grid division; the lower the layer, the more macroscopic the view and the coarser the grid division). The preset dynamic service grid quantity relationship is a pre-defined calculation method for the correspondence between the dynamic service's layers and the number of grids (the core is how the number of grids scales when the layer changes). Through the dynamic service grid quantity relationship, the horizontal grid quantity N corresponding to the current layer can be obtained. x and the number of vertical grids N y Therefore, the total number of grids corresponding to the current level is N. x ×N y For example, assuming the initial level L=L0 has 1 grid horizontally and 2 grid vertically (totaling 2 grids), and the current service display level is L=L2=2, then substituting the above into the dynamic service grid quantity relationship, we get that L=2 corresponds to 4 horizontally (4 rows) and 8 vertically (8 columns). Therefore, the total number of grids for dynamic services at the current level is 4×8=32.
[0093] Furthermore, based on the number of dynamic service meshes, the location number corresponding to each mesh is obtained through row-class indexing. That is, based on the number of horizontal and vertical meshes in the current level, the row and column positions of each mesh are converted into identifiable numbers. The row and column index refers to the row and column position of the mesh within the current level. For example, in the current level L2, the horizontal position x corresponding to the i-th dynamic service mesh... i This is the 3rd row, with the vertical position y. i For the 4th column, we can obtain the location number of the i-th dynamic service mesh (x). i y i The value is (3, 4), and a hierarchical number can be added to obtain the dynamic service grid location number (L2, x) corresponding to the i-th grid. i y i The value is (2,3,4). The dynamic service mesh location number is a unique number generated based on the row and column index (converting the two-dimensional row and column index into a one-dimensional identifier, which facilitates the service to quickly locate the mesh).
[0094] Furthermore, based on the grid location number and the display range required by the service to be loaded, the grid range corresponding to each grid is calculated using the above data through preset boundary relationships. This is the latitude and longitude of the grid boundary, thus obtaining the grids that need to be displayed within the user's current field of view and determining the specific geographic / spatial range corresponding to these grids (i.e., which grids are within the user's viewing range and how large an area each grid covers). The display range is the boundary range of the user's current field of view. This range can be based on a preset unified coordinate system, such as the China Geodetic Coordinate System 2000 (CGCS2000) used for global grid subdivision. A unified coordinate system ensures that the same physical location has unique coordinates, eliminating ambiguity and enabling seamless integration of multi-source spatial data, breaking down data barriers, ensuring the accuracy of spatial calculations and analysis results such as distance and area, and avoiding distortion caused by differences in reference standards. The range information of all grids within the user's display range selected in the previous step is then integrated into structured dynamic service two-dimensional grid data. Based on the user's real-time viewing needs (hierarchy and field of view), the required grid boundary data information is accurately generated, ensuring display accuracy while avoiding redundant calculations.
[0095] Optionally, the static service metadata includes the full range, origin position, initial layer tile resolution, tile pixels, and current static service display level of the two-dimensional sub-service; generating the static service two-dimensional mesh data according to the static service metadata of the two-dimensional sub-service through preset static service partitioning rules includes:
[0096] The number of static service grids is determined based on the full-width range, the origin position, the initial layer tile resolution, and the tile pixels, using a preset relationship between the number of static service grids.
[0097] The static service grid location number of each grid is determined based on the number of static service grids and the display level;
[0098] The static service two-dimensional grid data is generated based on all the static service grid location numbers.
[0099] Optionally, the relationship between the number of static service meshes satisfies:
[0100] ;
[0101] ;
[0102] Among them, M x M represents the number of horizontal grids in the static service grid count. y E represents the number of vertical grids in the static service grid count. x,max E represents the maximum longitude across the entire range.y,min O is the minimum latitude of the entire range. x O is the longitude of the origin position. y R is the latitude of the origin position, R is the resolution of the initial layer tiles, and C is the latitude of the origin position. x C is the horizontal pixel of the tile pixel. y The vertical pixel of the tile pixel.
[0103] Specifically, based on the static service metadata, the full-area, origin position, initial layer tile resolution, tile pixels, and current static service display level of the corresponding two-dimensional sub-service are obtained. Combining the full-area, origin position, initial layer tile resolution, and tile pixels, the corresponding number of static service grids (the horizontal and vertical number of grids in the static service) is calculated according to the preset static service grid quantity relationship. Then, based on the determined number of static service grids and display level, a unique static service grid location number is assigned to each grid, typically presented in row and column index form. For example, row numbers are sequentially numbered from 0 horizontally, and row numbers are sequentially numbered from 0 vertically. Each grid's number is composed of the corresponding row and column numbers. Then, based on the current display level and the row and column corresponding to each grid, the final static service grid location number (display level L, row x, column y) is generated. Finally, all static service grid location numbers are integrated to form structured static service two-dimensional grid data, thereby completing the spatial segmentation of the full-area and providing a foundation for subsequent indexing, accurate positioning, and efficient loading of static tile data.
[0104] Furthermore, when the initial layer tile resolution is missing and only the corresponding initial layer scale is obtained, the corresponding initial layer tile resolution can be calculated using the scale relationship and the number of unit pixels.
[0105] The initial layer tile resolution satisfies:
[0106] ;
[0107] Where R is the initial layer tile resolution, Scale is the initial layer scale, PPI is the number of pixels per unit, i.e., the number of pixels per inch in the digital image, and α is the scaling factor.
[0108] In this optional embodiment, based on the orderly segmentation and standardized management of the entire server space, the vast space is broken down into uniformly sized "small units," avoiding arbitrary division and providing a unified standard for the storage and indexing of static resources (such as map tiles), reducing management chaos. It also significantly improves the positioning and loading efficiency of static resources. Using the unique location number of the grid, the target area can be located directly without traversing the entire server, especially when the entire area is large, where the efficiency advantage is even more pronounced. Simultaneously, its grid structure, generated based on fixed logic, ensures service stability and scalability. When adjusting the display hierarchy or adding resources later, it can be expanded in an orderly manner based on the existing structure without reconstructing the overall spatial system, reducing maintenance costs. For example, in map services, when a user operates, the system can quickly locate tiles using grid numbers, and newly added resources can also be directly stored corresponding to grid numbers, resulting in high efficiency and stability.
[0109] Optionally, determining the corresponding tile image based on the two-dimensional grid data includes:
[0110] When the two-dimensional grid data is the dynamic service two-dimensional grid data, the corresponding tile image is generated in real time based on the dynamic service two-dimensional grid data;
[0111] When the two-dimensional grid data is the static service two-dimensional grid data, the corresponding tile image is determined according to the static service two-dimensional grid data through a preset index relationship, wherein the index relationship includes a one-to-one correspondence between the grids in the static service grid data and the pre-stored tile images.
[0112] In this optional embodiment, when the two-dimensional grid data is dynamic service two-dimensional grid data, since dynamic services typically contain real-time updated information (such as real-time monitoring data, dynamically changing business indicators, etc.), it is impossible to pre-store the corresponding tile images. Therefore, it is necessary to generate tile images in real time based on the current dynamic service two-dimensional grid data. Specifically, based on the grid's range information, a tile image matching the grid range is rendered in real time using visualization rules (such as numerical color mapping, dynamic drawing of boundaries, or annotations) to ensure that the tile content remains consistent with the latest data. When the 2D grid data is static 2D grid data, since the corresponding data (such as the base map, fixed background information, etc.) is predetermined and stable over a long period of time, the tile images can be created and stored in advance. At this time, the corresponding tile image can be quickly retrieved according to the location number of each grid through the preset index relationship. This index relationship is essentially a one-to-one correspondence between the unique location number (such as the layer row and column number) of each grid in the static service grid data and the storage path or identifier of the pre-stored tile image (for example, the grid number (2, 3, 2) corresponds to the tile file in the storage directory). There is no need for real-time rendering. The pre-stored tile image can be accurately retrieved directly through the grid number, which improves loading efficiency.
[0113] Optionally, the step of performing 3D rendering on the 3D sub-service of the service to be loaded to obtain a 3D rendered scene includes:
[0114] Obtain the screen space error of the 3D tiles of the 3D sub-service;
[0115] The optimized three-dimensional tiles are obtained by comparing the screen space error with a preset threshold.
[0116] Based on all the optimized 3D tiles, the 3D rendered scene is generated through 3D rendering.
[0117] In this optional embodiment, screen space error refers to the deviation (usually in pixels) between the geometric model of a 3D tile displayed on the screen and the ideal high-precision model from the current viewing angle. For example, if the edge position of a building model corresponding to a tile differs from the actual high-precision model edge by 3 pixels due to simplification, this difference is the screen space error. The calculation requires consideration of the tile's spatial position and current camera viewing parameters (such as focal length and viewing angle range). The 3D tiles are optimized based on the comparison between the screen space error and a preset threshold. The preset threshold is set based on display accuracy requirements and device performance (e.g., 2 pixels). If the screen space error of a 3D tile is greater than the threshold, its accuracy is insufficient and requires refinement (e.g., loading tiles with higher detail levels or supplementing the model's fine structure). If the error is less than or equal to the threshold, the current accuracy meets display requirements, and resource consumption can be reduced through simplification optimization (e.g., reducing the number of model triangles or lowering texture resolution). This adjustment results in optimized 3D tiles that avoid both insufficient accuracy leading to blurry images and excessive accuracy causing performance waste. Finally, all the optimized 3D tiles are integrated and rendered to generate a 3D scene that meets the current display requirements. This ensures the display accuracy and visual consistency of each element in the scene, while also improving the smoothness of rendering due to the optimized tiles, thus adapting to the performance requirements of different devices.
[0118] like Figure 3 As shown in the figure, an embodiment of the present invention provides a two-dimensional and three-dimensional integrated rendering device 300 for multiple types of map services, comprising:
[0119] Processing module 310 is used to perform two-dimensional rendering on the two-dimensional sub-services of the acquired service to be loaded to obtain a two-dimensional rendering scene, and to perform three-dimensional rendering on the three-dimensional sub-services of the service to be loaded to obtain a three-dimensional rendering scene.
[0120] The fusion module 320 is used to generate a two-dimensional or three-dimensional rendering scene by layered blending rendering based on the two-dimensional rendering scene and the three-dimensional rendering scene.
[0121] The 2D / 3D integrated rendering device for multiple map services in this embodiment is used to implement the 2D / 3D integrated rendering method for multiple map services as described above. Its advantages over the prior art are the same as the advantages of the 2D / 3D integrated rendering method for multiple map services over the prior art, and will not be repeated here.
[0122] like Figure 4 As shown, an electronic device 400 provided in this embodiment of the invention includes a memory 410 and a processor 420; the memory 410 is used to store a computer program; the processor 420 is used to implement the two-dimensional and three-dimensional integrated rendering method of multi-type map services as described above when the computer program is executed.
[0123] Alternatively, an electronic device 400 includes a memory 410 and a processor 420 coupled to the memory 410; the memory 410 is configured to store a computer program; and the processor 420 is configured to perform the following operations when the computer program is executed:
[0124] A two-dimensional rendering scene is obtained by performing two-dimensional rendering on the two-dimensional sub-services of the service to be loaded, and a three-dimensional rendering scene is obtained by performing three-dimensional rendering on the three-dimensional sub-services of the service to be loaded.
[0125] Based on the two-dimensional rendering scene and the three-dimensional rendering scene, a two-dimensional and three-dimensional rendering scene is generated through layered hybrid rendering.
[0126] This invention provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the two-dimensional and three-dimensional integrated rendering method for multiple types of map services as described above.
[0127] Alternatively, a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the following operations:
[0128] A two-dimensional rendering scene is obtained by performing two-dimensional rendering on the two-dimensional sub-services of the service to be loaded, and a three-dimensional rendering scene is obtained by performing three-dimensional rendering on the three-dimensional sub-services of the service to be loaded.
[0129] Based on the two-dimensional rendering scene and the three-dimensional rendering scene, a two-dimensional and three-dimensional rendering scene is generated through layered hybrid rendering.
[0130] The present invention will now be described an electronic device 400 that can serve as a server or client of the present invention, which is an example of a hardware device that can be applied to various aspects of the present invention. Electronic device 400 is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic device 400 can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0131] Electronic device 400 includes a computing unit that can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) or a computer program loaded from a storage unit into random access memory (RAM). The RAM may also store various programs and data required for device operation. The computing unit, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.
[0132] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc. In this application, the units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of the present invention according to actual needs. Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units can be implemented in hardware or as software functional units.
[0133] While the present invention has been disclosed above, its scope of protection is not limited thereto. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention, and all such changes and modifications will fall within the scope of protection of the present invention.
Claims
1. A method for integrated 2D and 3D rendering of multiple map services, characterized in that, include: Two-dimensional rendering is performed on the two-dimensional sub-services of the service to be loaded to obtain a two-dimensional rendering scene, and three-dimensional rendering is performed on the three-dimensional sub-services of the service to be loaded to obtain a three-dimensional rendering scene. Based on the two-dimensional rendering scene and the three-dimensional rendering scene, a two-dimensional and three-dimensional rendering scene is generated through layered hybrid rendering. The step of performing two-dimensional rendering on the obtained two-dimensional sub-services of the service to be loaded to obtain a two-dimensional rendering scene includes: Generate corresponding two-dimensional grid data based on the two-dimensional service type of the two-dimensional sub-service; Determine the corresponding tile image based on the two-dimensional grid data; All the tile images are stitched together according to their corresponding grid positions to obtain the two-dimensional rendering scene; The two-dimensional grid data includes dynamic service two-dimensional grid data and static service two-dimensional grid data; the step of generating corresponding two-dimensional grid data according to the two-dimensional service type of the two-dimensional sub-service includes: When the two-dimensional service type is a dynamic service, the dynamic service two-dimensional grid data is generated according to the dynamic service metadata of the two-dimensional sub-service and the preset dynamic service partitioning rules. When the two-dimensional service type is a static service, the static service two-dimensional grid data is generated according to the static service metadata of the two-dimensional sub-service and the preset static service partitioning rules. The dynamic service metadata includes the display range of the two-dimensional sub-service, the initial number of hierarchical grids, and the current dynamic service display level; the step of generating the dynamic service two-dimensional grid data according to the metadata of the two-dimensional sub-service and through preset dynamic service slicing rules includes: The number of dynamic service grids is obtained based on the initial number of grid levels and the current dynamic service display level, through a preset dynamic service grid quantity relationship. Based on the number of dynamic service grids, the location number of each grid is obtained through row and column indexing; Based on the dynamic service grid location number and the display range, the corresponding grid range is obtained through a preset dynamic service boundary relationship; Generate the dynamic service two-dimensional grid data based on the entire grid range; The static service metadata includes the full range, origin position, initial layer tile resolution, tile pixels, and current static service display level of the two-dimensional sub-service; the step of generating the static service two-dimensional mesh data according to the static service metadata of the two-dimensional sub-service and through preset static service partitioning rules includes: The number of static service grids is determined based on the full-width range, the origin position, the initial layer tile resolution, and the tile pixels, using a preset relationship between the number of static service grids. The static service grid location number of each grid is determined based on the number of static service grids and the display level; The static service two-dimensional grid data is generated based on all the static service grid location numbers.
2. The method for integrated 2D and 3D rendering of multiple map services according to claim 1, characterized in that, The relationship between the number of dynamic service meshes satisfies: ; ; The dynamic service boundary relationship satisfies: ; ; ; ; Where, N x N represents the number of horizontal grids in the dynamic service grid count. y n represents the number of vertical grids in the dynamic service grid count. x n is the number of horizontal grids in the initial hierarchical grid size. y L is the number of vertical grids in the initial hierarchical grid count, and X is the current dynamic service display level. i,min X is the minimum longitude corresponding to the i-th grid. i,max Y represents the maximum longitude corresponding to the i-th grid. i,min Y is the minimum latitude corresponding to the i-th grid. i,max x is the maximum latitude corresponding to the i-th grid. max The maximum longitude of the displayed range, y max x is the maximum latitude of the displayed range. min The minimum longitude of the displayed range, y min x is the minimum latitude of the displayed range. i y represents the horizontal position of the i-th dynamic service mesh location number. i The vertical position of the i-th dynamic service mesh location number.
3. The method for integrated 2D and 3D rendering of multiple map services according to claim 1, characterized in that, The relationship between the number of static service meshes satisfies: ; ; Among them, M x M represents the number of horizontal grids in the static service grid count. y E represents the number of vertical grids in the static service grid count. x,max E represents the maximum longitude across the entire range. y,min O is the minimum latitude of the entire range. x O is the longitude of the origin position. y R is the latitude of the origin position, R is the resolution of the initial layer tiles, and C is the latitude of the origin position. x C is the horizontal pixel of the tile pixel. y The vertical pixel of the tile pixel.
4. The method for integrated 2D and 3D rendering of multiple map services according to claim 1, characterized in that, The step of determining the corresponding tile image based on the two-dimensional grid data includes: When the two-dimensional grid data is the dynamic service two-dimensional grid data, the corresponding tile image is generated in real time based on the dynamic service two-dimensional grid data; When the two-dimensional grid data is the static service two-dimensional grid data, the corresponding tile image is determined according to the static service two-dimensional grid data through a preset index relationship, wherein the index relationship includes a one-to-one correspondence between the grids in the static service grid data and the pre-stored tile images.
5. The method for integrated 2D and 3D rendering of multiple map services according to claim 1, characterized in that, The process of performing 3D rendering on the 3D sub-services of the service to be loaded to obtain a 3D rendered scene includes: Obtain the screen space error of the 3D tiles of the 3D sub-service; The three-dimensional tiles are optimized based on the comparison result between the screen space error and the preset threshold to obtain optimized three-dimensional tiles. Based on all the optimized 3D tiles, the 3D rendered scene is generated through 3D rendering.
6. A two-dimensional and three-dimensional integrated rendering device for multiple map services, characterized in that, include: The processing module is used to perform two-dimensional rendering on the two-dimensional sub-services of the acquired service to be loaded to obtain a two-dimensional rendering scene, and to perform three-dimensional rendering on the three-dimensional sub-services of the service to be loaded to obtain a three-dimensional rendering scene. The step of performing two-dimensional rendering on the obtained two-dimensional sub-services of the service to be loaded to obtain a two-dimensional rendering scene includes: Generate corresponding two-dimensional grid data based on the two-dimensional service type of the two-dimensional sub-service; Determine the corresponding tile image based on the two-dimensional grid data; All the tile images are stitched together according to their corresponding grid positions to obtain the two-dimensional rendering scene; The two-dimensional grid data includes dynamic service two-dimensional grid data and static service two-dimensional grid data; the step of generating corresponding two-dimensional grid data according to the two-dimensional service type of the two-dimensional sub-service includes: When the two-dimensional service type is a dynamic service, the dynamic service two-dimensional grid data is generated according to the dynamic service metadata of the two-dimensional sub-service and the preset dynamic service partitioning rules. When the two-dimensional service type is a static service, the static service two-dimensional grid data is generated according to the static service metadata of the two-dimensional sub-service and the preset static service partitioning rules. The dynamic service metadata includes the display range of the two-dimensional sub-service, the initial number of hierarchical grids, and the current dynamic service display level; the step of generating the dynamic service two-dimensional grid data according to the metadata of the two-dimensional sub-service and through preset dynamic service slicing rules includes: The number of dynamic service grids is obtained based on the initial number of grid levels and the current dynamic service display level, through a preset dynamic service grid quantity relationship. Based on the number of dynamic service grids, the location number of each grid is obtained through row and column indexing; Based on the dynamic service grid location number and the display range, the corresponding grid range is obtained through a preset dynamic service boundary relationship; Generate the dynamic service two-dimensional grid data based on the entire grid range; The static service metadata includes the full range, origin position, initial layer tile resolution, tile pixels, and current static service display level of the two-dimensional sub-service; the step of generating the static service two-dimensional mesh data according to the static service metadata of the two-dimensional sub-service and through preset static service partitioning rules includes: The number of static service grids is determined based on the full-width range, the origin position, the initial layer tile resolution, and the tile pixels, using a preset relationship between the number of static service grids. The static service grid location number of each grid is determined based on the number of static service grids and the display level; The static service two-dimensional grid data is generated based on all the static service grid location numbers; The fusion module is used to generate a two-dimensional or three-dimensional rendering scene by layered blending rendering based on the two-dimensional rendering scene and the three-dimensional rendering scene.
Citation Information
Patent Citations
Situation map two-dimensional and three-dimensional integrated rendering method
CN116363324A