Map rendering method and device, computer equipment, storage medium and program product

By obtaining tile range information in vector tile rendering and searching vector data from spatial database to generate tile, the problems of wasted storage resources and high cost in traditional methods are solved, and efficient map rendering is achieved.

CN120144683APending Publication Date: 2025-06-13CHINA ENERGY ENG GRP GUANGDONG ELECTRIC POWER DESIGN INST CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510234372.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-28
Publication Date
2025-06-13

Smart Images

  • Figure CN120144683A_ABST
    Figure CN120144683A_ABST
Patent Text Reader

Abstract

The invention relates to a map rendering method and device, computer equipment, a storage medium and a program product. The method comprises the following steps: acquiring tile range information and determining a target retrieval identifier according to the tile range information; under the condition that the vector tile matched with the target retrieval identifier cannot be searched from a preset cache database, determining vector data matched with the target retrieval identifier in a preset spatial database according to the target retrieval identifier; and generating a target vector tile according to the vector data. By adopting the method, the retrieval identifier can be determined based on the position and the zoom level of the vector tile to be rendered in different layers, and the data matched with the retrieval identifier can be accurately searched in the preset cache database and the spatial database by utilizing the retrieval identifier, so that the map to be loaded can be accurately and timely rendered by utilizing the retrieved data; and all possible tiles do not need to be generated in advance, so that the map rendering cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of digital maps, and in particular, to a map rendering method, apparatus, computer device, computer-readable storage medium, and computer program product. Background Art

[0002] With the rapid development of geographic information systems (GIS) and big data technologies, vector tile technology, as an efficient data transmission and rendering method, has become one of the core technologies of modern map services. Compared with traditional raster tiles, vector tiles have significant advantages in data storage, transmission efficiency, and display effects. Vector tiles slice vector data by spatial location, store and transmit it in a compact binary form, significantly improving the map loading speed and rendering effect. This technology can not only reduce the storage requirements for pre-generated tiles but also ensure real-time updates of map data, enhancing the interactivity and dynamics of the map.

[0003] Traditional technologies need to pre-generate tile data for all possible zoom levels and view ranges when rendering vector tiles, and then dynamically request tiles at specific zoom levels according to user operations for rendering to display the map. However, traditional technologies increase the storage burden, resulting in waste of storage resources and being unfavorable for reducing the cost of map rendering. Summary of the Invention

[0004] Based on this, it is necessary to provide a map rendering method, apparatus, computer device, computer-readable storage medium, and computer program product that can reduce the cost of map rendering for the above technical problems.

[0005] In a first aspect, this application provides a map rendering method, including:

[0006] Obtain tile range information, and determine a target retrieval identifier according to the tile range information; the tile range information represents the positions and zoom levels of the vector tiles to be rendered in different layers of the map to be loaded;

[0007] In the case where the vector tile matching the target retrieval identifier cannot be found in the preset cache database, determine the vector data matching the target retrieval identifier in the preset spatial database according to the target retrieval identifier;

[0008] Generate a target vector tile according to the vector data; the target vector tile is used to render the map to be loaded.

[0009] In one of the embodiments, the method further includes:

[0010] Compare the target retrieval identifier with the retrieval identifiers of each piece of data in the cache database, and use the data corresponding to the retrieval identifier that matches the target retrieval identifier in the cache database as the target vector tile.

[0011] In one embodiment, the determining the vector data that matches the target retrieval identifier in the preset spatial database according to the target retrieval identifier includes:

[0012] Determine layer information according to the target retrieval identifier;

[0013] Determine the data table in the spatial database that matches the layer information according to the layer information;

[0014] Search for the vector data that matches the target retrieval identifier in the data table according to the target retrieval identifier and a preset first spatial function; the first spatial function is used to determine whether the target retrieval identifier matches the data in the data table.

[0015] In one embodiment, the generating the target vector tile according to the vector data includes:

[0016] Convert the coordinates of the vector data according to a preset second spatial function to obtain data after coordinate conversion; the second spatial function is used to convert the coordinates of the data;

[0017] Determine the geometric data and attribute data of the data after coordinate conversion according to a preset third spatial function; the third spatial function is used to determine geometric data and attribute data;

[0018] Convert the format of the data after coordinate conversion according to a preset fourth spatial function to obtain data after format conversion; the fourth spatial function is used to convert the format of the data;

[0019] Determine the target vector tile according to the data after format conversion and the geometric data and attribute data of the data after coordinate conversion.

[0020] In one embodiment, the method further includes:

[0021] Obtain a sample vector tile and the retrieval identifier corresponding to the sample vector tile;

[0022] Use the retrieval identifier corresponding to the sample vector tile as the key of the sample vector tile to construct a key-value pair, and construct the cache database according to the key-value pair.

[0023] In one embodiment, the obtaining the tile range information includes:

[0024] Obtain the coordinate information of the first target point and the second target point in the to-be-loaded map under the view corresponding to the to-be-loaded map; the first target point includes the point located at the upper left corner of the to-be-loaded map; the second target point includes the point located at the lower right corner of the to-be-loaded map;

[0025] Determine the position information of the to-be-rendered vector tile in different layers according to the coordinate information of the first target point and the second target point respectively;

[0026] Determine the zoom level information according to the view corresponding to the to-be-loaded map, and determine the tile range information according to the zoom level information and the position information of the to-be-rendered vector tile in different layers.

[0027] In a second aspect, the present application further provides a map rendering device, including:

[0028] An acquisition module, configured to acquire tile range information, and determine a target retrieval identifier according to the tile range information; the tile range information represents the position and zoom level of the to-be-rendered vector tile in different layers of the to-be-loaded map;

[0029] A search module, configured to, when the vector tile matching the target retrieval identifier cannot be found in a preset cache database, determine the vector data matching the target retrieval identifier in a preset spatial database according to the target retrieval identifier;

[0030] A rendering module, configured to generate a target vector tile according to the vector data; the target vector tile is used to render the to-be-loaded map.

[0031] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the steps of the above method are implemented.

[0032] In a fourth aspect, the present application further provides a computer-readable storage medium. On the computer-readable storage medium, a computer program is stored, and when the computer program is executed by the processor, the steps of the above method are implemented.

[0033] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by the processor, the steps of the above method are implemented.

