Map display method, electronic equipment and storage medium
By pre-storing the original data table and generalized data table to obtain target tile data for rendering, the problems of low rendering efficiency and poor scalability in map display technology are solved, and efficient rendering and good scalability are achieved.
Patent Information
- Application Number
- CN202510299760.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-13
- Publication Date
- 2025-08-01
AI Technical Summary
The existing map display technology has problems of inefficient rendering efficiency and poor scalability, especially in complex terrain maps and a large number of user scenarios, where server processors and memory are under great pressure, resulting in CPU resource exhaustion or memory overflow.
By pre-storing the original data table and generalized data table, the target tile data is obtained for rendering, reducing the amount of computing during the rendering process, improving rendering efficiency, and supporting the scalability of complex terrain maps and a large number of users.
It improves map rendering efficiency, reduces the computing volume of servers, solves the scalability problems in complex terrain maps and a large number of user scenarios, and avoids CPU resource exhaustion and memory overflow.
Smart Images

Figure CN120407694A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technologies, and particularly to a map display method, an electronic device, and a storage medium. Background Art
[0002] With the development of geographic information systems, the importance of map display in various applications has become increasingly prominent. Especially in terrain analysis and engineering design, users usually upload their terrain data files to map software and hope to efficiently display them on the map, so as to combine other design elements for wind field design and other work.
[0003] However, the current map display technology has problems of low rendering efficiency and poor scalability. Summary of the Invention
[0004] The purpose of the embodiments of this application is to provide a map display method, an electronic device, and a storage medium, so as to improve the rendering efficiency and scalability.
[0005] To solve the above technical problems, the embodiments of this application provide a map display method, including: obtaining map display information of the current window; obtaining target tile data corresponding to the map display information by using a pre-stored original data table and / or a pre-stored generalized data table; and performing rendering according to the target tile data to be displayed on the window.
[0006] The embodiments of this application also provide an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the map display method as described above.
[0007] The embodiments of this application also provide a computer storage medium, including: storing a computer program, characterized in that the computer program realizes the map display method as described above when executed by a processor.
[0008] In some embodiments, the map display information includes a map display level and a map display area; the original data table is layer data at a first level, and the generalized data table is layer data at a second level; the first level is higher than the second level, and the amount of layer data at the first level is greater than the amount of layer data at the second level.
[0009] In some embodiments, the method for obtaining the original data table is as follows: obtain original data in advance; the original data includes latitude and longitude coordinates, corresponding elevation data, and corresponding contour line graphics; cut the original data according to a first preset rule to obtain a first index, corresponding first elevation data, and corresponding first contour line graphics; store the first index, corresponding first elevation data, and corresponding first contour line graphics in the original data table; the method for obtaining the generalized data table is as follows: perform generalization processing on the original data to obtain generalized data; the generalized data includes latitude and longitude coordinates, corresponding elevation data, and corresponding contour line graphics; cut the generalized data according to a second preset rule to obtain a second index, corresponding second elevation data, and corresponding second contour line graphics; store the second index, corresponding second elevation data, and corresponding second contour line graphics in the generalized data table.
[0010] In some embodiments, the performing generalization processing on the original data to obtain generalized data includes: performing aggregation processing on the elevation data of the original data according to the accuracy requirement of the generalized data to obtain the elevation data of the generalized data, and performing aggregation processing on the contour line graphics of the original data to obtain the contour line graphics of the generalized data; the accuracy requirement of the generalized data is confirmed with the corresponding tile classification size and tile resolution of the second level.
[0011] In some embodiments, the first preset rule includes a pixel classification rule of the first level and a Mercator projection rule; the second preset rule includes a pixel classification rule of the second level and a Mercator projection rule.
[0012] In some embodiments, after obtaining a plurality of first elevation data, it further includes: obtaining a corresponding first color according to the first elevation data, and storing the first index and the corresponding first color in the original data table; after obtaining the second elevation data, it further includes: obtaining a corresponding second color according to the second elevation data, and storing the second index and the corresponding second color in the generalized data table.
[0013] In some embodiments, obtaining target tile data corresponding to the map display information by using the pre-stored original data table and / or the pre-stored generalized data table includes: when the map display level is the same as the first level, determining the corresponding first index according to the map display area, and obtaining the corresponding first tile data in the original data table as the target tile data according to the first index; when the map display level is the same as the second level, determining the corresponding second index according to the map display area, and obtaining the corresponding second tile data in the generalized data table as the target tile data according to the second index; when the map display level is higher than the second level and lower than the first level, determining a plurality of the first indexes corresponding to the map display area, obtaining a plurality of the first tile data in the original data table according to the plurality of the first indexes, and merging the plurality of the first tile data to obtain the target tile data; when the map display level is higher than the first level, determining one of the first indexes corresponding to the map display area, obtaining the first tile data in the original data table according to the first index, cutting the first tile data to obtain a plurality of third tile data corresponding to the map display level, and obtaining at least one of the third tile data corresponding to the map display area in the plurality of third tile data as the target tile data.
[0014] In some embodiments, the number of the generalized data tables is multiple, and the second levels corresponding to the multiple generalized data tables are all different.
[0015] The technical solution provided by the embodiments of the present application has at least the following advantages:
[0016] In the present application, by pre-storing the original data table and / or the generalized data table, when obtaining the map display information required by the user on the current window, the corresponding target tile data is obtained according to the pre-stored original data table and / or the pre-stored generalized data table, and rendering is performed according to the target tile data to be displayed on the window, reducing the amount of computation in the rendering process and improving the rendering efficiency; moreover, since the amount of computation for a single rendering is reduced in the present application, it can be applied to scenarios with complex topographic maps and large amounts of user data, and has good scalability. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] One or more embodiments are illustrated by way of example in the accompanying drawings, which do not constitute a limitation to the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements, unless otherwise stated, and the figures in the drawings do not constitute a scale limitation.
[0018] Figure 1It is a schematic flowchart of a map display method according to an embodiment of the present application;
[0019] Figure 2 It is the original data table structure according to an embodiment of the present application;
[0020] Figure 3 It is the generalized data table structure according to an embodiment of the present application;
[0021] Figure 4 It is the logical schematic diagram of obtaining the original data table and the generalized data table according to an embodiment of the present application;
[0022] Figure 5 It is the logical schematic diagram of the map display method for this embodiment according to an embodiment of the present application;
[0023] Figure 6 It is the schematic diagram of the electronic device structure according to an embodiment of the present application. Detailed implementation manners
[0024] As can be seen from the background art, the current map display technology has problems of low rendering efficiency and poor scalability.
[0025] Through analysis and research, it is found that: the existing map display technology is mainly based on general data caching, and is used for real-time multi-level rendering and display of elevation and contour maps for user exploration and customization. The display of each level needs to frequently load complete or large data sets from files or databases, resulting in a slow rendering process and low map rendering efficiency; moreover, when the topographic map is complex or the number of users is large, the processor and memory of the server will generate great pressure, and even the CPU resources will be exhausted or the memory will overflow, unable to adapt to the situation of complex maps and a large number of users, resulting in poor scalability of the map software.
[0026] In order to solve the problems of low rendering efficiency and poor scalability existing in the existing map display technology, the present application proposes a map display method, including: obtaining the map display information of the current window; using the pre-stored original data table and / or the pre-stored generalized data table to obtain the target tile data corresponding to the map display information; and performing rendering according to the target tile data to display on the window. By pre-storing the original data table and / or the generalized data table in the present application, when obtaining the map display information required by the user on the current window, the corresponding target tile data is obtained according to the pre-stored original data table and / or the pre-stored generalized data table, and rendering is performed according to the target tile data to display on the window, reducing the amount of computation in the rendering process and improving the rendering efficiency; moreover, since the amount of computation for a single rendering is reduced in the present application, it can handle the scenarios of complex topographic maps and large amounts of user data, and has good scalability.
[0027] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the following will elaborate on each embodiment of this application with reference to the accompanying drawings. However, those of ordinary skill in the art can understand that in each embodiment of this application, many technical details are provided to help readers better understand this application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solutions claimed in this application can still be implemented. The following division of each embodiment is for convenience of description and should not impose any limitation on the specific implementation of this application. Each embodiment can be combined and cross-referenced with each other on the premise of not being contradictory.
[0028] An embodiment of this application relates to a map display method. The specific process schematic diagram is as Figure 1 shown. The map display method includes the following:
[0029] Step 101, obtain the map display information of the current window.
[0030] In this embodiment, the execution entity is a server, which can simultaneously process the map display information of multiple users and perform rendering. When the user operates on the window (i.e., the screen) of the terminal, the operations include dragging, zooming in, zooming out, etc. The map display information that the user wants to display can be determined according to the map interface after the user's operation, that is, the map display information is determined according to the user's operation on the current window.
[0031] Specifically, after the user performs operations such as dragging, zooming in, and zooming out, the map scale and the information of the map display area that the user wants to display can be obtained according to the map interface of the current window. The display level that the user wants to display can be determined according to the map size ratio. That is, the map display information in this embodiment includes the map display level and the map display area.
[0032] It should be noted that this embodiment is divided according to the way of dividing map levels in Google Satellite Maps. Google Satellite Maps is divided into different levels according to different resolutions, approximately divided into 22 levels. Generally, the urban area can reach level 20, the popular urban area can reach level 22, and the suburban area can reach level 16. Among them, the scale of each level is different. Therefore, the display level that the user wants can be determined according to the map scale of the current window. For each level in Google Satellite Maps, the map is divided into multiple map tiles, and each map tile corresponds to an index. The index includes the zoom level (i.e., the level), the X coordinate, and the Y coordinate. Among them, the higher the level of the map, the more map tiles are divided.
[0033] Step 102, use the pre-stored original data table and / or the pre-stored generalized data table to obtain the target tile data corresponding to the map display information.
[0034] Specifically, an original data table and / or a generalized data table are pre-stored in this embodiment. After obtaining the map display information of the current window, i.e., the map display level and the map display area, the target tile data corresponding to the map display information can be obtained by using the original data table and / or the generalized data table, that is, the target tile data corresponding to the display level and the map display area.
[0035] Specifically, the map display information includes the map display level and the map display area; the original data table is the layer data at the first level, and the generalized data table is the layer data at the second level; the first level is higher than the second level, and the amount of layer data at the first level is greater than the amount of layer data at the second level. For example, the first level can be the 15th level, and the second level can be one or more levels among the 9th to 12th levels.
[0036] Specifically, both the original data table and the generalized data table are obtained from the original data input by the user. The original data input by the user is obtained by the user through exploration and customization. The original data includes latitude and longitude coordinates, corresponding elevation data, and corresponding contour line graphics. In this embodiment, by pre-obtaining the original data, the original data table and the generalized data table can be obtained according to the original data.
[0037] Currently, the size of the surveyed map uploaded by the user, i.e., the original data, ranges from dozens of MB to several GB, and the quantity is at the 100,000 level and is continuously increasing, resulting in a relatively large operating pressure on the server. In this embodiment, by pre-processing the original data to obtain the original data table and the generalized data table, in the case of the same amount of data, the performance of map contour display is improved by more than 10 times, and the problems of server freeze and memory overflow caused by contour display rendering are solved.
[0038] Specifically, the method for obtaining the original data table is as follows: pre-obtain the original data; wherein, the original data includes latitude coordinates, corresponding elevation data, and corresponding contour line graphics; after obtaining the original data, cut the original data according to the first preset rule to obtain the first index and the corresponding first elevation data and the corresponding first contour line graphics; store the first index and the corresponding first elevation data and the corresponding first contour line graphics in the original data table. The first index corresponds to the way of dividing the map levels in the Google satellite map, that is, the first index includes the first level, the first X coordinate, and the first Y coordinate; after the original data is cut according to the first level, it is divided into multiple data corresponding to the first level, i.e., multiple first elevation data and multiple first contour line graphics, and each first elevation data and each first contour line graphics correspond to each first index.
[0039] Such as Figure 2As shown, it is the original data table structure. A tile includes a first index (object_id map object, level i.e., hierarchy, x, y), and corresponding first tile data (values i.e., elevation array, colors i.e., color array, geom i.e., contour graph). The first index includes at least: a first hierarchy, a first X coordinate, and a first Y coordinate. The first index may also include a map object identifier. The server sets a corresponding map object identifier for each piece of original data, so that the original data table can be located according to the map object identifier, improving the accuracy of tile data query; The first tile data includes at least: first elevation data, and a first contour graph. The first tile data may also include a first color, and the first color can be obtained according to the first elevation data. Since the original data input by the user contains a large amount of elevation data, after cutting according to the first hierarchy, the first elevation data corresponding to each tile is an elevation array, and the first color obtained according to the first elevation data is also a color array, that is, the color value corresponding to each elevation value in the elevation array.
[0040] Specifically, the original data table also includes an id (primary key). Each tile is set with a corresponding id. When the user wants to modify a tile data, they can quickly locate a map tile by clicking on the map. The server can return the id corresponding to this tile, and the user can quickly locate a tile data in the original data table through the id, so as to make modifications.
[0041] Specifically, the way to obtain the generalized data table is as follows: After obtaining the original data, perform generalization processing on the original data to obtain generalized data; The generalized data includes latitude coordinates and corresponding elevation data, and corresponding contour graphs; Cut the generalized data according to the second preset rule to obtain a second index and corresponding second elevation data, and corresponding second contour graphs; Store the second index and corresponding second elevation data, and corresponding second contour graphs in the generalized data table. The second index corresponds to the way of dividing the map level of the Google satellite map, that is, the second index includes a second zoom level, a second X coordinate, and a second Y coordinate; After cutting the generalized data according to the second zoom level, it is divided into multiple data corresponding to the second zoom level, that is, multiple second elevation data and multiple second contour graphs. Each second elevation data and each second contour graph correspond to each second index.
[0042] Such as Figure 3As shown, it is a generalized data table structure. A tile includes a second index (object_id which is the map object, level which is the level, x, y), and corresponding second tile data (value which is the elevation value, color which is the color value, geom which is the contour graph). The second index at least includes: the second level, the second X coordinate, and the second Y coordinate. The second index may also include the map object identifier. The server sets a corresponding map object identifier for each original data and the generalized data corresponding to the original data, so that the original data table and the generalized data table corresponding to the original data table can be located according to the map object identifier, improving the accuracy of tile data query; The second tile data at least includes: the second elevation data, the second contour graph. The second tile data may also include the second color, and the second color can be obtained according to the second elevation data. The second elevation data in this embodiment is an elevation value, and the second color is the color value corresponding to the second elevation value.
[0043] Specifically, the generalized data table also includes an id (primary key). Each tile is set with a corresponding id. When a user wants to modify a tile data, the user can quickly locate a map tile by clicking on the map. The server can return the id corresponding to this tile, and the user can quickly locate a tile data in the original data table through the id, so as to make modifications.
[0044] Specifically, after obtaining multiple first elevation data in this embodiment, it further includes: obtaining the corresponding first color according to the first elevation data, and storing the first index and the corresponding first color in the original data table; after obtaining the second elevation data in this embodiment, it further includes: obtaining the corresponding second color according to the second elevation data, and storing the second index and the corresponding second color in the generalized data table.
[0045] Specifically, this embodiment can first determine the width of the Colorbar (color bar) array, as well as the range of the first elevation data and the range of the second elevation data. The first elevation data is segmented according to the width of the array and the range of the first elevation data, so as to obtain the first color corresponding to each first elevation data. The second elevation data is segmented according to the width of the array and the range of the second elevation data, so as to obtain the second color corresponding to each second elevation data. Among them, the first elevation data corresponding to each tile is an elevation array. In the process of obtaining the first color corresponding to each first elevation data, first obtain the color value corresponding to each elevation value in the elevation array, and the color values corresponding to each elevation value in the elevation array are combined to form the first color, that is, the first color is also a color array.
[0046] Specifically, the generalization process of the original data to obtain the generalized data includes: aggregating the elevation data of the original data according to the accuracy requirements of the generalized data to obtain the elevation data of the generalized data, and aggregating the contour line graphics of the original data to obtain the contour line graphics of the generalized data; the accuracy requirements of the generalized data are confirmed with the tile grading size and tile resolution corresponding to the second level of the generalized data table.
[0047] The first preset rule includes the pixel classification rule of the first level and the Mercator projection rule, and the second preset rule includes the pixel classification rule of the second level and the Mercator projection rule. In the process of cutting in this embodiment, cutting is performed according to the pixel classification rule and the Mercator projection rule of the corresponding level. When cutting the original data, the first-level cutting of the original data is performed according to the pixel classification rule and the Mercator projection rule of the first level. When cutting the generalized data, the second-level cutting of the generalized data is performed according to the pixel classification rule and the Mercator projection rule of the second level. Specifically, the pixel classification rule of this embodiment is the rule for dividing the map levels of Google Satellite Maps. The rule for dividing the map levels of Google Satellite Maps is the rule for classifying pixels, that is, each pixel on the map is divided according to the level. For example, the pixels are divided into 256*256 to be divided into multiple tiles, and an index is determined for each tile; the Mercator projection rule is the rule for converting pixels and longitude and latitude. The Mercator projection rule can perform reverse projection according to the longitude and latitude of any pixel point, that is, the index corresponding to each pixel point on the entire map can be determined. Among them, multiple pixel points corresponding to each index jointly form the elevation data and contour line graphics corresponding to the index.
[0048] This embodiment designs the table structure and data processing display process according to the special effects of Google Maps and Mercator projection. Using a small amount of data preprocessing time, it effectively matches the data storage distribution and display requirements, and greatly improves the probability of hitting valid data and cache effectiveness during real-time rendering, effectively reducing the CPU (Central Processing Unit) and memory pressure of the server during real-time rendering.
[0049] As Figure 4 shown, it is a logical schematic diagram for obtaining the original data table and the generalized data table in this embodiment, including the following steps:
[0050] S1, receiving map data.
[0051] Specifically, the server receives the map data input by the user, that is, the original data.
[0052] S2, size and resolution calculation.
[0053] After the server receives the map data input by the user, it calculates the data accuracy requirements for each level according to the tile grading size and tile resolution. For example, when multiple second levels are from level 9 to level 12 respectively, the data accuracy requirements for levels 9 to 12 are obtained respectively.
[0054] S3, data generalization.
[0055] After the server obtains the data accuracy requirements for each level, it performs generalization processing on the original data according to the data accuracy requirements, that is, it performs aggregation processing on the elevation data of the original data to obtain the elevation data of the generalized data, and performs aggregation processing on the contour line graphics of the original data to obtain the contour line graphics of the generalized data; for example, after obtaining the data accuracy requirements for level 9, the contour line graphics of the original data are aggregated according to the data accuracy requirements for level 9 to obtain the generalized data for level 9; the acquisition methods for the generalized data of levels 10 to 12 are similar, and for the sake of avoiding repetition, they will not be elaborated here.
[0056] S4, generalized data cutting.
[0057] After the server obtains the generalized data for each level, it cuts the generalized data for each level according to the second preset rule, that is, it cuts the elevation data of the generalized data to obtain multiple second elevation data, and cuts the contour line graphics of the generalized data to obtain multiple second contour line graphics. Each second elevation data and each second contour line graphic correspond to each second index.
[0058] S5, generalized data table storage.
[0059] After obtaining the second index and the corresponding second elevation data and the corresponding second contour line graphic, the correspondence of the second index, the corresponding second elevation data, and the corresponding second contour line graphic is stored in the generalized data table.
[0060] S6, original data cutting.
[0061] After the server obtains the map data, that is, the original data, it cuts the original data of the first level according to the first preset rule, that is, it cuts the elevation data of the original data to obtain multiple first elevation data, and cuts the contour line graphics of the original data to obtain multiple first contour line graphics. Each first elevation data and each first contour line graphic correspond to each first index.
[0062] S7, original data table storage.
[0063] After obtaining the first index and the corresponding first elevation data and the corresponding first contour line graphic, the correspondence of the first index, the corresponding first elevation data, and the corresponding first contour line graphic is stored in the original data table.
[0064] Specifically, in the above step 102, it can be processed according to different levels of user requirements, that is, the map display level. Taking the case where the number of generalization data tables is 1 as an example, the following four cases can be divided according to the user requirement level:
[0065] In the first case, when the map display level is the same as the first level, determine the corresponding first index according to the map display area, and obtain the corresponding first tile data in the original data table as the target tile data according to the first index.
[0066] In the second case, when the map display level is the same as the second level, determine the corresponding second index according to the map display area, and obtain the corresponding second tile data in the generalization data table as the target tile data according to the second index.
[0067] In the third case, when the map display level is higher than the second level and lower than the first level, determine multiple first indexes corresponding to the map display area, obtain multiple first tile data in the original data table according to the multiple first indexes, and merge the multiple first tile data to obtain the target tile data.
[0068] In the fourth case, when the map display level is higher than the first level, determine a first index corresponding to the map display area, obtain the first tile data in the original data table according to the first index, cut the first tile data to obtain multiple third tile data corresponding to the map display level, and obtain at least one corresponding third tile data in the multiple third tile data as the target tile data according to the map display area. Specifically, at this time, the level of user requirements is the map display level, that is, the third level, and the third level is higher than the first level. The map can be divided into each map tile and the corresponding third index at the third level according to the rules of Google satellite map. The third index includes the third level, the third X coordinate, and the third Y coordinate. Therefore, the corresponding third index at the third level can be determined according to the map display area. After cutting the first tile data to obtain multiple third tile data corresponding to the third level, the corresponding third tile data can be found according to the third index, and the third tile data is used as the target tile data.
[0069] In some embodiments, the number of generalization data tables is multiple, and the second levels corresponding to the multiple generalization data tables are all different. When the number of generalization data tables is multiple, in step 102, it can be processed according to the following four cases:
[0070] In the first case, when the map display level is the same as the first level, determine the corresponding first index according to the map display area, and obtain the corresponding first tile data in the original data table as the target tile data.
[0071] In the second case, when the map display level is the same as any one of the second levels, determine the corresponding second index according to the map display area, and obtain the corresponding second tile data in the generalized data table as the target tile data.
[0072] In the third case, when the map display level is higher than all the second levels and lower than the first level, determine multiple first indexes corresponding to the map display area, obtain multiple first tile data in the original data table according to the multiple first indexes, and merge the multiple first tile data to obtain the target tile data.
[0073] In the fourth case, when the map display level is higher than the first level, determine a first index corresponding to the map display area, obtain the first tile data in the original data table according to the first index, cut the first tile data to obtain multiple third tile data corresponding to the map display level, and obtain at least one corresponding third tile data in the multiple third tile data according to the map display area as the target tile data.
[0074] In practical applications, the first level of the original data table can be set to level 15, and the second levels of multiple generalized data tables are set to levels 9, 10, 11, and 12 respectively. As Figure 5 shown, it is a logical schematic diagram of the map display method of this embodiment. When the user needs the layers of levels 9, 10, 11, and 12, first, query the cache, and use GeoWebCache to query all data tables corresponding to the map object identifier according to the map object identifier; then, query the layer, and use Geoserver to determine the generalized data table corresponding to the user's required level, that is, the second level (levels 9, 10, 11, and 12) in all data tables; finally, data query, query the second tile data corresponding to the user's required display area (that is, the second X coordinate and the second Y coordinate) in the generalized data table as the target tile data.
[0075] When the user requests a layer at level 13 or above, first, query the cache. Use GeoWebCache to query all data tables corresponding to the map object identifier based on the map object identifier. Then, query the layer. Use Geoserver to determine the original data table corresponding to the user's required level (level 15) from all data tables. Finally, perform data query. Query the first tile data corresponding to the display area (i.e., the first X coordinate and the first Y coordinate) required by the user in the original data table. Among them, when the required level is a level 15 layer, directly use the obtained first tile data as the target tile data. When the required level is between 12 and 15, that is, levels 13 and 14, merge the obtained first tile data upward as the data source for the 13 / 14-level layer, so as to obtain the target tile data for levels 13 and 14. When the required level is greater than 15, such as levels 16, 17, and 18, cut the obtained first tile data downward in real time, so as to obtain the target tile data for levels 16, 17, and 18.
[0076] In specific applications, Geowebcache is an open-source project implemented in Java for caching WMS (Web Map Service) Tiles. When the map client requests a new map and Tiles, GeoWebCache will intercept these calls and then return the cached Tiles. If the cache cannot be found, it will then call the Tiles on the server, thereby improving the speed of map display and achieving a better user experience. The GeoServer server is an open-source map server based on JE22. It follows the OGC (Open Geospatial Consortium) open standard, has the advantages of complete functions and high scalability, and provides users with a REST (Representational State Transfer) specification API (Application Programming Interface). Users can use the API to manage the workspace, datastore, layers, styles, etc. in GeoServer.
[0077] Step 103: Render according to the target tile data for display on the window.
[0078] Specifically, after the server obtains the target tile data, it renders according to the target tile data for display on the window of the user's current terminal.
[0079] In this embodiment, by pre-storing the original data table and / or the generalized data table, when obtaining the map display information required by the user on the current window, the corresponding target tile data is obtained according to the pre-stored original data table and / or the pre-stored generalized data table, and rendering is performed according to the target tile data to be displayed on the window, reducing the amount of computation in the rendering process and improving the rendering efficiency; moreover, since this application reduces the amount of computation for single rendering, it can be applied to scenarios with complex topographic maps and large amounts of user data, and has good scalability.
[0080] An embodiment of the present application relates to an electronic device, such as Figure 6 shown, including: at least one processor 201; and a memory 202 communicatively connected to the at least one processor 201; wherein, the memory stores instructions executable by the at least one processor 201, and the instructions are executed by the at least one processor 201 so that the at least one processor 201 can execute the above-mentioned map display method.
[0081] Among them, the memory 202 and the processor 201 are connected by a bus. The bus can include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors 201 and the memory 202 together. The bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art, so they will not be further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, and provides a unit for communicating with various other devices on the transmission medium. The data processed by the processor 201 is transmitted on the wireless medium through the antenna. Further, the antenna also receives data and transmits the data to the processor 201.
[0082] The processor 201 is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interface, voltage regulation, power management, and other control functions. And the memory 202 can be used to store the data used by the processor during operation.
[0083] An embodiment of the present application relates to a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the above method embodiment is implemented.
[0084] That is, those skilled in the art can understand that all or part of the steps in the methods of the above embodiments can be completed by instructing relevant hardware through a program. The program is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps in the methods of various embodiments of the present application. The foregoing storage medium includes: various media that can store program codes such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs.
[0085] Those of ordinary skill in the art can understand that the above embodiments are specific embodiments for implementing the present application, and in actual applications, various changes can be made in form and details without departing from the spirit and scope of the present application.
Claims
1. A method for map display, characterized in that, Including: Obtain the map display information of the current window; Utilize the pre-stored original data table and / or the pre-stored generalized data table to obtain the target tile data corresponding to the map display information; Render according to the target tile data to display on the window.
2. The map display method according to claim 1, wherein The map display information includes the map display level and the map display area; the original data table is the layer data at the first level, and the generalized data table is the layer data at the second level; the first level is higher than the second level, and the amount of layer data at the first level is greater than the amount of layer data at the second level.
3. The map display method according to claim 2, wherein, The obtaining method of the original data table is: pre-obtain the original data; the original data includes longitude and latitude coordinates and the corresponding elevation data, the corresponding contour line graphics; Cut the original data according to the first preset rule to obtain the first index and the corresponding first elevation data, the corresponding first contour line graphics; Store the first index and the corresponding first elevation data, the corresponding first contour line graphics in the original data table; The obtaining method of the generalized data table is: perform generalization processing on the original data to obtain generalized data; the generalized data includes longitude and latitude coordinates and the corresponding elevation data, the corresponding contour line graphics; Cut the generalized data according to the second preset rule to obtain the second index and the corresponding second elevation data, the corresponding second contour line graphics; Store the second index and the corresponding second elevation data, the corresponding second contour line graphics in the generalized data table.
4. The map display method according to claim 3, wherein The performing generalization processing on the original data to obtain generalized data includes: Perform aggregation processing on the elevation data of the original data according to the accuracy requirement of the generalized data to obtain the elevation data of the generalized data, and perform aggregation processing on the contour line graphics of the original data to obtain the contour line graphics of the generalized data; the accuracy requirement of the generalized data is confirmed with the corresponding tile grading size and tile resolution at the second level.
5. The map display method according to claim 3 or 4, characterized in that The first preset rule includes the pixel classification rule at the first level and the Mercator projection rule; the second preset rule includes the pixel classification rule at the second level and the Mercator projection rule.
6. The map display method according to claim 3, characterized in that After obtaining the multiple first elevation data, it further includes: Obtain the corresponding first color according to the first elevation data, and store the first index and the corresponding first color in the original data table; After obtaining the second elevation data, it further includes: Obtain the corresponding second color according to the second elevation data, and store the second index and the corresponding second color in the generalized data table.
7. The map display method according to claim 2, wherein The utilizing the pre-stored original data table and / or the pre-stored generalized data table to obtain the target tile data corresponding to the map display information includes: When the map display level is consistent with the first level, determine the corresponding first index according to the map display area, and obtain the corresponding first tile data in the original data table as the target tile data; When the map display level is the same as the second level, determine the corresponding second index according to the map display area, and obtain the corresponding second tile data in the generalization data table as the target tile data according to the second index; When the map display level is higher than the second level and lower than the first level, determine a plurality of the first indexes corresponding to the map display area, obtain a plurality of the first tile data in the original data table according to the plurality of the first indexes, and merge the plurality of the first tile data to obtain the target tile data; When the map display level is higher than the first level, determine one of the first indexes corresponding to the map display area, obtain the first tile data in the original data table according to the first index, cut the first tile data to obtain a plurality of third tile data corresponding to the map display level, and obtain at least one of the corresponding third tile data in the plurality of third tile data as the target tile data according to the map display area.
8. The map display method according to claim 1, characterized in that, The number of the generalization data tables is multiple, and the second levels corresponding to the multiple generalization data tables are all different.
9. An electronic device, characterized in that, Comprising: At least one processor; And, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the map display method according to any one of claims 1 to 8.
10. A computer storage medium, characterized in that, Comprising: A computer program stored, wherein the computer program, when executed by a processor, implements the map display method according to any one of claims 1 to 8.