Map generation method and device
By obtaining map tiles files and converting pixel coordinates, creating map generation tasks, and rendering map tiles according to the layer display priority, solving the problem of low map rendering efficiency, and achieving rapid map display and user experience improvement.
Patent Information
- Application Number
- CN202410045571.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-11
- Publication Date
- 2025-07-11
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 the waiting time of client users, and improve user experience.
Smart Images

Figure CN120298515A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification relate to the technical field of map generation, and in particular, to a map generation method and apparatus. Background Art
[0002] With the rapid development of the Internet of Things and mobile devices, more and more devices have begun 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 devices, the rendering efficiency and performance of maps have faced great challenges. In the prior art, when performing map rendering, a large amount of vector data usually needs to be frequently converted and then rendered in real time on a 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, the embodiments of this specification provide a map generation method. 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 the prior art.
[0004] According to the first aspect of the embodiments of this specification, a map generation method is provided, which is applied to a client and includes:
[0005] Obtaining at least two map block files in response to a map generation request;
[0006] Converting the pixel coordinates included in the at least two map block files, and determining target map block files corresponding to the at least two map blocks respectively according to the conversion result;
[0007] Creating a map generation task based on the at least two target map block files;
[0008] By executing the map generation task, rendering the layers corresponding to the at least two map blocks in sequence according to the layer display priority, and successively displaying the target maps associated with the layer display priority based on the layers corresponding to the at least two rendered map blocks;
[0009] 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.
[0010] According to the second aspect of the embodiments of this specification, a map generation apparatus is provided, which is applied to a client and includes:
[0011] An acquisition module, configured to acquire at least two map tile files in response to a map generation request;
[0012] A conversion module, configured to convert the pixel coordinates included in the at least two map tile files, and determine target map tile files respectively corresponding to the at least two map tiles according to the conversion result;
[0013] A creation module, configured to create a map generation task based on the at least two target map tile files;
[0014] 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 a target map associated with the layer display priority based on the rendered layers corresponding to the at least two map tiles; 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.
[0015] According to a third aspect of the embodiments of the present specification, a computing device is provided, including:
[0016] A memory and a processor;
[0017] 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.
[0018] According to a 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.
[0019] According to a 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.
[0020] The map generation method provided by an embodiment of this specification obtains 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 respectively 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 maps 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 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 the client users and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 is a schematic diagram of the processing process of a map generation method provided by an embodiment of this specification;
[0022] Figure 2 is a flowchart of a map generation method provided by an embodiment of this specification;
[0023] Figure 3 is a rendering schematic diagram of a map generation method provided by an embodiment of this specification;
[0024] Figure 4 is a flowchart of the processing process of a map generation method provided by an embodiment of this specification;
[0025] Figure 5 is a schematic structural diagram of a map generation device provided by an embodiment of this specification;
[0026] Figure 6 is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0027] Many specific details are set forth in the following description in order to provide a thorough understanding of this specification. However, this specification can be implemented in many other ways different from those described herein, and those skilled in the art can make similar generalizations without departing from the connotation of this specification. Therefore, this specification is not limited by the specific implementations disclosed below.
[0028] 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.
[0029] 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" or "while" or "in response to determining".
[0030] 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 choose to authorize or refuse.
[0031] First, the noun terms involved in one or more embodiments of this specification are explained.
[0032] Vector tile map: A vector tile map is a map display and rendering technology based on vector data. Compared with traditional raster tile maps, vector tile maps use 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 vector tile maps have higher clarity, more accurate geographical location information, and more flexible visualization effects. A vector tile map usually consists of multiple vector tiles (small pieces of maps), and each tile contains geographical element information within a certain range. By stitching these tiles together, global map coverage can be achieved.
[0033] 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.
[0034] Figure 1It is a schematic diagram of the processing process of a map generation method provided by an embodiment of this specification; as Figure 1 shown, 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. According to 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. Based on the layers corresponding to at least two map tiles after rendering, display the target maps with the associated layer display priority in sequence. 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.
[0035] 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.
[0036] See 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.
[0037] Step 202: Obtain at least two map tile files in response to a map generation request.
[0038] Specifically, the map generation request can be a computer command for generating a map submitted by a user through a touch command on a client; 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 car navigation device; the map tile file can be a file storing map data corresponding to vector tiles, which is used to render a vector tile map.
[0039] 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.
[0040] 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, so that when rendering the subsequent map, the pixel coordinates can be directly converted into screen coordinates to render the target map.
[0041] Furthermore, considering that the data used for rendering the target map are all geographical data containing actual longitude and latitude coordinate data, and map rendering 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:
[0042] 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, and generate the map tile file corresponding to the target map tile according to the replacement result.
[0043] 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 the map range division rule preset for the global map tile, and 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.
[0044] 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 the 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, and generate the map tile file corresponding to the target map tile according to the replacement result.
[0045] For example, as Figure 3 shown in the global map tile, the global map tile can be divided according to the length and width of the global map tile, the global map tile is divided into 9 map tiles numbered 1-9, and any one of the map tiles is selected as the target map tile. When selecting the map tile corresponding to 1 as the target map tile, convert the geographical coordinates in the geographical data corresponding to the target map tile into pixel coordinates to generate the map tile file. The map tile file is the vector tile json file.
[0046] In summary, by performing coordinate transformation on the geographical coordinates corresponding to the target map tile, pixel coordinates are obtained, and then the map tile file corresponding to the target map tile is generated. This facilitates reducing the computational resource consumption caused by coordinate transformation when rendering the map subsequently, and can also improve the map rendering speed and enhance the user experience.
[0047] Furthermore, considering that the geographical data to be processed corresponding to the target map tile contains data that is not real-time or data that does not conform to actual geographical elements, in order to ensure that the generated map is real-time and authentic, it is necessary to perform data filtering and screening after obtaining the geographical data to be processed. The specific implementation is as follows:
[0048] Determine the geographical data to be processed corresponding to the target map tile; perform filtering and screening on the geographical data to be processed to obtain the geographical data.
[0049] Specifically, the geographical data to be processed refers to the geographical data corresponding to the target map tile, which contains 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 nature in the geographical data to be processed.
[0050] Based on this, determine the geographical data to be processed corresponding to the target map tile. Sequentially perform filtering and screening on the geographical data to be processed to obtain the geographical data of a structure available for rendering.
[0051] In summary, by sequentially performing filtering and screening on the geographical data to be processed, the geographical data of a structure available for rendering is obtained, thus facilitating subsequent map rendering and improving the authenticity of the map.
[0052] Furthermore, considering the visual effect of the rendered map, geographical symbol data can be determined for geographical elements according to requirements. The specific implementation is as follows:
[0053] Perform filtering and screening on 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; form the geographical data based on the initial geographical data and the geographical symbol data, where the geographical symbol data is used to render the map elements in the target map.
[0054] Specifically, the initial geographical data refers to the data obtained after performing filtering and screening on the geographical data to be processed; the geographical symbol data refers to the data such as the attributes, types, sizes, colors, etc. of the geographical symbols corresponding to the geographical elements; the map elements are elements such as rivers, roads, bridges, buildings, etc.
[0055] Based on this, filter and screen the geographical data to be processed to obtain the initial geographical data; construct geographical symbol data corresponding to the geographical elements in the initial geographical data according to the types and attributes of the geographical elements in the initial geographical data. The geographical data is composed of the initial geographical data and the geographical symbol data. The geographical symbol data is used to render the map elements in the target map, and there is a symbol correspondence between the geographical symbol data and the geographical elements.
[0056] Continuing with the above example, in the case where the initial geographical data includes building data and the type of the building is determined to be a scenic spot, select the symbol data of the scenic spot category as the geographical symbol data of the scenic spot.
[0057] To sum up, by constructing geographical symbol data corresponding to the geographical elements in the initial geographical data, different symbols can be rendered according to the types of geographical elements during subsequent map rendering, thereby improving the visual effect of the map.
[0058] Furthermore, considering that map rendering cannot be directly completed based on the longitude and latitude coordinates in the target geographical coordinates, it is therefore necessary to convert the longitude coordinate and latitude coordinate in the target geographical coordinates to obtain the target pixel coordinates. The specific implementation is as follows:
[0059] Determine the longitude coordinate and latitude coordinate in the target geographical 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 pixel parameters; form the target pixel coordinates corresponding to the target geographical coordinates based on the longitude pixel coordinate and the latitude pixel coordinate.
[0060] Specifically, the longitude coordinate and 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 latitude coordinate in the target geographical coordinates.
[0061] Based on this, determine the longitude coordinate and latitude coordinate included in a set of coordinates in the target geographical coordinates. According to the coordinate conversion formula, calculate the longitude pixel coordinate corresponding to the longitude coordinate based on the floating-point function and pixel parameters, and calculate the latitude pixel coordinate corresponding to the latitude coordinate according to the coordinate conversion formula based on the floating-point function and pixel parameters. A set of coordinates is composed of the longitude pixel coordinate and the latitude pixel coordinate. Form the target pixel coordinates corresponding to the target geographical coordinates based on the longitude pixel coordinate and the latitude pixel coordinate.
[0062] 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 respectively, which are calculated from the longitude, latitude of the current position and the current zoom level. The general calculation formula is as follows: 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 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).
[0063] In summary, the longitude coordinate and latitude coordinate 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 convert the longitude coordinate and latitude coordinate again during subsequent map rendering, reducing the consumption of computing resources.
[0064] 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.
[0065] Specifically, after obtaining the at least two map tile files in response to the 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 are 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 to convert the pixel coordinates again to obtain the screen coordinates that can be used for map rendering; the target map file contains the 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. The map tile corresponds to a vector tile, which is a map tile with a specific range in the global map. The map tile can also be a local map tile obtained by equally dividing the global map.
[0066] Based on this, after obtaining at least two map tile files in response to the map generation request, the pixel coordinates included in the at least two map tile files are converted, and after converting the pixel coordinates in the map tile files into screen coordinates, a conversion result is obtained. Based on the conversion result, the target map tile files respectively corresponding to the at least two map tiles are determined.
[0067] 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 also need to be converted to update the pixel coordinates to screen coordinates and update to a data format that can perform map rendering. The specific implementation is as follows:
[0068] 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.
[0069] Specifically, the original map tile file refers to the map tile file corresponding to any one 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 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.
[0070] Based on this, determine the pixel coordinates in the original map tile file and convert the pixel coordinates into 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 to achieve the update of the pixel coordinates, and generate the target map tile file corresponding to the original map tile file according to the update result.
[0071] In summary, by replacing the pixel coordinates in the original map tile file and replacing the pixel coordinates with the screen coordinates, subsequent map rendering can be directly performed based on the target map tile file containing the screen coordinates.
[0072] Step 206: Create a map generation task based on the at least two target map tile files.
[0073] Specifically, after converting the pixel coordinates included in the at least two map tile files and determining the target map tile files respectively corresponding to the at least two map tiles according to the conversion result, 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.
[0074] Based on this, after converting the pixel coordinates included in the at least two map tile files above 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 rendering of the map can be completed based on the data in the at least two target map tile files.
[0075] 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 the map generation task can be created based on the at least two map generation subtasks. The specific implementation is as follows:
[0076] 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 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.
[0077] Specifically, the layer data refers to the data of a layer used to render the 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, and plateaus; the water body layer shows the outlines and distributions of rivers, lakes, oceans, etc. This layer can be used to represent information such as the area and depth of the water body; the road layer shows the network of roads and streets, including arterial 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 region. 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 tile corresponding to the target map road block file in the global map tile; the map generation subtask refers to a map layer rendering task in which the layers under the same display priority corresponding to the at least two target map tiles are rendered simultaneously.
[0078] Based on this, determine the layer data included in at least two target map tile files respectively, and determine the position data corresponding to at least two target map tile files respectively. Create a map generation subtask corresponding to each map tile based on the layer data included in at least two target map tile files respectively and the corresponding position data. Create a map generation task based on the map generation subtasks corresponding to each map tile. 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 to obtain the target map, the subsequent map generation subtask is then executed based on the target map to generate the next 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.
[0079] For example, when creating a map generation task and there are 3 target map tiles and 2 layers for each tile, determine the target map tile files corresponding to the 3 target map tiles respectively; and determine the first layer data and the second layer data in the target map tile files corresponding to the 3 target map tiles respectively according to the layer display priority. Generate a map generation subtask corresponding to the first layer based on the first layer data and the position data of the 3 target map tiles, and generate a map generation subtask corresponding to the second layer. The map generation task is composed of the map generation subtasks corresponding to the two layers respectively. When executing the map generation task, execute the two map generation subtasks in sequence according to the execution sequence. After the map generation subtask corresponding to the first layer is executed to render the terrain layer, continue to execute the map generation subtask corresponding to the second layer to render the water body layer on the basis of the terrain layer.
[0080] In summary, by creating at least two map generation subtasks based on the layer data and position data of the target map tile 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 during task execution.
[0081] Step 208: 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 rendered layers corresponding to the at least two map tiles, sequentially display the target maps associated with the layer display priority. 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 respectively.
[0082] Specifically, after creating a map generation task based on the at least two target map tile files, the map generation task can be executed to render the layers corresponding to the at least two map tiles in sequence according to the layer display priority, and based on the rendered layers corresponding to the at least two map tiles, the target map associated with the layer display priority is displayed in sequence. 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, a layer refers to a map element layer in a map tile, and the layers include but are not limited to a terrain layer, a water body layer, a road layer, a building layer, and a green space 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 the 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 the at least two map tiles respectively.
[0083] Based on this, after creating a map generation task based on at least two target map tile files, by executing the map generation task, the layers corresponding to the at least two map tiles are rendered in sequence according to the layer display priority, and the layers with the same layer display priority in the at least two map tiles are rendered simultaneously, and based on the rendered layers corresponding to the at least two map tiles, the target map associated with the layer display priority is displayed in sequence. After the target maps corresponding to each layer display priority are displayed in sequence, 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.
[0084] Further, the rendering of the target map corresponding to any one layer display priority includes:
[0085] 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 rendered initial layers corresponding to the at least two map tiles respectively.
[0086] Specifically, the initial layer data refers to the layer data used to render a layer corresponding to the 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.
[0087] 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 in combination with the arrangement order of the initial layers, generate and display a target map corresponding to the layer display priority based on the initial layers.
[0088] Continuing with the above example, as Figure 3 shown, determine the initial layer data with the same layer display priority corresponding to map tiles 1 - 9 respectively. At the same time, perform synchronous rendering based on the initial layer data corresponding to map tiles 1 - 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 arrangement order and position of map tiles 1 - 9 respectively.
[0089] In summary, perform synchronous rendering based on the initial layer data corresponding to at least two map tiles respectively, 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, complete the rendering of a hierarchical target map, so as to be able to display the overall target map of one layer on the screen of the client and improve the user's visual experience.
[0090] Furthermore, the rendering of the layer corresponding to any one map tile includes:
[0091] 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 at least two groups of to - be - rendered layer data to render the target map tile in sequence, and display the target sub - maps associated with the layer display priority in sequence.
[0092] Specifically, the target layer data is the global layer data for rendering the layer corresponding to the target map tile; the to - be - rendered layer data is the layer data for rendering one layer after dividing the target layer data according to the layer display priority; the target map tile is any one map tile in the global map tiles; the target sub - map is the map obtained after rendering one layer corresponding to the target map tile.
[0093] Based on this, determine the target layer data corresponding to the target map block, and divide the target layer data into at least two groups of to-be-rendered layer data corresponding to the layer display priorities according to the layer display priorities. Render and display the target map block in sequence using the at least two groups of to-be-rendered layer data according to the layer display priorities, and sequentially display the target sub-maps associated with the layer display priorities. 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.
[0094] Continuing with the above example, divide the target layer data corresponding to the target map block according to the layer display priorities to obtain the terrain layer data with a layer display priority of 1, the water body layer data with a layer display priority of 2, the road layer data with a layer display priority of 3, and the building layer data with a layer display priority of 4. Render sequentially based on each layer of data according to the layer display priorities to obtain the target sub-maps under the temporary priority of each layer.
[0095] In summary, render and display the target map block in sequence using at least two groups of to-be-rendered layer data according to the layer display priorities, and display the target sub-maps corresponding to each layer display priority to achieve the layered rendering of the map.
[0096] 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 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, renders the layers corresponding to the at least two map blocks in sequence according to the layer display priorities, and sequentially displays the target maps associated with the layer display priorities based on the layers corresponding to the at least two rendered map blocks; 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 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, rendering the layers corresponding to at least two map blocks in sequence according to the layer display priorities 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 client users and improving the user experience.
[0097] The following combines the attached Figure 4 , taking the application of the map generation method provided by this specification in map rendering as an example, to further illustrate the map generation method. Among them, Figure 4The flowchart of the processing procedure of a map generation method provided by an embodiment of this specification is shown, which specifically includes the following steps.
[0098] 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.
[0099] In the scenario of implementing vector tile map rendering on low-resource embedded devices, 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 (longitude and latitude 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 layer rendering corresponding to the map, optimize the layer rendering order to avoid unnecessary repeated rendering and drawing operations, effectively reduce the computing load and memory occupation of the rendering engine, and improve the processing speed of the rendering engine.
[0100] 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 in a standard manner. 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.
[0101] Step 404: Determine the to-be-processed geographical data corresponding to the target map block, and filter and screen the to-be-processed geographical data to obtain the initial geographical data.
[0102] Preprocess the obtained to-be-processed geographical data, 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.
[0103] 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.
[0104] 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, and surfaces. 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.
[0105] Step 408: Determine the target geographical coordinates in the geographical data, and convert the longitude coordinate and latitude coordinate in the target geographical coordinates into longitude pixel coordinates and latitude pixel coordinates respectively.
[0106] Step 410: Compose the target pixel coordinates corresponding to the target geographic coordinates based on the longitude pixel coordinates and the latitude pixel coordinates.
[0107] 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 and latitude of the current position and the current zoom level. 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 obtain the correct pixel position; tileY (tile coordinate) = floor(pixelY / 256).
[0108] Step 412: Generate the map tile file corresponding to the target map tile based on the target pixel coordinates, and in the case of 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.
[0109] 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 results.
[0110] Step 414: Create a map generation task based on the layer data included in at least two target map tile files and the position data corresponding to at least two target map tile files respectively.
[0111] The map generation task includes map generation subtasks. The map generation subtasks 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.
[0112] 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 display the target map associated with the layer display priority in sequence based on the rendered layers corresponding to at least two map tiles.
[0113] In practical applications, during the process of map rendering, a strategy of first rendering the whole and then the parts is adopted. During rendering, in the arrangement order of vector tiles, the bottom layer of the first vector tile in the upper left corner is first rendered, such as the terrain layer, the water body layer, the green map layer, and then the bottom layer of the second vector tile is rendered. In turn, the bottom layers of all vector tiles are rendered. 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.
[0114] 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 order of layer rendering, unnecessary repeated rendering and drawing operations can be reduced, and the rendering efficiency and rate can be improved. 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 order of layer rendering, the computational load and memory occupancy of the rendering engine can be effectively reduced, and thus the map rendering speed can be accelerated.
[0115] 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, 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 rendered map blocks, 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 blocks. By directly rendering the target map based on the map block 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 at least two map blocks 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.
[0116] Corresponding to the above method embodiment, this specification also provides an embodiment of a map generation device. Figure 5The figure shows a schematic structural diagram of a map generation device provided by an embodiment of this specification. As Figure 5 shown, the device includes:
[0117] An acquisition module 502, configured to acquire at least two map block files in response to a map generation request;
[0118] A conversion module 504, configured to convert the pixel coordinates included in the at least two map block files, and determine target map block files corresponding to the at least two map blocks according to the conversion result;
[0119] A creation module 506, configured to create a map generation task based on the at least two target map block files;
[0120] A rendering module 508, 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 sequentially display a target map associated with the layer display priority based on the layers corresponding to the at least two map blocks after rendering; 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.
[0121] In an optional embodiment, the acquisition module 502 is further configured to:
[0122] Determine a global map block, and determine a target map block in the global map block based on a map block division rule;
[0123] Determine the geographic data corresponding to the target map block, and determine geographic coordinates in the geographic data;
[0124] 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.
[0125] In an optional embodiment, the rendering module 508 is further configured to:
[0126] Determine initial layer data corresponding to the at least two map blocks respectively;
[0127] Perform synchronous rendering based on the initial layer data corresponding to the at least two map blocks respectively;
[0128] Generate and display a target map corresponding to the layer display priority based on the initial layers corresponding to the at least two map blocks after rendering.
[0129] In an optional embodiment, the creation module 506 is further configured to:
[0130] 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;
[0131] Create the map generation task based on the map generation subtasks corresponding to each map tile;
[0132] 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.
[0133] In an optional embodiment, the rendering module 508 is further configured to:
[0134] Determine the target layer data corresponding to the target map tile;
[0135] Divide the target layer data into at least two groups of to-be-rendered layer data corresponding to the layer display priorities;
[0136] Render the target map tile in sequence using the at least two groups of to-be-rendered layer data according to the layer display priorities, and sequentially display the target sub-maps associated with the layer display priorities.
[0137] In an optional embodiment, the conversion module 504 is further configured to:
[0138] Determine pixel coordinates in the original map tile file;
[0139] Convert the pixel coordinates into screen coordinates, update the pixel coordinates in the original map tile file based on the screen coordinates, and generate a target map tile file corresponding to the original map tile file according to the update result.
[0140] In an optional embodiment, the acquisition module 502 is further configured to:
[0141] Determine the to-be-processed geographical data corresponding to the target map tile;
[0142] Filter and screen the to-be-processed geographical data to obtain the geographical data.
[0143] In an optional embodiment, the acquisition module 502 is further configured to:
[0144] Filter and screen the to-be-processed geographical data to obtain initial geographical data;
[0145] Construct geographical symbol data corresponding to the geographical elements in the initial geographical data;
[0146] The geographical data is composed of the initial geographical data and the geographical symbol data, wherein the geographical symbol data is used to render map elements in the target map.
[0147] In an optional embodiment, the obtaining module 502 is further configured to:
[0148] Determine the longitude coordinate and the latitude coordinate in the target geographical coordinate;
[0149] 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;
[0150] Compose the target pixel coordinate corresponding to the target geographical coordinate based on the longitude pixel coordinate and the latitude pixel coordinate.
[0151] The map generation method provided in 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 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 sequentially displays the target map associated with the layer display priority based on the layers corresponding to the at least two rendered map blocks; 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. By directly rendering the target map based on the map block 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 blocks 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 the client user and improving the user experience.
[0152] The above is a schematic solution of a map generation device according to an embodiment of this specification. It should be noted that the technical solution of the 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.
[0153] Figure 6 FIG. shows a structural block diagram of a computing device 600 according to an embodiment of this 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.
[0154] The computing device 600 also includes an access device 640, which enables the computing device 600 to communicate via one or more networks 660. Examples of such 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 interface (e.g., a network interface card (NIC)), such as an IEEE 802.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, or a Near Field Communication (NFC) interface.
[0155] In one embodiment of the present specification, the above components of the computing device 600 and Figure 6 other components not shown therein may also be connected to each other, for example, via a bus. It should be understood that Figure 6 the block diagram of the computing device shown is for illustrative purposes only and is not a limitation on the scope of the present specification. Those skilled in the art may add or replace other components as needed.
[0156] 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, personal digital assistant, laptop computer, notebook computer, netbook, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smartwatch, 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.
[0157] Wherein, the processor 620 is used to execute the following computer-executable instructions, and when the computer-executable instructions are executed by the processor, the steps of the above map generation method are implemented.
[0158] 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 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 map generation method.
[0159] An embodiment of this specification also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by a processor, the steps of the above map generation method are implemented.
[0160] 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 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 map generation method.
[0161] An embodiment of this specification also provides a computer program. When the computer program is executed on a computer, the computer is made to execute the steps of the above map generation method.
[0162] 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 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 map generation method.
[0163] 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 figures do not necessarily require the particular order or sequential order shown to achieve the desired result. In certain implementations, multitasking and parallel processing are also possible or may be advantageous.
[0164] The computer instructions include computer program code, which may be in the form of source code, object code, executable files, or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, mobile hard disks, magnetic disks, optical disks, computer memories, read-only memories (ROMs), random access memories (RAMs), electrical carrier signals, telecommunication signals, and software distribution media, 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.
[0165] It should be noted that for the foregoing method embodiments, for the sake of simple 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 to the embodiments of this specification.
[0166] In the above embodiments, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0167] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not elaborate on all the details, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the embodiments of this specification, so that those skilled in the art can well understand and utilize this specification. This specification is only limited by the claims and their full scope and equivalents.
Claims
1. A map generation method, applied to a client, 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 respectively corresponding to the at least two map tiles 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 sequentially displaying a target map associated with the layer display priority based on the rendered layers corresponding to the at least two map tiles; 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.
2. The map generation method according to claim 1, the determination of any one map tile file includes: Determining a global map tile, and determining a target map tile in the global map tile based on a map tile division rule; Determining the geographical data corresponding to the target map tile, and determining geographical coordinates in the geographical data; Converting the geographical coordinates into pixel coordinates, and replacing the geographical coordinates in the geographical data based on the pixel coordinates, and generating a map tile file corresponding to the target map tile according to the replacement result.
3. The map generation method according to claim 1, the rendering of the target map corresponding to any one layer display priority includes: Determining the initial layer data respectively corresponding to the at least two map tiles; Performing synchronous rendering based on the initial layer data respectively corresponding to the at least two map tiles; Generating and displaying a target map corresponding to the layer display priority based on the initial layers respectively corresponding to the at least two rendered map tiles.
4. The map generation method according to claim 1, the creating of the map generation task based on the at least two target map tile files includes: Creating 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; Creating 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. The map generation method according to claim 1, 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; According to the layer display priority, rendering the target map tile in sequence using the at least two groups of to-be-rendered layer data, and sequentially displaying a target sub-map associated with the layer display priority.
6. The map generation method according to claim 1, the determination of any one target map tile file includes: Determining pixel coordinates in an 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 a target map tile file corresponding to the original map tile file according to the update result. File.
7. The map generation method according to claim 2, wherein determining the geographic data corresponding to the target map tile includes: Determine the geographic data to be processed corresponding to the target map tile; Filter and screen the geographic data to be processed to obtain the geographic data.
8. The map generation method according to claim 7, wherein filtering and screening the geographic data to be processed to obtain the geographic data includes: Filter and screen the geographic data to be processed to obtain initial geographic data; Construct geographic symbol data corresponding to geographic elements in the initial geographic data; The geographic data is composed of 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 map generation method according to claim 2, wherein the conversion of any geographic coordinate includes: Determine the longitude coordinate and latitude coordinate in the target geographic coordinate; Calculate the longitude pixel coordinate corresponding to the longitude coordinate and the latitude pixel coordinate corresponding to the latitude coordinate based on a floating-point function and pixel parameters; The target pixel coordinate corresponding to the target geographic coordinate is composed of the longitude pixel coordinate and the latitude pixel coordinate.
10. A map generation device, applied to a client, includes: 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 target map tile files corresponding to the at least two map tiles respectively 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 perform rendering on the layers corresponding to the at least two map tiles in sequence according to the layer display priority by executing the map generation task, and display the target map associated with the layer display priority in sequence 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 corresponding to the at least two map tiles respectively.
11. A computing device, 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 map generation method according to any one of claims 1 to 9 are implemented.
12. 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 map generation method according to any one of claims 1 to 9 are implemented.
Citation Information
Cited By
Building drawing display method, device and equipment suitable for large-scale buildings and medium
CN122507960A