[0034] The above-mentioned map rendering method, device, computer device, computer-readable storage medium, and computer program product obtain tile range information and determine a target retrieval identifier according to the tile range information. The tile range information represents the positions and zoom levels of the vector tiles to be rendered in different layers of the map to be loaded, so as to determine an accurate retrieval identifier based on the positions and zoom levels of the vector tiles to be rendered in different layers of the map to be loaded. When the vector tile matching the target retrieval identifier cannot be found in the preset cache database, the vector data matching the target retrieval identifier is determined in the preset spatial database according to the target retrieval identifier, so as to accurately find the matching vector tile in the preset cache database based on the retrieval identifier, and when the matching vector tile cannot be found in the cache database, the vector data matching the retrieval identifier is accurately found in the preset spatial database according to the retrieval identifier. According to the vector data, a target vector tile is generated. The target vector tile is used to render the map to be loaded, so as to accurately generate the vector tile for rendering the map to be loaded according to the vector data matching the retrieval identifier in the spatial database, be able to determine the retrieval identifier based on the positions and zoom levels of the vector tiles to be rendered in different layers, and use the retrieval identifier to accurately find the data matching the retrieval identifier in the preset cache database and spatial database, so as to accurately and timely render the map to be loaded using the retrieved data, without pre-generating all possible tiles, thereby reducing the cost of map rendering. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments of the present application or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.

[0036] Figure 1 It is an application environment diagram of a map rendering method in an embodiment;

[0037] Figure 2 It is a flowchart of a map rendering method in an embodiment;

[0038] Figure 3 It is a flowchart of a map rendering method in another embodiment;

[0039] Figure 4 It is a schematic diagram of the loading time of a vector tile in an embodiment;

[0040] Figure 5 It is a structural block diagram of a map rendering device in an embodiment;

[0041] Figure 6 The internal structure diagram of a computer device in an embodiment. Detailed implementation manners

[0042] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0043] The map rendering method provided by the embodiment of the present application can be applied to an application environment as Figure 1 shown. Among them, the terminal 102 communicates with the server 104 through a network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or can be placed in the cloud or other network servers. The server 104 can receive a map rendering request sent by the terminal 102; the server 104 can obtain tile range information according to the map rendering request, and determine a target retrieval identifier according to the tile range information; the tile range information represents the positions and zoom levels of the vector tiles to be rendered in different layers in the map to be loaded; when the server 104 cannot find a vector tile matching the target retrieval identifier in the preset cache database, it determines vector data matching the target retrieval identifier in the preset spatial database according to the target retrieval identifier; the server 104 generates a target vector tile according to the vector data, and sends the target vector tile to the terminal 102; the terminal 102 renders the map to be loaded according to the received target vector tile. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, Internet of Things devices and portable wearable devices, and the Internet of Things device can be a smart vehicle-mounted device, etc. The server 104 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0044] In an exemplary embodiment, as Figure 2 shown, a map rendering method is provided. Taking the application of this method to the server as an example, it can be understood that this method can also be applied to the terminal, and can also be applied to a system including the terminal and the server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps S202 to step S206. Among them:

[0045] Step S202, obtain tile range information, and determine a target retrieval identifier according to the tile range information; the tile range information represents the positions and zoom levels of the vector tiles to be rendered in different layers in the map to be loaded.

[0046] Among them, the tile range information may refer to information representing the image slices (such as vector tiles) to be rendered in the map to be loaded. In practical applications, the tile range information may represent information such as the positions and zoom levels of the vector tiles to be rendered in different layers in the map to be loaded.

[0047] Among them, the map to be loaded may refer to the map that needs to be loaded / rendered under a specific view.

[0048] Among them, the vector tiles to be rendered may refer to the map data that needs to be converted into an image format.

[0049] Among them, the target retrieval identifier may refer to information used to search for data in a preset cache database / preset spatial database. In practical applications, each piece of data in the preset cache database / preset spatial database is pre-set with a corresponding data identifier, and the data identifier can be used to uniquely identify / distinguish specific data. By comparing the target retrieval identifier and the data identifier, data search / data query can be achieved.

[0050] As an example, the server can respond to a map rendering request sent by a client (such as a terminal), obtain the map rendering request sent by the client, and determine information such as the positions and zoom levels of the vector tiles to be rendered in different layers in the map to be loaded according to the map rendering request, so as to obtain the tile range information. After that, the server can generate a target retrieval identifier for searching for data according to the tile range information.

[0051] Step S204, in the case where no vector tile matching the target retrieval identifier can be found in the preset cache database, determine the vector data matching the target retrieval identifier in the preset spatial database according to the target retrieval identifier.

[0052] Among them, the preset cache database may refer to a database that is pre-set and used to store pre-generated vector tiles. In practical applications, the cache database may include, but is not limited to, databases such as Redis, Memcached, or Hazelcast. The data in the cache database has a corresponding data identifier, and the data identifier of the data can be used as the key of the data, thus forming key-value pairs. Therefore, the cache database can store a number of data in the form of key-value pairs.

[0053] Among them, the preset spatial database may refer to a database for storing vector data from the energy geographic meteorological service platform. In practical applications, the spatial database may include, but is not limited to, geographic spatial extensions of PostGIS, MongoDB, and databases such as SpatiaLite. The data in the spatial database may include, but is not limited to, transmission towers, onshore wind turbines, transmission lines, photovoltaic panels, substations, converter stations, onshore wind farms, photovoltaic power plants, thermal power plants, waste power plants, hydropower plants, nuclear power plants, geothermal power plants, tidal power plants, other power plants, highways, arterial roads, urban expressways, urban main roads, urban secondary roads, urban branch roads, and administrative division data within a specific geographical area. It can be understood that the data in the spatial database also has corresponding data identifiers, and the data identifiers of the data can be used as keys of the data, thus forming key-value pairs. Therefore, the spatial database can store a number of data in the form of key-value pairs.

[0054] Among them, vector data may refer to data used to represent geographic spatial information. In practical applications, vector data can describe entities in the real world through geometric objects such as points, lines, and surfaces (polygons).

