Map generation method and apparatus
By directly rendering the target map based on pixel coordinates, geographic coordinate conversion is avoided, layer rendering order is optimized, map rendering efficiency is solved, target maps are quickly displayed, and user experience is improved.
Patent Information
- Application Number
- PCT/IB2024/062863
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-01-11
- Filing Date
- 2024-12-19
- Publication Date
- 2025-07-17
AI Technical Summary
In the prior art, map rendering efficiency is low, resulting in long wait times for users and unable to meet the requirements of device hardware limitations.
By obtaining map tile files, converting pixel coordinates, creating map generation tasks, and rendering map tiles in sequence according to layer display priority, avoiding the operation of converting geographical coordinates to pixel coordinates, and optimizing the layer rendering order.
Improve map rendering efficiency, reduce user waiting time, and improve user experience.
Smart Images

Figure IB2024062863_17072025_PF_FP_ABST
Abstract
Description
Method and apparatus for map generation - Technical field
[0001] Embodiments of this specification relate to the technical field of map generation, and particularly to a method and apparatus for map generation. Background technique
[0002] With the rapid development of the Internet of Things and mobile devices, more and more devices have started to provide geographic information services, such as movable devices like smart wearable products and mobile phones. However, maps are an application with very high resource requirements. Due to the hardware limitations of the devices, the rendering efficiency and performance of maps have faced great challenges. In related technologies, when performing map rendering, a large amount of vector data usually needs to be frequently converted and then real-time rendered on the screen rendering engine. This will consume a large amount of time and computing power to complete map rendering, prolonging the waiting time of users and reducing the user experience. Therefore, there is an urgent need for a more efficient map generation method to solve the above problems. Summary of the invention
[0003] In view of this, embodiments of this specification provide a method for map generation. One or more embodiments of this specification also relate to a map generation apparatus, a computing device, a computer-readable storage medium, and a computer program to solve the technical defects existing in related technologies.
[0004] According to the first aspect of the embodiments of this specification, there is provided a method for map generation, which is applied to a client and includes: obtaining at least two map tile files in response to a map generation request; converting the pixel coordinates included in the at least two map tile files, and determining target map tile files corresponding to the at least two map tiles respectively according to the conversion result; creating a map generation task based on the at least two target map tile files; by executing the map generation task, rendering the layers corresponding to the at least two map tiles in sequence according to the layer display priority, and based on the layers corresponding to the at least two rendered map tiles, sequentially displaying a target map associated with the layer display priority; wherein, the rendering period corresponding to each layer display priority is used to synchronously render the target layers corresponding to the at least two map tiles respectively.
[0005] According to the second aspect of the embodiments of the present specification, a map generation device is provided, which is applied to a client and includes: an acquisition module configured to acquire at least two map block files in response to a map generation request; a conversion module configured to convert the pixel coordinates included in the at least two map block files and determine the target map block files respectively corresponding to the at least two map blocks according to the conversion result; a creation module configured to create a map generation task based on the at least two target map block files; a rendering module configured to, by executing the map generation task, render the layers corresponding to the at least two map blocks in sequence according to the layer display priority, and based on the layers corresponding to the at least two rendered map blocks, sequentially display the target map associated with the layer display priority; wherein, the rendering period corresponding to each layer display priority is used to synchronously render the target layers respectively corresponding to the at least two map blocks.
[0006] According to the third aspect of the embodiments of the present specification, a computing device is provided, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, and when the computer-executable instructions are executed by the processor, the steps of the above-mentioned map generation method are implemented.
[0007] According to the fourth aspect of the embodiments of the present specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the above-mentioned map generation method are implemented.
[0008] According to the fifth aspect of the embodiments of the present specification, a computer program is provided, wherein when the computer program is executed on a computer, the computer is made to execute the steps of the above-mentioned map generation method.
[0009] A map generation method provided by an embodiment of the present specification obtains at least two map block files in response to a map generation request; converts the pixel coordinates contained in the at least two map block files, and determines the target map block files corresponding to the at least two map blocks respectively according to the conversion results; creates a map generation task based on the at least two target map block files; by executing the map generation task, the layers corresponding to the at least two map blocks are sequentially rendered according to the layer display priority, and based on the layers corresponding to the at least two map blocks after rendering, the target map associated with the layer display priority is sequentially displayed; wherein, the rendering cycle corresponding to each layer display priority is used to synchronously render the target layers corresponding to the at least two map blocks respectively. By directly rendering the target map based on the map block file containing pixel coordinates, the operation of converting geographic coordinates into pixel coordinates during the target map rendering process is avoided, thereby improving the rendering efficiency of the target map; in addition, the layers corresponding to the at least two map blocks are sequentially rendered according to the layer display priority, so as to achieve the purpose of layer-by-layer target map rendering, thereby being able to quickly display the target map, reduce the waiting time of the client user, and improve the user experience. Description of the drawings
[0010] FIG1 is a schematic diagram of a processing process of a map generation method provided by an embodiment of this specification;
[0011] FIG2 is a flow chart of a map generation method provided by an embodiment of the present specification;
[0012] FIG3 is a rendering diagram of a map generation method provided by an embodiment of the present specification;
[0013] FIG4 is a flowchart of a processing process of a map generation method provided by an embodiment of this specification;
[0014] FIG5 is a schematic diagram of the structure of a map generating device provided by an embodiment of the present specification;
[0015] FIG6 is a block diagram of a computing device provided by an embodiment of the present specification.
[0016] In the following description, many specific details are set forth to facilitate a full understanding of this specification. The invention can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present specification, so the present specification is not limited to the specific implementation disclosed below.
[0017] The terms used in one or more embodiments of this specification are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of this specification. The singular forms "a", "the", and "said" used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly dictates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0018] It should be understood that although the terms first, second, etc. may be used in one or more embodiments of this specification to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "when...", "while...", or "in response to determining".
[0019] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data that have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of the relevant data need to comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation entrances are provided for the user to select authorization or rejection.
[0020] First, the noun terms involved in one or more embodiments of this specification are explained.
[0021] Vector tile map: A vector tile map is a map display and rendering technology based on vector data. Compared with traditional raster tile maps, a vector tile map uses vector data (such as geometric elements like points, lines, and polygons) to describe geographical elements on the map instead of using pixel lattices. This makes the vector tile map have higher clarity, more accurate geographical location information, and more flexible visualization effects. A vector tile map usually consists of multiple vector tiles (small maps), and each tile contains geographical element information within a certain range. By splicing these tiles together, global map coverage can be achieved.
[0022] Map Rendering: Map rendering refers to the process of converting geographical data into a visual map. Through map rendering, geographical data can be presented in a visual form, enabling users to intuitively understand and analyze geographical information.
[0023] Figure 1 is a schematic diagram of the processing process of a map generation method provided by an embodiment of this specification; as shown in Figure 1, after receiving a map generation request, at least two map tile files are obtained based on the map generation request. Determine the pixel coordinates included in at least two map tile files, and convert the pixel coordinates included in at least two map tile files into screen coordinates. Based on the conversion result, determine the target map tile files corresponding to at least two map tiles respectively. Create a map generation task based on at least two target map tile files, and then, by executing the map generation task, render the layers corresponding to at least two map tiles in sequence according to the layer display priority. That is, determine the data to be rendered with the same layer display priority corresponding to at least two map tiles respectively and render them. Based on the layers corresponding to at least two map tiles after rendering, sequentially display the target maps with the associated layer display priority. The rendering period corresponding to each layer display priority is used to synchronously render the target layers corresponding to at least two map tiles respectively. In this specification, a map generation method is provided. This specification also relates to a map generation device, a computing device, and a computer-readable storage medium, which will be described in detail one by one in the following embodiments.
[0024] Refer to Figure 2. Figure 2 shows a flowchart of a map generation method provided by an embodiment of this specification, which specifically includes the following steps.
[0025] Step 202: Obtain at least two map tile files in response to a map generation request.
[0026] Specifically, the map generation request can be a computer command submitted by a user through a touch command on a client for generating a map; the client can be a mobile terminal such as a mobile phone or a computer, or a low-resource embedded device such as a smartwatch or a vehicle navigation device; the map tile file can be a file storing map data corresponding to a vector tile for rendering a vector tile map.
[0027] Based on this, when drawing a map, receive a map generation request, and obtain at least two map tile files based on the map generation request for subsequent map rendering and generation.
[0028]
[0029] In practical applications, the map tile file can be a vector tile json file; the map tile file stores the pixel coordinates of map elements such as roads, bridges, buildings, and scenic spots in the map, as well as the rendering data corresponding to each map element; the coordinates corresponding to each map element in the map tile file are stored in the form of pixel coordinates. Subsequently, when rendering the target map, the pixel coordinates can be directly converted into screen coordinates to render the target map.
[0030] Furthermore, considering that the data used to render the target map are all geographical data containing actual longitude and latitude coordinate data, and rendering the map based on geographical data containing actual longitude and latitude coordinate data will consume a large amount of computing resources. Therefore, coordinate conversion can be completed before generating the map tile file, and the specific implementation is as follows: Determine the global map tile, and determine the target map tile in the global map tile based on the map tile division rule; Determine the geographical data corresponding to the target map tile, and determine the geographical coordinates in the geographical data; Convert the geographical coordinates into pixel coordinates, and replace the geographical coordinates in the geographical data based on the pixel coordinates. Generate the map tile file corresponding to the target map tile according to the replacement result.
[0031] Specifically, the global map tile can be the map tile that matches the range of the map to be generated when generating the map in the client; the map division rule can be a preset map range division rule for the global map tile. The map division rule can be to evenly divide the global map into a preset number of map tiles according to the length and width of the global map; The target map tile is any one of the map tiles determined after dividing the global map tile in real time. The geographical data is the actual data containing geographical elements corresponding to the target map tile; the geographical coordinates are the longitude and latitude coordinates of the geographical elements, that is, the longitude coordinate and the latitude coordinate.
[0032] Based on this, determine the global map tile for displaying the map, and determine the map tile division rule according to the length parameter and width parameter of the global map tile. Divide the global map tile based on the map tile division rule, and determine one of the map tiles obtained by division as the target map tile. Determine the geographical data corresponding to the target map tile, and determine the geographical coordinates corresponding to each map element in the geographical data. Use trigonometric functions to convert the geographical coordinates into pixel coordinates, and replace the geographical coordinates in the geographical data based on the pixel coordinates. Generate the map tile file corresponding to the target map tile according to the replacement result.
[0033] For example, for the global map tile shown in Figure 3, the global map tile can be divided according to the length and width of the global map tile into 9 map tiles numbered from 1 to 9, and any one of the map tiles can be selected as the target map tile. When selecting the map tile corresponding to 1 as the target map tile, the geographical coordinates in the geographical data corresponding to the target map tile are converted into pixel coordinates to generate a map tile file. The map tile file is a vector tile json file.
[0034] In summary, by performing coordinate conversion on the geographical coordinates corresponding to the target map tile to obtain pixel point coordinates, and then generating a map tile file corresponding to the target map tile. This is to facilitate subsequent map rendering based on the map tile file, reduce the consumption of computing resources caused by coordinate conversion, improve the map rendering speed, and enhance the user experience.
[0035] Furthermore, considering that the geographical data to be processed corresponding to the target map tile may contain data that is not real-time or data that does not conform to actual geographical elements, in order to ensure the real-time and authenticity of the generated map, it is necessary to perform data filtering and screening after obtaining the geographical data to be processed. The specific implementation is as follows: determine the geographical data to be processed corresponding to the target map tile; filter and screen the geographical data to be processed to obtain the geographical data.
[0036] Specifically, the geographical data to be processed refers to the geographical data corresponding to the target map tile, which includes the geographical coordinates of geographical elements and the image data of geographical elements; filtering and screening means determining and deleting the data lacking authenticity and real-time in the geographical data to be processed.
[0037] Based on this, determine the geographical data to be processed corresponding to the target map tile. Filter and screen the geographical data to be processed in sequence to obtain the geographical data of a structure suitable for rendering.
[0038] In summary, by filtering and screening the geographical data to be processed in sequence, the geographical data of a structure suitable for rendering is obtained, which facilitates subsequent map rendering and improves the authenticity of the map.
[0039] Furthermore, considering the visual effect of the map obtained by rendering, geographical symbol data can be determined for geographical elements according to requirements. The specific implementation is as follows: filter and screen the geographical data to be processed to obtain initial geographical data; construct geographical symbol data corresponding to the geographical elements in the initial geographical data; based on the initial geographical data and the geographical symbol data to form the geographical data, where the geographical symbol data is used to render the map elements in the target map.
[0040] Specifically, the initial geographic data refers to the data obtained after filtering and screening the geographic data to be processed; the geographic symbol data refers to the data such as the attributes, types, sizes, colors, etc. of the geographic symbols corresponding to the geographic elements; and the map elements are elements such as rivers, roads, bridges, buildings, etc.
[0041] Based on this, the geographic data to be processed is filtered and screened to obtain the initial geographic data; the geographic symbol data corresponding to the geographic elements in the initial geographic data is constructed according to the types and attributes of the geographic elements in the initial geographic data. The geographic data is composed of the initial geographic data and the geographic symbol data. The geographic symbol data is used to render the map elements in the target map, and there is a symbol correspondence relationship between the geographic symbol data and the geographic elements.
[0042] Continuing with the above example, in the case where the initial geographic data contains building data and the type of the building is determined to be a scenic spot, the symbol data of the scenic spot type is selected as the geographic symbol data of the scenic spot.
[0043] In summary, by constructing the geographic symbol data corresponding to the geographic elements in the initial geographic data, different symbols can be rendered according to the types of the geographic elements during the subsequent map rendering, thereby improving the visual effect of the map.
[0044] Furthermore, considering that the map rendering cannot be directly completed based on the longitude and latitude coordinates in the target geographic coordinates, it is therefore also necessary to convert the longitude coordinate and the latitude coordinate in the target geographic coordinates to obtain the target pixel coordinates. The specific implementation is as follows: Determine the longitude coordinate and the latitude coordinate in the target geographic coordinates; Calculate the longitude pixel coordinate corresponding to the longitude coordinate and calculate the latitude pixel coordinate corresponding to the latitude coordinate based on the floating-point function and the pixel parameters; The target pixel coordinates corresponding to the target geographic coordinates are composed of the longitude pixel coordinate and the latitude pixel coordinate.
[0045] Specifically, the longitude coordinate and the latitude coordinate are the longitude and latitude coordinates in the world coordinate system; the floating-point function is floor, which is used to round off decimals; the pixel parameters refer to the pixel value and the zoom level. The pixel parameter can be 256 and the zoom level can be 2; the longitude pixel coordinate refers to the coordinate value obtained after converting the longitude coordinate into a pixel coordinate; correspondingly, the latitude pixel coordinate is the coordinate value obtained after converting the latitude coordinate into a pixel coordinate, and the target pixel coordinate is the pixel coordinate obtained after converting the longitude coordinate and the latitude coordinate in the target geographic coordinates.
[0046] Based on this, the longitude coordinates and latitude coordinates included in a set of coordinates in the target geographical coordinates are determined. According to the coordinate conversion formula, the longitude pixel coordinates corresponding to the longitude coordinates are calculated based on the floating-point function and pixel parameters, and according to the coordinate conversion formula, the latitude pixel coordinates corresponding to the latitude coordinates are calculated based on the floating-point function and pixel parameters. A set of coordinates is composed of the longitude pixel coordinates and the latitude pixel coordinates. The target pixel coordinates corresponding to the target geographical coordinates are composed of the longitude pixel coordinates and the latitude pixel coordinates.
[0047] Continuing with the above example, in practical applications, each map tile corresponds to a vector tile, and the data corresponding to the vector tile is described by tileX_tileY_road.json and tileX_tileY_poi.json. mapX and mapY are the X coordinate (longitude coordinate) and Y coordinate (latitude coordinate) of the current geographical element, which are calculated from the longitude and latitude of the current position and the current zoom level. The general calculation formulas are as follows: sin latitude = 111 * (latitude * π / 180); pixelX (longitude pixel coordinate) = ((longitude + 180) / 360) * 256 * 2^(zoom level - 2); pixelY (latitude pixel coordinate) = (0.5 - log((1 + sin latitude) / (1 - sin latitude)) / (4 * π)) * 256 * 2; tileX (tile coordinate) = floor(pixelX / 256); The floor function can be used to determine which pixel a point is on. Since the pixel coordinates are integers, the actual coordinates need to be rounded down to obtain the correct pixel position; tileY (tile coordinate) = floor(pixelY / 256).
[0048] In summary, the longitude coordinates and latitude coordinates in the target geographical coordinates are converted to obtain the target pixel coordinates, so as to complete the coordinate conversion before generating the map tile file, and there is no need to perform the conversion of the longitude coordinates and latitude coordinates again during subsequent map rendering, reducing the consumption of computing resources.
[0049] Step 204: Convert the pixel coordinates included in the at least two map tile files, and determine the target map tile files corresponding to the at least two map tiles according to the conversion results.
[0050] Specifically, after obtaining at least two map tile files in response to a map generation request, the pixel coordinates included in the at least two map tile files can be converted, and the target map tile files corresponding to the at least two map tiles can be determined according to the conversion results. Among them, the pixel point coordinates refer to the pixel coordinates of the map elements used to render the map in the map tile file; that is, the coordinates obtained after converting the longitude and latitude coordinates; correspondingly, the conversion result is the screen coordinates obtained by converting the pixel coordinates again, which can be used for map rendering; the target map file contains screen coordinates. After the pixel coordinates in the map tile file are replaced by the corresponding screen coordinates, the target map tile file corresponding to the map tile file is obtained. A map tile corresponds to a vector tile, which is a map tile with a specific range in the global map. A map tile can also be a local map tile obtained by equally dividing the global map.
[0051] Based on this, after obtaining at least two map tile files in response to a map generation request, the pixel coordinates included in the at least two map tile files are converted, and the conversion result is obtained after converting the pixel coordinates in the map tile file into screen coordinates. The target map tile files corresponding to the at least two map tiles are determined based on the conversion results.
[0052] Furthermore, considering that pixel coordinates cannot be directly used for map rendering, in order to achieve a data format that can be directly rendered, the pixel coordinates need to be converted to update the pixel coordinates to screen coordinates and update to a data format that can be used for map rendering. The specific implementation is as follows: Determine the pixel coordinates in the original map tile file; convert the pixel coordinates to screen coordinates, and update the pixel coordinates in the original map tile file based on the screen coordinates, and generate the target map tile file corresponding to the original map tile file according to the update result.
[0053] Specifically, the original map tile file refers to the map tile file corresponding to any map tile determined after dividing the global map tile; the screen coordinates are coordinates suitable for directly performing map rendering and are used to render the corresponding map elements on the screen of the client; the update result is the replacement result after replacing the pixel coordinates with the screen coordinates.
[0054] Based on this, determine the pixel coordinates in the original map tile file and convert the pixel coordinates to screen coordinates. Update the corresponding pixel coordinates in the original map tile file based on the screen coordinates, replace the pixel coordinates with the screen coordinates, and realize the update of the pixel coordinates. Generate the target map tile file corresponding to the original map tile file according to the update result.
[0055] In summary, by replacing the pixel coordinates in the original map tile file with screen coordinates, the pixel coordinates can be replaced with screen coordinates, and then subsequent map rendering can be directly performed based on the target map tile file containing the screen coordinates.
[0056] Step 206: Create a map generation task based on the at least two target map tile files.
[0057] Specifically, after converting the pixel coordinates included in the at least two map tile files and determining the target map tile files corresponding to the at least two map tiles according to the conversion results, a map generation task can be created based on the at least two target map tile files. Among them, the map generation task is used to render the target map. By executing the map generation task, the sequential rendering of multiple target maps is completed. After the map generation task is executed, a map composed of multiple target maps and displayed on the client is obtained.
[0058] Based on this, after converting the pixel coordinates included in the at least two map tile files and determining the target map tile files corresponding to the at least two map tiles according to the conversion results, a map generation task can be created based on the at least two target map tile files, and then by executing the map generation task, the map is rendered based on the data in the at least two target map tile files.
[0059] Furthermore, considering that a target map tile file usually contains layer data of multiple levels, and the layer data of each level is used to render a map tile layer, and different target map tile files correspond to different rendering positions. Therefore, when creating a map generation task, map generation subtasks can be created by combining the layer data and the position data, and then a map generation task can be created based on the at least two map generation subtasks. The specific implementation is as follows: Create a map generation subtask corresponding to each map tile based on the layer data respectively included in the at least two target map tile files and the position data respectively corresponding to the at least two target map tile files; Create the map generation task based on the map generation subtasks corresponding to each map tile; Among them, the map generation subtasks included in the map generation task have an execution order, and among two adjacent map generation subtasks in the execution order, the subsequent map generation subtask is executed based on the task execution result of the previous map generation subtask.
[0060] Specifically, the layer data refers to the data of a layer used for rendering a map. The types of layers include, but are not limited to, terrain layers, water body layers, road layers, building layers, and green space layers. Among them, the terrain layer shows the terrain height and relief of the Earth's surface. This layer can be used to represent terrain features such as mountains, valleys, plateaus, etc.; the water body layer shows the outlines and distributions of water bodies such as rivers, lakes, and oceans. This layer can be used to represent relevant information such as the area and depth of the water body; the road layer shows the network of roads and streets, including main roads, secondary roads, highways, streets, etc. This layer provides information such as the names of roads, road conditions, and the number of lanes; the building layer shows the outlines of buildings in a city or area. This layer can be used to represent the types of buildings (such as residential buildings, commercial buildings, industrial buildings, etc.) and other building-related information; the green space layer shows the distributions of green areas such as parks, gardens, and forests. This layer can be used to represent information such as the area of the green space and the types of vegetation. The position data refers to the position of the map block corresponding to the target map road block file in the global map block; the map generation subtask refers to the map layer rendering task in which each layer under the same display priority corresponding to at least two target map blocks is rendered simultaneously. The building layer shows the outlines of buildings in a city or area. This layer can be used to represent the types of buildings (such as residential buildings, commercial buildings, industrial buildings, etc.) and other building-related information; the green space layer shows the distributions of green areas such as parks, gardens, and forests. This layer can be used to represent information such as the area of the green space and the types of vegetation.
[0061] Based on this, determine the layer data respectively contained in at least two target map block files, and determine the position data respectively corresponding to at least two target map block files. Create a map generation subtask corresponding to each map block based on the layer data respectively contained in at least two target map block files and the respectively corresponding position data. Create a map generation task based on the map generation subtasks corresponding to each map block. The map generation subtasks included in the map generation task have a sequence of task execution. Among two adjacent map generation subtasks in the execution sequence, the subsequent map generation subtask is executed based on the task execution result of the previous map generation subtask. That is, after the previous map generation subtask is executed and the target map is obtained, the subsequent map generation subtask is then executed on the basis of the target map, and the next target map is generated on the basis of the target map. The target map serves as the first layer, and the next target map serves as the second layer and is displayed above the first layer, achieving the effect of superimposed display of the first layer and the second layer.
[0062] For example, when creating a map generation task with 3 target map blocks and 2 layers for each, the target map block files corresponding to the 3 target map blocks are determined respectively; and according to the layer display priority, the first layer data and the second layer data in the target map block files corresponding to the 3 target map blocks are determined respectively. Based on the first layer data and the position data of the 3 target map blocks, a map generation subtask corresponding to the first layer is generated, and a map generation subtask corresponding to the second layer is generated. The map generation task consists of the map generation subtasks corresponding to the two layers respectively. When executing the map generation task, the two map generation subtasks are executed in sequence according to the execution order. After the map generation subtask corresponding to the first layer is executed and the terrain layer is rendered, the map generation subtask corresponding to the second layer is continued to be executed, and the water body layer is rendered on the basis of the terrain layer.
[0063] In summary, by creating at least two map generation subtasks based on the layer data and position data of the target map block files, and then forming a map generation task from at least two map generation subtasks, it is possible to achieve the purpose of sequentially rendering the target maps corresponding to each layer when the task is executed.
[0064] Step 208: By executing the map generation task, the layers corresponding to the at least two map blocks are sequentially rendered according to the layer display priority, and based on the rendered layers corresponding to the at least two map blocks, the target maps associated with the layer display priority are sequentially displayed. Among them, the rendering period corresponding to each layer display priority is used to synchronously render the target layers corresponding to the at least two map blocks respectively.
[0065] Specifically, after creating the map generation task based on the at least two target map block files, the layers corresponding to the at least two map blocks can be sequentially Render, and based on the layers corresponding to at least two map tiles after rendering, sequentially display the target map associated with the display priority of the layer. Among them, the rendering period corresponding to each layer display priority is used to synchronously render the target layers corresponding to the at least two map tiles. Here, the layer refers to a map element layer in the map tile, and the layer includes but is not limited to a terrain layer, a water body layer, a road layer, a building layer, and a greenery layer; the layer display priority is used to represent the rendering and display order of each layer; the target map is the map obtained after rendering the layers with the same layer display priority corresponding to at least two map tiles respectively; the rendering period is the rendering time of a target map, that is, the rendering time of the target layers corresponding to the same layer display priority of at least two map tiles respectively.
[0066] Based on this, after creating a map generation task based on at least two target map tile files, by executing the map generation task, render the layers corresponding to the at least two map tiles in sequence according to the layer display priority, and simultaneously render the layers with the same layer display priority in at least two map tiles, and based on the layers corresponding to the at least two map tiles after rendering, sequentially display the target map associated with the display priority of the associated layer. After the target maps corresponding to the display priority of each layer are sequentially displayed, the global map corresponding to the map generation request can be obtained. The rendering period corresponding to each layer display priority is used to synchronously render the target layers corresponding to the at least two map tiles respectively.
[0067] Further, the rendering of the target map corresponding to any one layer display priority includes: determining the initial layer data corresponding to the at least two map tiles respectively; performing synchronous rendering based on the initial layer data corresponding to the at least two map tiles respectively; based on the initial layers corresponding to the at least two map tiles after rendering, generate and display the target map corresponding to the layer display priority.
[0068] Specifically, the initial layer data refers to the layer data used to render a layer corresponding to at least two map tiles respectively; the initial layer is the map layer corresponding to a map tile in the target map obtained by rendering based on the initial layer data.
[0069] Based on this, determine the initial layer data corresponding to at least two map tiles respectively, and perform synchronous rendering based on the initial layer data corresponding to at least two map tiles respectively. At the same time, perform rendering synchronously based on the initial layer data corresponding to each map tile. Based on the initial layers corresponding to at least two map tiles after rendering, determine the arrangement order of each initial layer according to the arrangement order of each map tile, and combine the arrangement order of the initial layers to generate and display a target map corresponding to the layer display priority based on the initial layers.
[0070] Continuing with the above example, as shown in Figure 3, determine the initial layer data corresponding to the same layer display priority of Map Tile 1 - Map Tile 9 respectively. At the same time, perform synchronous rendering based on the initial layer data corresponding to Map Tile 1 - Map Tile 9 respectively to obtain the initial layer corresponding to each map tile, that is, Initial Layer 1 - Initial Layer 9. Generate a target map based on Initial Layer 1 - Initial Layer 9 according to the respective arrangement order and position of Map Tile 1 - Map Tile 9.
[0071] To sum up, perform synchronous rendering based on the initial layer data corresponding to at least two map tiles respectively, and generate and display a target map corresponding to the layer display priority based on the initial layers corresponding to at least two map tiles after rendering, completing the rendering of the target map at one level, so that the target map of an entire layer can be displayed on the screen of the client, improving the user's visual experience. After rendering, generate and display a target map corresponding to the layer display priority based on the initial layers corresponding to at least two map tiles after rendering, completing the rendering of the target map at one level, so that the target map of an entire layer can be displayed on the screen of the client, improving the user's visual experience.
[0072] Furthermore, the rendering of the layer corresponding to any one map tile includes: determining the target layer data corresponding to the target map tile; dividing the target layer data into at least two groups of to-be-rendered layer data corresponding to the layer display priority; and rendering the target map tile sequentially using at least two groups of to-be-rendered layer data according to the layer display priority, and sequentially displaying the target sub-maps associated with the layer display priority.
[0073] Specifically, the target layer data is the global layer data corresponding to the target map tile for rendering the layer; the to-be-rendered layer data is the layer data for rendering one layer divided from the target layer data according to the layer display priority; the target map tile is any one map tile in the global map tiles; and the target sub-map is the map obtained after the rendering of one layer corresponding to the target map tile is completed.
[0074] Based on this, the target layer data corresponding to the target map block is determined, and the target layer data is divided into at least two groups of to-be-rendered layer data corresponding to the layer display priorities according to the layer display priorities. According to the layer display priorities, the target map block is rendered and displayed in sequence using the at least two groups of to-be-rendered layer data, and the target sub-maps associated with the layer display priorities are displayed in sequence. After the at least two groups of to-be-rendered layer data are rendered to obtain at least two target sub-maps, the global map corresponding to the target map block can be obtained by sequentially displaying the at least two target sub-maps in the rendering order.
[0075] Continuing with the above example, the target layer data corresponding to the target map block is divided according to the layer display priorities, obtaining terrain layer data with a layer display priority of 1, water body layer data with a layer display priority of 2, road layer data with a layer display priority of 3, and building layer data with a layer display priority of 4. According to the layer display priorities, each layer of data is rendered in sequence to obtain the target sub-maps under the temporary priorities of each layer.
[0076] In summary, according to the layer display priorities, the target map block is rendered and displayed in sequence using the at least two groups of to-be-rendered layer data, and the target sub-maps corresponding to each layer display priority are displayed, realizing the hierarchical rendering of the map.
[0077] The map generation method provided by an embodiment of this specification responds to a map generation request to obtain at least two map block files; converts the pixel coordinates included in the at least two map block files, and determines the target map block files corresponding to the at least two map blocks according to the conversion results; creates a map generation task based on the at least two target map block files; by executing the map generation task, the layers corresponding to the at least two map blocks are rendered in sequence according to the layer display priorities, and based on the layers corresponding to the at least two map blocks after rendering, the target maps associated with the layer display priorities are displayed in sequence; wherein, the rendering period corresponding to each layer display priority is used to synchronously render the target layers corresponding to the at least two map blocks respectively. By directly rendering the target map based on the map block file containing pixel coordinates, the operation of converting geographical coordinates into pixel coordinates during the rendering process of the target map is avoided. The rendering efficiency of the target map is improved; in addition, the layers corresponding to the at least two map blocks are rendered in sequence according to the layer display priorities, achieving the purpose of rendering the target map layer by layer, so that the target map can be quickly displayed, reducing the waiting time of client users and improving the user experience.
[0078] Combined with FIG. 4, taking the application of the map generation method provided in this specification in map rendering as an example, the map generation method will be further described. Wherein, FIG. 4 shows a flowchart of the processing process of a map generation method provided by an embodiment of this specification, which specifically includes the following steps.
[0079] Step 402: Determine the global map block, and divide the global map block into at least two target map blocks based on the map block division rule.
[0080] In the scenario of realizing vector tile map rendering on a low-resource embedded device, in order to achieve efficient rendering, on the one hand, when generating the map block file (vector tile json file) corresponding to the vector tile, the geographical coordinates (latitude and longitude coordinates) can be converted into pixel coordinates and the pixel coordinates are stored in the map block file; on the other hand, when performing the rendering of the layers corresponding to the map, the layer rendering order is optimized to avoid unnecessary repeated rendering and drawing operations, effectively reducing the computational load and memory occupancy of the rendering engine and improving the processing speed of the rendering engine.
[0081] In practical applications, the global map block displayed on the low-resource embedded device can be divided into at least two target map blocks arranged regularly. Each target map block corresponds to at least two layers, and the layers include but are not limited to terrain layer, water body layer, road layer, building layer, and green space layer.
[0082] Step 404: Determine the geographical data to be processed corresponding to the target map block, and filter and screen the geographical data to be processed to obtain the initial geographical data.
[0083] Preprocess the obtained geographical data to be processed, including data reading, parsing, and preprocessing, such as projection conversion, data filtering and screening, etc. The purpose of data processing is to convert the original geographical data into a format and structure that can be rendered.
[0084] Step 406: Construct geographical symbol data corresponding to the geographical elements in the initial geographical data, and form geographical data based on the initial geographical data and the geographical symbol data.
[0085] Perform symbolization processing on the geographical elements, and select appropriate symbol styles and rendering rules for the geographical elements. Each geographical element can be represented through symbolization, such as points, lines, surfaces, etc. The symbolization rules can be defined according to the attribute values, types, spatial relationships, etc. of the geographical elements, so as to display different symbol styles on the map. When rendering the map subsequently, rich rendering effects of geographical elements can be obtained.
[0086] Step 408: Determine the target geographic coordinates in the geographic data, and convert the longitude coordinate and latitude coordinate in the target geographic coordinates into longitude pixel coordinates and latitude pixel coordinates respectively.
[0087] Step 410: Based on the longitude pixel coordinates and latitude pixel coordinates, form the target pixel coordinates corresponding to the target geographic coordinates.
[0088] Each map tile corresponds to a vector tile, and the data corresponding to the vector tile is described by tileX_tileY_road.json and tileX_tileY_poi.json. mapX and mapY are the X coordinate (longitude coordinate) and Y coordinate (latitude coordinate) of the current geographic element respectively, which are calculated from the longitude, latitude and current zoom level of the current position. The general calculation formula is: sin latitude = sin(latitude * pi / 180); pixelX (longitude pixel coordinate) = ((longitude + 180) / 360) * 256 * 2 (zoom level 2); pixelY (latitude pixel coordinate) = (0.5 - log((1 + sin latitude) / (1 - sin latitude)) / (4 * pi)) * 256 * 2; tileX (tile coordinate) = floor(pixelX / 256); The floor function can be used to determine which pixel a point is on. Since pixel coordinates are all integers, the actual coordinates need to be rounded down to get the correct pixel position; tileY (tile coordinate) = floor(pixelY / 256).
[0089] Step 412: Generate the map tile file corresponding to the target map tile based on the target pixel coordinates, and when receiving a map generation request, convert the pixel coordinates included in at least two map tile files, and determine the target map tile files corresponding to at least two map tiles according to the conversion results.
[0090] Determine the pixel coordinates in the original map tile file, convert the pixel coordinates into screen coordinates, and update the pixel coordinates in the original map tile file based on the screen coordinates, and generate the target map tile file corresponding to the original map tile file according to the update results.
[0091] Step 414: Create a map generation task based on the layer data respectively included in at least two target map tile files and the position data respectively corresponding to at least two target map tile files.
[0092] The map generation task includes map generation subtasks. The map generation subtasks have an execution order. Among two adjacent map generation subtasks in the execution order, the subsequent map generation subtask is executed based on the task execution result of the previous map generation subtask.
[0093] Step 416: By executing the map generation task, render the layers corresponding to at least two map tiles in sequence according to the layer display priority, and based on the layers corresponding to the at least two rendered map tiles, sequentially display the target map associated with the layer display priority.
[0094] In practical applications, during the map rendering process, a strategy of first the whole and then the local is adopted. During rendering, the bottom layer of the first vector tile in the upper left corner is rendered first according to the arrangement order of the vector tiles, such as the terrain layer, the water body layer, the green space layer, and then the bottom layer of the second vector tile is rendered. The bottom layers of all vector tiles are rendered in sequence. After these layers are rendered, other building layers are rendered to supplement the details of the map. This can avoid large areas of blankness during the map rendering process and improve the user's visual experience.
[0095] In summary, the map generation method provided by an embodiment of this specification is optimized in terms of data conversion dimension and layer rendering dimension. On the one hand, by optimizing the processing of vector data, the complexity of data conversion is simplified. This optimization method can reduce the computational resource requirements for data processing and improve the efficiency of data conversion, thereby accelerating the map rendering speed. On the other hand, by optimizing the order of rendering layers, the rendering engine can process the rendering of map layers more efficiently. By adjusting the rendering order of layers, unnecessary repeated rendering and drawing operations can be reduced, improving the rendering efficiency and rate. At the same time, the rendering rate of vector tile maps on low-resource embedded devices is significantly improved. By reducing the complexity of data conversion and optimizing the layer rendering order, the computational load and memory occupation of the rendering engine can be effectively reduced, and further accelerate the map rendering speed.
[0096] The map generation method provided by an embodiment of this specification acquires at least two map tile files in response to a map generation request; converts the pixel coordinates included in the at least two map tile files, and determines the target map tile files corresponding to the at least two map tiles according to the conversion result; creates a map generation task based on the at least two target map tile files; by executing the map generation task, renders the layers corresponding to the at least two map tiles in sequence according to the layer display priority, and based on the layers corresponding to the at least two map tiles after rendering, sequentially displays the target map associated with the layer display priority; wherein, the rendering period corresponding to each layer display priority is used to synchronously render the target layers corresponding to the at least two map tiles. By directly rendering the target map based on the map tile files containing pixel coordinates, the operation of converting geographical coordinates into pixel coordinates during the rendering process of the target map is avoided, and the rendering efficiency of the target map is improved; in addition, the layers corresponding to the at least two map tiles are rendered in sequence according to the layer display priority, achieving the purpose of rendering the target map layer by layer, so that the target map can be quickly displayed, reducing the waiting time of client users and improving the user experience.
[0097] Corresponding to the above method embodiment, this specification also provides an embodiment of a map generation device. FIG. 5 shows a schematic structural diagram of a map generation device provided by an embodiment of this specification. As shown in FIG. 5, the device includes an acquisition module 502, a conversion module 504, a creation module 506, and a rendering module 508.
[0098] The acquisition module 502 is configured to acquire at least two map tile files in response to a map generation request.
[0099] The conversion module 504 is configured to convert the pixel coordinates included in the at least two map tile files, and determine the target map tile files corresponding to the at least two map tiles according to the conversion result.
[0100] The creation module 506 is configured to create a map generation task based on the at least two target map tile files.
[0101] The rendering module 508 is configured to, by executing the map generation task, render the layers corresponding to the at least two map tiles in sequence according to the layer display priority, and based on the layers corresponding to the at least two map tiles after rendering, sequentially display the target map associated with the layer display priority; wherein, the rendering period corresponding to each layer display priority is used to synchronously render the target layers corresponding to the at least two map tiles.
[0102] In an alternative embodiment, the obtaining module 502 is further configured to: determine a global map block, and determine a target map block in the global map block based on a map block division rule; determine geographic data corresponding to the target map block, and determine geographic coordinates in the geographic data; convert the geographic coordinates into pixel coordinates, and replace the geographic coordinates in the geographic data based on the pixel coordinates, and generate a map block file corresponding to the target map block according to the replacement result.
[0103] In an alternative embodiment, the rendering module 508 is further configured to: determine initial layer data respectively corresponding to the at least two map blocks; perform synchronous rendering based on the initial layer data respectively corresponding to the at least two map blocks; generate a target map corresponding to the layer display priority based on the initial layers respectively corresponding to the at least two rendered map blocks, and display the target map.
[0104] In an alternative embodiment, the creating module 506 is further configured to: create a map generation subtask corresponding to each map block based on the layer data respectively included in the at least two target map block files and the position data respectively corresponding to the at least two target map block files; create the map generation task based on the map generation subtasks corresponding to each map block; wherein, the map generation subtasks included in the map generation task have an execution order, and in two adjacent map generation subtasks in the execution order, the subsequent map generation subtask is executed based on the task execution result of the previous map generation subtask.
[0105] In an alternative embodiment, the rendering module 508 is further configured to: determine target layer data corresponding to a target map block; divide the target layer data into at least two groups of to-be-rendered layer data corresponding to the layer display priority; render the target map block in sequence using the at least two groups of to-be-rendered layer data according to the layer display priority, and sequentially display target sub-maps associated with the layer display priority.
[0106] In an alternative embodiment, the conversion module 504 is further configured to: determine pixel coordinates in an original map block file; convert the pixel coordinates into screen coordinates, and update the pixel coordinates in the original map block file based on the screen coordinates, and generate a target map block file corresponding to the original map block file according to the update result.
[0107] In an alternative embodiment, the obtaining module 502 is further configured to: determine the geographic data to be processed corresponding to the target map block; filter and screen the geographic data to be processed to obtain the geographic data.
[0108] In an alternative embodiment, the obtaining module 502 is further configured to: filter and screen the geographic data to be processed to obtain initial geographic data; construct geographic symbol data corresponding to the geographic elements in the initial geographic data; and form the geographic data based on the initial geographic data and the geographic symbol data, where the geographic symbol data is used to render map elements in the target map.
[0109] In an alternative embodiment, the obtaining module 502 is further configured to: determine the longitude coordinate and the latitude coordinate in the target geographic coordinate; calculate the longitude pixel coordinate corresponding to the longitude coordinate and calculate the latitude pixel coordinate corresponding to the latitude coordinate based on a floating-point function and pixel parameters; and form the target pixel coordinate corresponding to the target geographic coordinate based on the longitude pixel coordinate and the latitude pixel coordinate. Based on the longitude pixel coordinate and the latitude pixel coordinate, form the target pixel coordinate corresponding to the target geographic coordinate.
[0110] The map generation method provided by an embodiment of this specification responds to a map generation request to obtain at least two map block files; converts the pixel coordinates included in the at least two map block files, and determines the target map block files respectively corresponding to the at least two map blocks according to the conversion result; creates a map generation task based on the at least two target map block files; by executing the map generation task, renders the layers corresponding to the at least two map blocks in sequence according to the layer display priority, and based on the layers corresponding to the at least two map blocks after rendering, sequentially displays the target map associated with the layer display priority; where the rendering period corresponding to each layer display priority is used to synchronously render the target layers respectively corresponding to the at least two map blocks. By directly rendering the target map based on the map block file containing pixel coordinates, the operation of converting geographic coordinates to pixel coordinates during the rendering process of the target map is avoided, improving the rendering efficiency of the target map; in addition, rendering the layers corresponding to the at least two map blocks in sequence according to the layer display priority achieves the purpose of rendering the target map layer by layer, so that the target map can be quickly displayed, reducing the waiting time of the client user and improving the user experience.
[0111] The above is a schematic solution of a map generation device according to this embodiment. It should be noted that the technical solution of this map generation device and the technical solution of the above map generation method belong to the same concept. For the details not described in detail in the technical solution of the map generation device, reference can be made to the description of the technical solution of the above map generation method.
[0112] FIG. 6 shows a structural block diagram of a computing device 600 according to an embodiment of the present specification. The components of the computing device 600 include, but are not limited to, a memory 610 and a processor 620. The processor 620 is connected to the memory 610 through a bus 630, and a database 650 is used to store data.
[0113] The computing device 600 further includes an access device 640, and the access device 640 enables the computing device 600 to communicate via one or more networks 660. Examples of these networks include the Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or a combination of communication networks such as the Internet. The access device 640 may include one or more of any type of wired or wireless network interfaces (for example, a network interface card (NIC)), such as an IEEE802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) o
[0114] In an embodiment of the present specification, the above components of the computing device 600 and other components not shown in FIG. 6 may also be connected to each other, for example, through a bus. It should be understood that the structural block diagram of the computing device shown in FIG. 6 is only for illustrative purposes and is not a limitation on the scope of the present specification. Those skilled in the art can add according to needs Add or replace other components.
[0115] The computing device 600 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.) or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 600 can also be a mobile or stationary server.
[0116] Wherein, the processor 620 is configured to execute the following computer-executable instructions, and when the computer-executable instructions are executed by the processor, the steps of the above-mentioned map generation method are implemented.
[0117] The above is a schematic solution of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the above-mentioned map generation method belong to the same concept. For the details not described in detail in the technical solution of the computing device, reference can be made to the description of the technical solution of the above-mentioned map generation method.
[0118] An embodiment of this specification also provides a computer-readable storage medium, which stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of the above-mentioned map generation method are implemented.
[0119] The above is a schematic solution of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the above-mentioned map generation method belong to the same concept. For the details not described in detail in the technical solution of the storage medium, reference can be made to the description of the technical solution of the above-mentioned map generation method.
[0120] An embodiment of this specification also provides a computer program, wherein when the computer program is executed in a computer, the computer is made to execute the steps of the above-mentioned map generation method.
[0121] The above is a schematic solution of a computer program according to this embodiment. It should be noted that the technical solution of this computer program and the technical solution of the above-mentioned map generation method belong to the same concept. For the details not described in detail in the technical solution of the computer program, reference can be made to the description of the technical solution of the above-mentioned map generation method.
[0122] The above describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require the particular order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0123] The computer instructions include computer program code, which may be in source code form, object code form, executable file, or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disc, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc. It should be noted that the content included in the computer-readable medium can be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals. It should be noted that for the foregoing method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the embodiments of this specification are not limited by the described action sequence. Because according to the embodiments of this specification, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential for the embodiments of this specification.
[0124] In the above embodiments, the descriptions of the respective embodiments have their own focuses. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0125]
[0126] The preferred embodiments of the present specification disclosed above are only used to help illustrate the present specification. The alternative embodiments do not describe all the details in detail, nor do they limit the invention to the specific embodiments described. Obviously, according to the content of the embodiments of the present specification, many modifications and changes can be made. These embodiments are selected and specifically described in the present specification to better explain the principles and practical applications of the embodiments of the present specification, so that those skilled in the art can well understand and utilize the present specification. The present specification is only limited by the claims and their full scope and equivalents.
Claims
Claims 1. A map generation method, applied to a client, comprising: Obtain at least two map tile files in response to a map generation request; convert the pixel coordinates included in the at least two map tile files, and determine the target map tile files corresponding to the at least two map tiles respectively according to the conversion result; Create a map generation task based on the at least two target map tile files; By executing the map generation task, render the layers corresponding to the at least two map tiles in sequence according to the layer display priority, and based on the layers corresponding to the at least two map tiles after rendering, display the target map associated with the layer display priority in sequence; wherein, the rendering period corresponding to each layer display priority is used to synchronously render the target layers corresponding to the at least two map tiles respectively.
2. The determination of any map block file in the map generation method according to claim 1 includes: Determine the global map tile, and determine the target map tile in the global map tile based on the map tile division rule; Determine the geographic data corresponding to the target map tile, and determine the geographic coordinates in the geographic data; convert the geographic coordinates into pixel coordinates, and replace the geographic coordinates in the geographic data based on the pixel coordinates, and generate the map tile file corresponding to the target map tile according to the replacement result.
3. The rendering of the target map corresponding to the display priority of any one layer in the map generation method according to claim 1 includes: Determine the initial layer data corresponding to the at least two map tiles respectively; perform synchronous rendering based on the initial layer data corresponding to the at least two map tiles respectively; Generate and display the target map corresponding to the layer display priority based on the initial layers corresponding to the at least two map tiles after rendering.
4. The map generation method according to claim 1, wherein creating a map generation task based on the at least two target map tile files comprises: Create a map generation subtask corresponding to each map tile based on the layer data respectively included in the at least two target map tile files and the position data respectively corresponding to the at least two target map tile files; Create the map generation task based on the map generation subtasks corresponding to each map tile; wherein, the map generation subtasks included in the map generation task have an execution order, and in two adjacent map generation subtasks in the execution order, the subsequent map generation subtask is executed based on the task execution result of the previous map generation subtask.
5. According to the map generation method described in claim 1, the rendering of the layer corresponding to any one map tile includes: Determine the target layer data corresponding to the target map tile; divide the target layer data into at least two groups of to-be-rendered layer data corresponding to the layer display priority; according to the layer display priority, use the at least two groups of to-be-rendered layer data to render the target map tile in sequence, and display the target sub-map associated with the layer display priority in sequence.
6. The determination of any target map block file in the map generation method according to claim 1 includes: Determine the pixel coordinates in the original map tile file; Convert the pixel coordinates into screen coordinates, and update the pixel coordinates in the original map tile file based on the screen coordinates, and generate the target map tile file corresponding to the original map tile file according to the update result.
7. The map generation method according to claim 2, wherein determining the geographical data corresponding to the target map block comprises: Determine the to-be-processed geographic data corresponding to the target map tile; Filter and screen the to-be-processed geographic data to obtain the geographic data.
8. The map generation method according to claim 7, wherein the filtering and screening of the to-be-processed geographical data to obtain the geographical data includes: Filter and screen the to-be-processed geographic data to obtain the initial geographic data; Construct geographic symbol data corresponding to the geographic elements in the initial geographic data; Compose the geographic data based on the initial geographic data and the geographic symbol data, wherein the geographic symbol data is used to render map elements in the target map.
9. The method for generating a map according to claim 2, wherein the conversion of any geographical coordinate includes: Determine the longitude coordinate and the latitude coordinate in the target geographic coordinate; calculate the longitude pixel coordinate corresponding to the longitude coordinate and calculate the latitude pixel coordinate corresponding to the latitude coordinate based on a floating-point function and pixel parameters; compose the target pixel coordinate corresponding to the target geographic coordinate based on the longitude pixel coordinate and the latitude pixel coordinate.
10. A map generation device, applied to a client, comprising: An acquisition module, configured to acquire at least two map tile files in response to a map generation request; A conversion module, configured to convert the pixel coordinates included in the at least two map tile files, and determine the target map tile files respectively corresponding to the at least two map tiles according to the conversion result; A creation module, configured to create a map generation task based on the at least two target map tile files; A rendering module, configured to, by executing the map generation task, render the layers corresponding to the at least two map tiles in sequence according to the layer display priority, and sequentially display the target map associated with the layer display priority based on the layers corresponding to the at least two map tiles after rendering; wherein, the rendering period corresponding to each layer display priority is used to synchronously render the target layers respectively corresponding to the at least two map tiles. A memory and a processor; 11. A computing device, comprising: The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the map generation method according to any one of claims 1 to 9 are implemented.
12. A computer-readable storage medium storing computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of the map generation method according to any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Map vector data displaying method in network navigation of mobile phone
CN101493331A
Generating a multi-layered geographic image and the use thereof
CN102402797A
Method and device for rendering electronic map
CN110288689A
Map layer loading method, device and equipment and storage medium
CN113656528A
Map rendering method and system, terminal and storage medium
CN114064826A
Cited By
Method and device for dynamically loading vector map, medium and product
CN120950619A
Method and device for generating one graph of irrigation area, equipment, medium and product
CN120953432A
Spatial data file symbolization processing method and device, medium and product
CN121638200A