[0055] As an example, after the server obtains the target retrieval identifier, the server can first check whether there is a vector tile matching the target retrieval identifier in the preset cache database according to the target retrieval identifier. If the vector tile matching the target retrieval identifier cannot be found in the preset cache database according to the target retrieval identifier, the server can determine that there is no vector tile matching the target retrieval identifier in the preset cache database. At this time, the server can perform data search in the preset spatial database according to the target retrieval identifier, and determine the vector data matching the target retrieval identifier from each data in the preset spatial database.

[0056] Step S206, generate a target vector tile according to the vector data.

[0057] Among them, the target vector tile may refer to data used to render the vector tile to be rendered in the map to be loaded.

[0058] As an example, after determining the vector data matching the target retrieval identifier from each data in the preset spatial database, the server can generate a target vector tile according to the found vector data, and send the target vector tile to the client. After receiving the target vector tile sent by the server, the client can render the vector tile to be rendered in the map to be loaded according to the target vector tile, so as to complete the loading / rendering of the map to be loaded. After that, the client can display the map to be loaded that has been loaded / rendered to the user.

[0059] In the above map rendering method, by obtaining tile range information and determining a target retrieval identifier according to the tile range information; the tile range information represents the positions and zoom levels of the vector tiles to be rendered in different layers of the map to be loaded, so as to determine an accurate retrieval identifier based on the positions and zoom levels of the vector tiles to be rendered in different layers of the map to be loaded; in the case where no vector tile matching the target retrieval identifier can be found in the preset cache database, determine the vector data matching the target retrieval identifier in the preset spatial database according to the target retrieval identifier, so as to accurately find a matching vector tile in the preset cache database based on the retrieval identifier, and when no matching vector tile can be found in the cache database, accurately find the matching vector data in the preset spatial database according to the retrieval identifier; generate a target vector tile according to the vector data; the target vector tile is used to render the map to be loaded, so as to accurately generate a vector tile for rendering the map to be loaded according to the vector data matching the retrieval identifier in the spatial database, be able to determine the retrieval identifier based on the positions and zoom levels of the vector tiles to be rendered in different layers, and use the retrieval identifier to accurately find the data matching the retrieval identifier in the preset cache database and spatial database, so as to accurately and timely render the map to be loaded using the retrieved data, without pre-generating all possible tiles, thereby reducing the cost of map rendering.

[0060] In an exemplary embodiment, the above method further includes: comparing the target retrieval identifier with the retrieval identifiers of each data in the cache database, and taking the data corresponding to the retrieval identifier matching the target retrieval identifier in the cache database as the target vector tile.

[0061] Among them, the retrieval identifier may refer to the information used to distinguish each data in the cache database. In practical applications, the retrieval identifier may include but is not limited to a data identifier, etc.

[0062] As an example, after determining the target retrieval identifier according to the tile range information, the server may first perform a data search in the preset cache database according to the target retrieval identifier. In a specific implementation, the server may compare the target retrieval identifier with the retrieval identifiers of each data in the cache database one by one. If there is a retrieval identifier matching the target retrieval identifier, the server may take the data corresponding to the retrieval identifier matching the target retrieval identifier in the cache database as the target vector tile.

[0063] In this embodiment, by comparing the target retrieval identifier with the retrieval identifiers of each piece of data in the cache database, the data corresponding to the retrieval identifier that matches the target retrieval identifier in the cache database is used as the target vector tile. It is possible to accurately and quickly find the data that matches the target retrieval identifier from the preset cache database based on data caching as the target vector tile, without generating vector tiles in real time, thereby improving the rendering efficiency of the map.

[0064] In some embodiments, determining the vector data that matches the target retrieval identifier in the preset spatial database according to the target retrieval identifier includes: determining the layer information according to the target retrieval identifier; determining the data table in the spatial database that matches the layer information according to the layer information; and finding the vector data that matches the target retrieval identifier in the data table according to the target retrieval identifier and the preset first spatial function.

[0065] Among them, the layer information may refer to the information characterizing the layer where the vector tile to be rendered in the map to be loaded is located.

[0066] Among them, the spatial database may include several data tables, and each data table may have a corresponding layer. When the layer characterized by the layer information is the same as the layer corresponding to the data table, this data table can be used as the data table that matches the layer information.

[0067] Among them, the preset first spatial function may refer to a function used to determine whether the target retrieval identifier matches the data in the data table. In practical applications, the first spatial function may include the ST_Intersects function.

[0068] As an example, the server may first determine the layer information characterizing the layer where the vector tile to be rendered in the map to be loaded is located according to the target retrieval identifier. Since each data table in the spatial database has a corresponding layer, the server may determine the data table in the spatial database that matches the layer information according to the layer information. Then, the server may find the vector data that matches the target retrieval identifier in the data table according to the target retrieval identifier and the preset first spatial function. In practical applications, the first spatial function can be used to determine whether two geometric objects intersect in space, that is, whether two geometric objects have a common geographical spatial position. If at least one point of the two geometric objects is shared, it is considered that the two geometric objects intersect. Therefore, the server can use the first spatial function to determine whether each piece of data in the data table corresponding to the layer information matches the target retrieval identifier, so as to find the vector data that matches the target retrieval identifier from the data table corresponding to the layer information.

[0069] In this embodiment, by determining layer information according to a target retrieval identifier, determining a data table in the spatial database that matches the layer information according to the layer information, and finding vector data that matches the target retrieval identifier in the data table according to the target retrieval identifier and a preset first spatial function, it is possible to accurately screen out vector data that matches the target retrieval identifier in the data tables corresponding to different layers in the spatial database by combining the first spatial function, improve the accuracy of the vector data, and thus improve the accuracy of map rendering.

[0070] In some embodiments, generating a target vector tile according to vector data includes: converting the coordinates of the vector data according to a preset second spatial function to obtain data after coordinate conversion; determining the geometric data and attribute data of the data after coordinate conversion according to a preset third spatial function; converting the format of the data after coordinate conversion according to a preset fourth spatial function to obtain data after format conversion; and determining the target vector tile according to the data after format conversion and the geometric data and attribute data of the data after coordinate conversion.

[0071] Among them, the preset second spatial function may refer to a function for converting the coordinates of data. In practical applications, the second spatial function may include the ST_Transform function.

[0072] Among them, the data after coordinate conversion may refer to the data obtained after converting the coordinates of the vector data.

[0073] Among them, the preset third spatial function may refer to a function for determining geometric data and attribute data. In practical applications, the third spatial function may include the ST_AsMVTGeom function.

[0074] Among them, geometric data may refer to data representing the spatial position and shape of geographical features. In practical applications, in a Geographic Information System (GIS), geometric data can be represented as geometric types such as points, lines, and polygons. Attribute data may refer to data describing the characteristics or attributes of geometric objects. In practical applications, attribute data is usually stored in one or more fields, and these fields are saved in a database table together with the geometric objects.

[0075] Among them, the preset fourth spatial function may refer to a function for converting the format of data. In practical applications, the fourth spatial function may include the ST_AsMVT function.

[0076] Among them, the data after format conversion may refer to the data obtained after format conversion of the data after coordinate conversion. In practical applications, the format of the data after format conversion may include the MVT (Mapbox Vector Tiles) format.

[0077] As an example, the server can convert the coordinates of the vector data according to a preset second spatial function, convert the geographic coordinates of the vector data in the spatial database into specified projection coordinates to obtain the data after coordinate conversion. Then, the server can determine the geometric data and attribute data of the data after coordinate conversion through a pre-constructed SQL query structure according to a preset third spatial function. Next, the server can perform format conversion on the data after coordinate conversion according to a preset fourth spatial function, convert the format to the MVT format to obtain the data after format conversion. The server can determine the target vector tile based on the data after format conversion and the geometric data and attribute data of the data after coordinate conversion. In practical applications, the target vector tile generated based on the vector data can also be loaded into the cache database for caching.

[0078] In this embodiment, by converting the coordinates of the vector data according to a preset second spatial function, the data after coordinate conversion is obtained; the geometric data and attribute data of the data after coordinate conversion are determined according to a preset third spatial function; the data after coordinate conversion is subjected to format conversion according to a preset fourth spatial function to obtain the data after format conversion; and the target vector tile is determined based on the data after format conversion and the geometric data and attribute data of the data after coordinate conversion. A series of spatial functions can be used to perform coordinate conversion and format conversion on the vector data, and the geometric data and attribute data can be determined. Thus, accurate target vector tiles can be obtained by combining the data after coordinate conversion and format conversion, as well as the geometric data and attribute data, thereby improving the accuracy of map rendering.

[0079] In some embodiments, the above method further includes: obtaining a sample vector tile and a retrieval identifier corresponding to the sample vector tile; using the retrieval identifier corresponding to the sample vector tile as the key of the sample vector tile to construct a key-value pair, and constructing a cache database according to the key-value pair.

[0080] Among them, the sample vector tile may refer to a pre-generated vector tile.

[0081] As an example, the server can obtain pre-generated vector tiles and the retrieval identifiers corresponding to the pre-generated vector tiles. After that, the server can use the retrieval identifier corresponding to the pre-generated vector tile as the key of the pre-generated vector tile to construct a first key-value pair, and then construct a cache database based on the first key-value pair. It can be understood that the server can obtain vector data from the energy geographic meteorological service platform, and use the retrieval identifier corresponding to the vector data obtained from the energy geographic meteorological service platform as the key of the vector data obtained from the energy geographic meteorological service platform to construct a second key-value pair. The server can construct a spatial database based on the second key-value pair. In practical applications, the server can also store the vector tiles determined according to the vector data found in the spatial database and the retrieval identifiers corresponding to the vector tiles in the form of key-value pairs in the cache database to achieve the caching of vector tiles.

[0082] In this embodiment, by obtaining sample vector tiles and the retrieval identifiers corresponding to the sample vector tiles; using the retrieval identifier corresponding to the sample vector tile as the key of the sample vector tile to construct a key-value pair, and constructing a cache database based on the key-value pair, it is possible to pre-construct a database, provide a data basis for finding data based on the target retrieval identifier and rendering a map, thereby improving the acquisition efficiency of vector tiles and further improving the rendering efficiency of the map.

[0083] In some embodiments, obtaining tile range information includes: obtaining the coordinate information of a first target point and a second target point in the map to be loaded under the view corresponding to the map to be loaded; determining the position information of the vector tiles to be rendered in different layers according to the coordinate information of the first target point and the second target point; determining the zoom level information according to the view corresponding to the map to be loaded, and determining the tile range information according to the zoom level information and the position information of the vector tiles to be rendered in different layers.

[0084] Among them, the first target point may include the point located in the upper left corner of the map to be loaded.

[0085] Among them, the second target point may include the point located in the lower right corner of the map to be loaded.

[0086] Among them, the position information of the vector tiles to be rendered in different layers may refer to the information representing the positions of the vector tiles to be rendered in different layers.

[0087] Among them, the zoom level information may refer to the information representing the detail level or scale of the map display.

[0088] As an example, the server can obtain the coordinate information of the first target point (such as the upper left corner point) and the second target point (such as the lower right corner point) in the map to be loaded under the view corresponding to the map to be loaded. After that, the server can determine the range of the vector tiles from left to right and from bottom to top according to the coordinate information of the first target point and the second target point respectively, and determine the position information of the vector tiles to be rendered in different layers. Then, the server can determine the zoom level information such as the scale according to the view corresponding to the map to be loaded (such as the current view), and determine the tile range information according to the zoom level information and the position information of the vector tiles to be rendered in different layers. In practical applications, the server can first obtain the coordinate information corresponding to the first target point and the second target point respectively (such as the longitude information lng and the latitude information lat). It can be understood that the first target point and the second target point can determine a rectangle, and the server can use this rectangle as the range of the vector tiles. After that, the longitude information lng and the latitude information lat are initially converted into the coordinates of the vector tiles to be rendered on the preset coordinate axes in the map to be loaded by using a preset coordinate conversion formula, so as to obtain the position information in different layers. Then, the server can also determine the zoom level information according to the view corresponding to the map to be loaded, and combine the coordinates of the vector tiles to be rendered on the preset coordinate axes in the map to be loaded obtained by conversion and the zoom level information to determine the tile range information.

[0089] In this embodiment, by obtaining the coordinate information of the first target point and the second target point in the map to be loaded under the view corresponding to the map to be loaded; determining the position information of the vector tiles to be rendered in different layers according to the coordinate information of the first target point and the second target point respectively; determining the zoom level information according to the view corresponding to the map to be loaded, and determining the tile range information according to the zoom level information and the position information of the vector tiles to be rendered in different layers, it is possible to determine accurate tile range information based on the coordinates of the target points in the map to be loaded, thereby improving the accuracy of the vector tile information and the accuracy of map rendering.

[0090] In some embodiments, the disadvantages of traditional vector tile rendering methods include: increasing the storage burden, resulting in waste of server resources, and facing huge challenges in maintenance and update; there is a lag in update, which may lead to poor user experience and low timeliness in the actual application process; real-time generation without caching further increases the computing and storage pressure on the server because tile data needs to be retrieved and generated from the database in real time for each request, and it is difficult to maintain a fast response in high-concurrency scenarios; the data and styles are pre-fixed, making it difficult to meet the personalized needs of users; the generation and maintenance of pre-generated tiles and static caches involve a large consumption of computing resources, especially in wide-area and complex data structures, which not only increases the operating cost of the system but also improves the difficulty of operation and maintenance management. To solve the above technical problems, a map rendering method is provided. This map rendering method uses Spring Boot as the backend framework to build a vector tile service platform, stores and manages vector data based on the PostGIS spatial database, and combines the Redis in-memory caching mechanism to improve the system response speed. The front-end uses the Mapbox GL JS map engine and the Vue.js framework to develop a Web client to achieve efficient map rendering. Through the verification of the technical process of the present invention, the problem of jamming that is prone to occur when a large amount of vector data is loaded at one time on the GIS platform is solved, and the rendering performance and user experience of the platform are significantly improved.

[0091] In practical applications, the above map rendering method may include the following steps: The client calculates the tile information required to be loaded for the current map view, determines the required tile range, including the row number (x), column number (y), and zoom level (z) parameters of the tile; The client sends the x, y, z of each tile calculated in step A and the layers to be loaded to the server; The server establishes a retrieval identifier based on the x, y, z of the tile and the layers sent by the client, and retrieves the in-memory database (Redis cache) through the retrieval identifier. If the vector tile data corresponding to the retrieval identifier exists in the in-memory database, the system directly extracts the retrieved vector tile data from the in-memory database and returns it to the client; When the vector tile data corresponding to the retrieval identifier does not exist in the in-memory database, the system redirects the retrieval request to the spatial database (PostGIS), matches the vector data stored in the spatial database according to the request sent by the client, dynamically generates vector tiles, returns the vector tiles to the client, and at the same time caches the vector tiles in the in-memory database; The client obtains the vector tile data returned by the server, and renders the tile content into a visual map display based on the tile style file and WebGL rendering technology.

[0092] In a specific implementation, the process of calculating the tile information to be loaded for the current map view may include: calculating the corresponding row number (x) and column number (y) of the tile based on the coordinates of the upper left corner of the current map view and the zoom level (z). Similarly, calculate the row number (x) and column number (y) of the tile corresponding to the longitude and latitude coordinates of the lower right corner of the current map view. According to the row numbers (x) and column numbers (y) of the tiles corresponding to the upper left corner and the lower right corner coordinates of the current map view calculated in step A1, a set of vector tile numbers is calculated by looping from left to right and from bottom to top. Further, the corresponding conversion formula between longitude and latitude coordinates and tile row and column numbers can be expressed as:

[0093]

[0094] 。

[0095] where tileX is the X-axis coordinate of the tile, tileY is the Y-axis coordinate of the tile, lng is the longitude coordinate, lat is the latitude coordinate, and Level is the tile zoom level.

[0096] In a specific implementation, the process of retrieving vector tile data from the in-memory database through a retrieval identifier may include: constructing a unique retrieval identifier for the vector tile based on the tile row number (x), column number (y), zoom level (z), and the layer request parameters to be loaded sent by the client, and querying whether there is corresponding vector tile data in the in-memory database through the retrieval identifier. If it exists, the vector tile data is returned to the client. If it does not exist, the retrieval identifier is used to search for data in the spatial database. Further, the in-memory database organizes data in a key-value data structure. The key is usually composed of the unique identifier of the tile (such as the XYZ combination of layer name, level, row number, column number, etc.), and the value is the corresponding MVT format data.

[0097] In specific implementation, the process of dynamically generating vector tiles may include: Based on the tile row number (x), column number (y), zoom level (z) sent by the client and the layer request parameters to be loaded, use the ST_TileEnvelope function of the spatial database PostGIS to construct the rectangular range of the tile. First, correspond the layer name of the layer sent by the client with the table name of the spatial database. Secondly, combine the ST_Intersects function of the spatial database PostGIS to obtain the vector data within the rectangular range. Finally, perform the conversion of the spatial coordinate system through the ST_Transform function of the spatial database PostGIS, convert the geographic coordinates of the vector data in the spatial database into the specified projection coordinates. Combine the rectangular range and projection coordinates obtained from the above steps, etc., use the ST_AsMVTGeom function of the spatial database PostGIS to obtain the vector data within the tile range, including geometric data and attribute data, use the ST_AsMVT function of the spatial database PostGIS to convert the obtained vector data format into the MVT format, and return the vector range to the client, and at the same time load it into the in-memory database cache.

[0098] In specific implementation, the process of the client obtaining the vector tile data returned by the server and rendering the tile content into a visual map display based on the tile style file and WebGL rendering technology may include: The client obtains the vector tile in the Mapbox vector tile standard MVT format returned by the server. The client is based on the Mapbox GL JS map framework, combines the map style file Style, the map icon library Sprite and the map font library Glyphs, and realizes the visualization rendering of the front-end map vector tile in the form of WebGL.

[0099] In specific implementation, for extremely high concurrent access scenarios, the cache database can adopt a distributed cache solution, such as Redis Cluster or Apache Ignite. The distributed cache can further expand the cache capacity and improve the data reading speed, is suitable for processing large-scale user requests, and provides better support in load balancing, thereby improving the scalability and stability of the system. In some specific high-demand zoom levels (such as the full map view at a lower zoom level), a strategy combining pre-generated tiles and dynamically generated tiles can be considered. For example, common tile data can be pre-generated and stored in the cache at a low zoom level, while tiles at a high zoom level are still generated dynamically. This method can reduce the real-time calculation pressure of some requests while taking into account the real-time nature of the data.

[0100] In this embodiment, by combining the dynamic rendering mechanism of Redis cache and PostGIS database, the storage, transmission, and rendering efficiency of vector tile data are significantly improved. By adopting the method of dynamically generating tiles, a large amount of storage space required for traditional pre-generated tiles is avoided. By generating tile data within the current view range only when requested by the client, the storage burden on the server is reduced. At the same time, by storing frequently accessed tile data in Redis cache, the repeated query requirements for the database are greatly reduced, optimizing storage and resource utilization. This design is particularly suitable for application scenarios of large-scale and high-resolution maps, reducing resource waste and maintenance costs caused by pre-generated tiles, and achieving efficient storage and resource utilization; on the basis of dynamically generating tiles, real-time data update is realized. Since tiles are generated based on the current data each time a request is made, users can quickly access the latest geographical information without waiting for the regeneration and overwrite of tile files. This real-time update mechanism is particularly crucial for application scenarios where geographical information changes frequently (such as transportation, emergency management, etc.), ensuring that users can obtain the latest data at any time, greatly improving the timeliness and accuracy of map services, and enhancing the real-time data update ability; by caching frequently requested tile data in Redis, the response speed of the system in a high-concurrency environment is effectively improved. For requests with cache hits, the system directly returns data from Redis, avoiding the access latency of the database, thus significantly reducing the response time. Experiments show that the response time for caching and loading tiles can be stably maintained within 5ms. Even in high-concurrency scenarios, the system can provide a smooth user experience, meeting the needs of simultaneous access by a large number of users, and achieving fast response under high concurrency; allowing custom style files during client rendering enables the display style of tile data to be dynamically adjusted according to the personalized needs of users. Different users or scenarios can achieve personalized map display through customized styles, making up for the deficiencies of traditional static tiles with fixed styles that are difficult to dynamically change. This flexibility meets the needs of smart city management and personalized map services, providing a more diverse user experience, and having the flexibility to support personalized needs; through the dynamic generation and caching mechanism, the demand for computing resources is effectively reduced. The traditional tile generation method often requires pre-computing and storing data at all zoom levels, consuming a large amount of computing and storage resources; while in the present invention, only the necessary tile data is generated when requested by the user, greatly reducing the computing pressure. In addition, the introduction of Redis cache further optimizes the data access efficiency, reduces the complexity and cost of system operation and maintenance, and provides a sustainable solution for applications with wide-area and complex data structures.

[0101] In one exemplary embodiment, the above map rendering method can be used for the dynamic rendering of vector tile data of three different types: onshore wind turbines, photovoltaic panels, and transmission lines. The geographical information within the preset area covered by the research data includes data of three different geometric types: points, lines, and polygons, with a total of 59,054 records and a total data volume of 652 MB. The hardware on which the method is installed is a 13th-generation Intel(R) Core(TM) i9-13900 processor with a maximum main frequency of 2.00 GHz, a memory capacity of 64 GB, and an operating system of Windows 10 Enterprise Edition to ensure the smooth operation of the system. The database uses PostgreSQL v12.9 and PostGIS v3.1 versions, and the front-end technologies are Node.js v18.17.1 and Vue.js v3.3.8, with the Mapbox GL JS v2 front-end map engine. As Figure 3 shown, a flowchart of a map rendering method is provided. The client calculates and sends tile request parameters. First, the client calculates and derives the required tile row and column number ranges based on the longitude and latitude ranges of the current map view. Subsequently, the client constructs a request with tile information and parameters such as the layer name to be loaded and sends it to the server. The request can include tile layer information, which can include information such as the data layer name, data type, data volume, data size, and data range. The tile layer information can be represented as shown in Table 1 below:

[0102] Table 1

[0103]

[0104] In practical applications, the client can only request the longitude and latitude coordinates and zoom level (z) of the upper left and lower right corners of the necessary range within the current map view, and calculate the row number (x) and column number (y) of the required tiles. The calculation formula is as follows:

[0105]

[0106] .

[0107] Among them, tileX is the X-axis coordinate of the tile, tileY is the Y-axis coordinate of the tile, lng is the longitude coordinate, lat is the latitude coordinate, and Level is the tile zoom level.

[0108] After calculating the row number (x) and column number (y) of the tiles corresponding to the upper left and lower right coordinates of the current map view through the formula, calculate in a loop in the order from left to right and from bottom to top to obtain the set of all vector tile numbers within the view at this zoom level.

[0109] The client packs parameters such as the row number (x), column number (y), zoom level (z) of all required vector tiles after calculation, and the layer names to be loaded, forms a request, and sends it to the server via an HTTP request. The server receives the request parameters and conducts a retrieval query. First, the server receives the request parameters from the client; then, the server generates a unique retrieval identifier for these parameters; finally, it determines whether the vector tile exists in the in-memory database. If it exists, it is directly returned to the client. Otherwise, it enters the spatial database. The server receives the request parameters from the client, including the tile row number (x), column number (y), zoom level (z), and the layer names to be loaded, and generates a unique retrieval identifier for efficient query of tile data in the in-memory database (Redis cache) and the spatial database (PostGIS database).

[0110] Since the data in this Redis cache is organized through a key-value data structure, the key is usually composed of the unique identifier (xyz) of the tile, and the value is the tile data in the corresponding MVT format. The storage structure of Redis vector tiles can include a key-value data structure. Therefore, the storage structure of Redis vector tiles can be represented as the content shown in Table 2 below:

[0111] Table 2

[0112]

[0113] The specific information of Redis vector tile storage can be represented as the content shown in Table 3 below:

[0114] Table 3

[0115]

[0116] Therefore, the server can retrieve in the Redis cache through the unique identifier whether there is cached data for this tile. If the tile data exists in the cache, the server directly extracts the tile data from Redis and returns it to the client, skipping the database query and dynamic generation steps to improve the response speed. If the tile data does not exist in the cache, the system enters the next step to dynamically generate tile data in the spatial database (PostGIS database).

[0117] Taking the onshore wind turbine layer, transmission line layer, and photovoltaic panel layer as examples, with the support of the caching mechanism, the cache response effects and performance at different layers and different zoom levels were further tested. The cache vector tile response speed and data volume statistics can be represented as the content shown in Table 4 below:

[0118] Table 4

[0119]

[0120] Taking the zoom levels from the 6th to the 16th layer as an example, the cache response time shows a good correspondence with the tile data volume. The results show that even under a relatively large data volume (such as the onshore wind turbine layer L6), the average response time for cache loading remains within 25.8 ms, and the system maintains an efficient and fast response speed. Under the combined requests of all layers, even for tile requests at the L16 layer, the response time can be maintained within 10 ms, indicating that the cache system has good adaptability and scalability to the processing performance of large-scale vector data.

[0121] When the tile data does not exist in the in-memory database (Redis cache), the system needs to dynamically generate the tile data in the PostGIS database. Calculation of the data range. Based on the x, y, and z parameters of the tile on the server side, the ST_TileEnvelope function of PostGIS is used to calculate the geographical range of the currently requested tile. This range is used for subsequent spatial data queries to ensure that the geographical data extracted from the database is consistent with the display range of the tile. Querying spatial data. Using the ST_Intersects function of the PostGIS database, geometric data within the current tile range is filtered, including elements such as points, lines, and polygons, and the geographical information of the requested layer is matched. The spatial data in the database adopts standard geometric formats such as GeoJSON and WKT (Well-Known Text) formats for storing various geographical elements, such as points, multi-points, lines, multi-lines, polygons, and multi-polygons. The storage forms of vector data in GeoJSON and WKT (Well-Known Text) formats in the PostGIS database can be represented as shown in Table 5 below:

[0122] Table 5

[0123]

[0124] The vector data in GeoJSON and WKT (Well-Known Text) formats in the PostGIS database can include information such as the number of vector data, the name of geometric objects (such as transmission lines), and the location of geometric objects.

[0125] According to the geographical feature information stored in the database, filter out the data within the current tile range to ensure the accuracy of tile data. Coordinate transformation. Use the ST_Transform function to convert the geographical coordinate data in the database into the rendering coordinate system of the client (usually Web Mercator EPSG:3857) to ensure that the data can be correctly displayed on the client. MVT format conversion. Use the ST_AsMVT function of PostGIS to convert the tile data into the MVT (Mapbox Vector Tile) format. The MVT format is encoded using Google Protocol Buffers, with compact data and suitable for efficient transmission. Return data and update cache. The server returns the generated MVT format tile data to the client via HTTP and stores the generated MVT tile data in the Redis cache for subsequent direct reading from the cache for the same request, reducing the number of database queries and generation costs and improving the response speed.

[0126] Taking the initial load and cache load of three vector tile layers, namely the onshore wind turbine layer, the transmission line layer, and the photovoltaic panel layer, as an example, a system is designed and developed using the B / S architecture with Spring Boot and Vue3 + Mapbox GL JS to analyze the difference in response time during the two loading processes. The results show that during the initial load, since the original vector data needs to be retrieved from the PostGIS database and sliced, the loading time is relatively long. Taking the onshore wind turbine as an example, at the 9 / 412 / 226 level, the initial loading time of the tile is 60 ms. However, when the data enters the Redis cache, the response time of the second load is significantly shortened, only about 5 ms. The loading times of the two vector tiles can be presented as shown in Table 6 below:

[0127] Table 6

[0128]

[0129] As Figure 4 shown, a schematic diagram of the vector tile loading time is provided. As the zoom level increases, the data volume of the tile gradually decreases, and the loading time also decreases accordingly. At high levels (such as Z10 and above), the cache loading time is basically stable within 5 ms, indicating that the cache mechanism can maintain a stable response speed in an environment of high-frequency requests. In addition, the experimental results show that as the zoom level decreases, the data volume in the vector tile increases, resulting in a gradual extension of the response time for the initial load. Even in the case of a large data volume, the cache mechanism can still maintain a low response time, which fully verifies the stability and efficiency of the method of the present invention in a complex geographical data environment.

[0130] The client renders, displays in real time, and supports user interaction based on the returned data, i.e., client-side rendering. After receiving the MVT tile data, the client uses a map engine (such as WebGL) to parse and render the data. During the parsing process, the client restores the geometric and attribute information in the MVT data into visual elements on the map. The rendering engine can combine with a predefined style file to adjust the map content according to the zoom level and view range, realizing the dynamic display and interaction of tiles. Map display and user interaction. After rendering, the map is displayed in real time on the client, and the user can perform operations such as zooming and panning. The client will continue to request tiles according to the new view range, and the system processes in a loop according to the above steps to ensure the continuity and real-time nature of the map.

[0131] In this embodiment, tile data is dynamically generated through the PostGIS database, and tiles within the current view range are generated only when requested by the client, avoiding the large storage requirements of traditional pre-generation schemes, achieving efficient resource utilization and real-time data update. Redis is used to cache tile data for high-frequency requests, effectively improving the system's response speed in high-concurrency situations. The Redis caching technology reduces frequent queries to the database, ensuring that the system can quickly respond to user requests and optimizing the overall performance. The MVT (Mapbox Vector Tile) format is used to encode the tile data, and a compact binary format is used to transmit vector tile data. The MVT format can reduce the amount of data transmitted, improve network transmission efficiency, and support the fast rendering of the client, realizing the real-time generation and update of tile data, ensuring that users can access the latest geographical information at any time, which is especially important for application scenarios where geographical information changes frequently, guaranteeing the timeliness and accuracy of the data. By supporting custom style files during client-side rendering, the tile data can be dynamically adjusted in style according to user needs, meeting the requirements of personalized map display and enhancing the user experience.

[0132] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential either, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.

[0133] Based on the same inventive concept, an embodiment of the present application further provides a map rendering apparatus for implementing the map rendering method involved above. The solution provided by this apparatus to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the map rendering apparatus provided below can refer to the limitations on the map rendering method in the foregoing text, and will not be elaborated herein.

[0134] In an exemplary embodiment, as Figure 5 shown, a map rendering apparatus is provided, including: an acquisition module 502, a search module 504, and a rendering module 506, where:

[0135] The acquisition module 502 is configured to acquire tile range information, and determine a target retrieval identifier according to the tile range information; the tile range information represents the positions and zoom levels of the vector tiles to be rendered in different layers of the map to be loaded.

[0136] The search module 504 is configured to, when the vector tile matching the target retrieval identifier cannot be found in the preset cache database, determine the vector data matching the target retrieval identifier in the preset spatial database according to the target retrieval identifier.

[0137] The rendering module 506 is configured to generate a target vector tile according to the vector data; the target vector tile is used to render the map to be loaded.

[0138] In one exemplary embodiment, the above apparatus further includes a retrieval module, which is specifically configured to compare the target retrieval identifier with the retrieval identifiers of each data in the cache database, and use the data corresponding to the retrieval identifier matching the target retrieval identifier in the cache database as the target vector tile.

[0139] In one exemplary embodiment, the search module 504 is specifically further configured to determine layer information according to the target retrieval identifier; determine a data table in the spatial database that matches the layer information according to the layer information; and search for the vector data matching the target retrieval identifier in the data table according to the target retrieval identifier and a preset first spatial function; the first spatial function is used to determine whether the target retrieval identifier matches the data in the data table.

[0140] In one exemplary embodiment, the rendering module 506 is further specifically configured to convert the coordinates of the vector data according to a preset second spatial function to obtain data after coordinate conversion; the second spatial function is used to convert the coordinates of the data; determine the geometric data and attribute data of the data after coordinate conversion according to a preset third spatial function; the third spatial function is used to determine the geometric data and attribute data; perform format conversion on the data after coordinate conversion according to a preset fourth spatial function to obtain data after format conversion; the fourth spatial function is used to convert the format of the data; determine the target vector tile according to the data after format conversion and the geometric data and attribute data of the data after coordinate conversion.

[0141] In one exemplary embodiment, the above device further includes a construction module, which is specifically configured to obtain a sample vector tile and a retrieval identifier corresponding to the sample vector tile; use the retrieval identifier corresponding to the sample vector tile as the key of the sample vector tile to construct a key-value pair, and construct the cache database according to the key-value pair.

[0142] In one exemplary embodiment, the obtaining module 502 is further specifically configured to obtain the coordinate information of a first target point and a second target point in the map to be loaded under the view corresponding to the map to be loaded; the first target point includes the point located in the upper left corner of the map to be loaded; the second target point includes the point located in the lower right corner of the map to be loaded; determine the position information of the vector tile to be rendered in different layers according to the coordinate information of the first target point and the second target point respectively; determine the zoom level information according to the view corresponding to the map to be loaded, and determine the tile range information according to the zoom level information and the position information of the vector tile to be rendered in different layers.

[0143] Each module in the above map rendering device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0144] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as Figure 6As shown in the figure. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as vector tiles and vector data. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through a network connection. When the computer program is executed by the processor, it implements a map rendering method.

[0145] Those skilled in the art can understand that Figure 6 the structure shown in the figure is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0146] In one embodiment, a computer device is further provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the steps in the above method embodiments are implemented.

[0147] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.

[0148] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.

[0149] 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 this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.

[0150] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, artificial intelligence (AI) processors, etc., without limitation.

[0151] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in the present application.

[0152] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation to the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims

1. A map rendering method, characterized in that: The method comprises: Obtaining tile range information, and determining a target retrieval identifier according to the tile range information; the tile range information represents the position and zoom level of the vector tiles to be rendered in the map to be loaded in different layers; In the case where the vector tile matching the target search identifier cannot be found in the preset cache database, determining the vector data matching the target search identifier in the preset spatial database according to the target search identifier; A target vector tile is generated according to the vector data; the target vector tile is used to render the map to be loaded.

2. The method according to claim 1, characterized in that The method further comprises: The target retrieval identifier is compared with the retrieval identifiers of each data in the cache database, and the data corresponding to the retrieval identifier matching the target retrieval identifier in the cache database is used as the target vector tile.

3. The method according to claim 1, characterized in that The step of determining the vector data matching the target retrieval identifier in a preset spatial database according to the target retrieval identifier includes: Determine layer information according to the target search identifier; Determining, according to the layer information, a data table in the spatial database that matches the layer information; According to the target retrieval identifier and a preset first spatial function, vector data matching the target retrieval identifier is searched in the data table; the first spatial function is used to determine whether the target retrieval identifier matches the data in the data table.

4. The method according to claim 1, characterized in that: The step of generating a target vector tile according to the vector data comprises: The coordinates of the vector data are transformed according to a preset second spatial function to obtain data after coordinate transformation; the second spatial function is used to transform the coordinates of the data; Determine the geometric data and attribute data of the coordinate transformed data according to a preset third spatial function; the third spatial function is used to determine the geometric data and attribute data; Performing format conversion on the coordinate-converted data according to a preset fourth spatial function to obtain format-converted data; the fourth spatial function is used to convert the format of the data; The target vector tile is determined according to the geometric data and attribute data of the format-converted data and the coordinate-converted data.

5. The method according to claim 1, characterized in that: The method further comprises: Obtaining a sample vector tile and a search identifier corresponding to the sample vector tile; A retrieval identifier corresponding to the sample vector tile is used as a key of the sample vector tile to construct a key-value pair, and the cache database is constructed according to the key-value pair.

6. The method according to claim 1, characterized in that The obtaining of tile range information includes: Acquire the coordinate information of the first target point and the second target point in the map to be loaded in the view corresponding to the map to be loaded; the first target point includes the point located in the upper left corner of the map to be loaded; the second target point includes the point located in the lower right corner of the map to be loaded; Determining position information of the vector tile to be rendered in different layers according to respective coordinate information of the first target point and the second target point; The zoom level information is determined according to the view corresponding to the map to be loaded, and the tile range information is determined according to the zoom level information and the position information of the vector tiles to be rendered in different layers.

7. A map rendering device, characterized in that: The device comprises: An acquisition module, used to acquire tile range information and determine a target retrieval identifier according to the tile range information; the tile range information represents the position and zoom level of the vector tiles to be rendered in the map to be loaded in different layers; A search module, used for determining the vector data matching the target retrieval identifier in a preset spatial database according to the target retrieval identifier when the vector tile matching the target retrieval identifier cannot be found in the preset cache database; A rendering module is used to generate a target vector tile according to the vector data; the target vector tile is used to render the map to be loaded.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • Radar echo wake rendering method and device

    CN120852579A

  • Method and device for dynamically loading vector map, medium and product

    CN120950619A