CN117056626A - Map preview method and device - Google Patents

Map preview method and device Download PDF

Info

Publication number
CN117056626A
CN117056626A CN202311003437.6A CN202311003437A CN117056626A CN 117056626 A CN117056626 A CN 117056626A CN 202311003437 A CN202311003437 A CN 202311003437A CN 117056626 A CN117056626 A CN 117056626A
Authority
CN
China
Prior art keywords
vector data
grid
map
grid vector
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311003437.6A
Other languages
Chinese (zh)
Inventor
李岩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Dt Dream Technology Co Ltd
Original Assignee
Hangzhou Dt Dream Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Dt Dream Technology Co Ltd filed Critical Hangzhou Dt Dream Technology Co Ltd
Priority to CN202311003437.6A priority Critical patent/CN117056626A/en
Publication of CN117056626A publication Critical patent/CN117056626A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The specification discloses a map preview method and device. Firstly, dividing map vector data according to tile distribution information of a set pyramid level to obtain grid vector data with mapping relation of at least one vector tile corresponding to the set pyramid level, wherein the vector tile is used for map preview. And secondly, thinning the grid vector data to obtain thinned grid vector data. Then, in response to a map access request for the target pyramid level, slicing each thinned grid vector data under the condition that the vector tiles are determined to be unfinished in slices, and generating preview tiles. Finally, previewing the map is completed based on the preview tile. According to the method, under the condition that slicing is not completed, the efficient map previewing can be completed by rapidly slicing the thinning data, and the user experience of accessing the online map by a user is improved.

Description

Map preview method and device
Technical Field
The present disclosure relates to the field of big data technologies, and in particular, to a method and an apparatus for previewing a map.
Background
With the rapid development of the internet, an online map service becomes an indispensable part of people's life. The online map service mainly uses map tile technology.
Tile types are classified into grid tiles and vector tiles. The grid tiles are used for respectively rendering the space data into map pictures with different zoom levels, then dividing the pictures with each level according to a certain rule, organizing the pictures according to a certain rule, and storing the pictures in a hard disk or a database to form a complete map.
Vector tiles may be descriptive files of vector data output by cutting the vector data in the same hierarchical cutting scheme as grid tiles. When a user accesses the online map, the client receives the vector tiles, and the client rapidly renders and displays the vector tiles.
For nationwide data, vector tiles are generated by vector slicing techniques, typically in days, while grid tiles are produced using grid slicing techniques, typically in weeks. This reduces the user experience of the user accessing the online map because of the longer time to generate tiles for the map preview, which requires longer waiting times.
Therefore, how to improve the map preview efficiency and improve the user experience is a problem to be solved urgently.
Disclosure of Invention
The specification provides a method, a device, an electronic device and a machine-readable storage medium for previewing a map, so as to improve the efficiency of previewing the map and the user experience.
The technical scheme adopted in the specification is as follows:
the specification provides a method for previewing a map, comprising the following steps:
dividing map vector data according to tile distribution information of a set pyramid level to obtain grid vector data with mapping relation of at least one vector tile corresponding to the set pyramid level; the vector tiles are used for the map preview;
thinning the grid vector data to obtain thinned grid vector data;
responding to a map access request aiming at a target pyramid level, and slicing each piece of the thinned grid vector data under the condition that the fact that the vector tiles are not sliced is determined, so as to generate preview tiles;
and completing the preview of the map based on the preview tile.
Optionally, the method further comprises:
in the event that it is determined that the vector tile has completed slicing, a preview of the map is completed based on the vector tile.
Optionally, the method is applied to a plurality of computing nodes, and the computing nodes are used for thinning the grid vector data;
the thinning of each grid vector data is carried out to obtain thinned grid vector data, which comprises the following steps:
Determining the data quantity of vector data to be reserved for each grid vector data according to the equipment parameters of the equipment to which the computing nodes belong;
and thinning the grid vector data based on the plurality of computing nodes according to the data quantity of the vector data required to be reserved for the grid vector data, so as to obtain thinned grid vector data.
Optionally, according to the data amount of the vector data to be reserved for each piece of grid vector data, thinning each piece of grid vector data based on the plurality of computing nodes to obtain thinned grid vector data, including:
dividing a space region where each grid vector data is located according to the data quantity of the vector data in each grid vector data and the determined node quantity of the computing nodes to obtain a grid vector data region with a one-to-one mapping relation with each computing node;
and thinning each grid vector data in each grid vector data area according to the data quantity of the vector data required to be reserved by each grid vector data according to the calculation node corresponding to the grid vector data area, so as to obtain each thinned grid vector data in the grid vector data area.
Optionally, the method further comprises:
and deleting partial vector data exceeding the grid vector data area in the vector data under the condition that any extracted vector data exceeds the grid vector data area, and obtaining each diluted grid vector data in the grid vector data area.
Optionally, the method further comprises;
and aiming at each grid vector data in the grid vector data area, under the condition that any extracted vector data exceeds the space area where the grid vector data is located and does not exceed the grid vector data area, cutting partial vector data, exceeding the space area where the grid vector data is located, in the vector data to obtain the grid vector data after thinning.
Optionally, the method further comprises:
taking partial vector data exceeding the space region where the grid vector data is positioned in the vector data as vector data after cutting;
and reserving the cut vector data in grid vector data corresponding to the space region where the cut vector data is located.
Optionally, the map areas that can be displayed on the display screen of the electronic device by different pyramid levels are different in size;
Before slicing each of the thinned grid vector data to generate a preview tile, the method further includes:
writing each diluted grid vector data into a cache;
slicing each of the thinned grid vector data to generate preview tiles, including:
determining whether the target pyramid level is greater than a set pyramid level; if so, determining vector data corresponding to a target map area according to the target map area which can be displayed by the target pyramid level on a display screen of the electronic equipment, and slicing the vector data corresponding to the target map area to generate a preview tile; if not, merging the diluted grid vector data in the cache according to the target pyramid level to obtain diluted grid vector data corresponding to the target pyramid level, and slicing the diluted grid vector data corresponding to the target pyramid level to generate preview tiles.
Optionally, the method further comprises:
acquiring a slicing time length spent on slicing vector data corresponding to the target map region;
determining whether the slicing time length is longer than a set slicing time length; and if so, determining the number of layers for increasing the set pyramid level according to the difference value between the slicing time length and the set slicing time length.
The present specification provides a device for previewing a map, comprising:
the segmentation module is used for segmenting the map vector data according to the tile distribution information of the set pyramid level to obtain grid vector data with mapping relation of at least one vector tile corresponding to the set pyramid level; the vector tiles are used for the map preview;
the thinning module is used for thinning each grid vector data to obtain thinned grid vector data;
the generation module is used for responding to a map access request aiming at a target pyramid level, and slicing each thinned grid vector data under the condition that the vector tiles are determined to be unfinished in slices, so as to generate preview tiles;
and the preview module is used for completing the preview of the map based on the preview tile.
The specification provides an electronic device, which comprises a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are connected with each other through the bus;
the memory stores machine readable instructions, and the processor executes the map preview method by invoking the machine readable instructions.
The present specification provides a machine-readable storage medium storing machine-readable instructions that, when invoked and executed by a processor, implement the method of map preview described above.
The above-mentioned at least one technical scheme that this specification adopted can reach following beneficial effect:
in the map preview method provided by the specification, map vector data is segmented according to tile distribution information of a set pyramid level, so as to obtain grid vector data with mapping relation of at least one vector tile corresponding to the set pyramid level. And then, thinning the grid vector data to obtain thinned grid vector data. Then, in response to a map access request for the target pyramid level, slicing each thinned grid vector data in the case that the vector tiles are determined to be unfinished in slices, and generating preview tiles. Finally, the preview of the map is finished based on the preview tile, so that the map can be quickly sliced by utilizing the thinning data to finish the efficient preview of the map under the condition that slicing is not finished, and the user experience of accessing the online map by a user is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the specification, illustrate and explain the exemplary embodiments of the present specification and their description, are not intended to limit the specification unduly. In the drawings:
FIG. 1 is a schematic diagram of a tile map pyramid model shown in an exemplary embodiment;
FIG. 2 is a flow chart illustrating a method of map preview in accordance with an exemplary embodiment;
FIG. 3 is a schematic diagram of a type of grid vector data shown in an exemplary embodiment;
FIG. 4 is a schematic diagram illustrating the data volume of each grid vector data that needs to be preserved in accordance with an exemplary embodiment;
FIG. 5 is a schematic diagram of a grid vector data area shown in an exemplary embodiment;
FIG. 6 is a schematic diagram of a process vector data shown in an exemplary embodiment;
FIG. 7 is a schematic diagram of another processing vector data shown in an exemplary embodiment;
FIG. 8 is a schematic diagram of an electronic device in which a map preview apparatus is located, according to an exemplary embodiment;
fig. 9 is a block diagram illustrating an apparatus for map preview in accordance with an exemplary embodiment.
Detailed Description
In order to make the technical solutions in the present specification better understood by those skilled in the art, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only some embodiments of the present specification, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are intended to be within the scope of the present disclosure.
It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the method may include more or fewer steps than described in this specification. Furthermore, individual steps described in this specification, in other embodiments, may be described as being split into multiple steps; while various steps described in this specification may be combined into a single step in other embodiments.
In order to make the technical solution in the embodiments of the present specification better understood by those skilled in the art, the related art related to the embodiments of the present specification will be briefly described below.
In geometry, a vector refers to a geometric object having both size and direction.
In the field of geographic information systems, vector data may refer to a data organization method that uses points, lines, and planes in euclidean geometry to represent spatial distribution of geographic entities, and is used to describe information of irregular terrains in nature. For example, in rectangular coordinates, data of the position and shape of a map graphic or a geographic entity is represented by (X, Y) coordinates. Vector data can be divided into point entities, line entities and plane entities. The point entity may be a coordinate, such as (X, Y). The line entity may be a curve consisting of successive straight line segments, such as a set of coordinate strings (X1, Y1), (X2, Y2), …, (Xn, yn). The surface entity may be a boundary of a planar surface object consisting of successive straight line segments, also referred to as polygon data. That is, the vector data represents the spatial location of the geographic entity as accurately as possible by recording coordinates.
In practical application, the vector data is configured with the style information such as designated color, line type, symbol and the like, and then rendered through the client for display to the user.
Map vector data of great volume is often encountered in the course of using vector data. When the client loads and renders the map vector data, a long time is required, and the map cannot be displayed to the user quickly. Moreover, the overall rendering of map vector data, which is large in volume, also easily causes a client crash. Thus, map vector data may be sliced, typically based on a tile map pyramid model. The slicing process is called vector slicing.
The tile map pyramid model is a multi-resolution hierarchical model, and is stored and displayed in different resolutions according to the needs of users under unified spatial reference, so that a pyramid structure with resolution from thick to thin and data size from small to large is formed. The geographical range represented is unchanged. The more detailed the map information represented by the pyramid toward the bottom layer, the greater the scale. As particularly shown in fig. 1.
FIG. 1 is a schematic diagram of a tile map pyramid model, as shown in an exemplary embodiment.
In fig. 1, the vector map with the highest zoom level and the largest map scale is taken as the bottom layer of the pyramid, namely the 0 th layer vector tile. Dividing the 0 th layer vector tile into four square vector tiles with the same size to obtain the 1 st layer vector tile. Then, the same method is adopted to obtain the 2 nd layer vector tiles, and similarly, the n+1 th layer vector tiles are equally divided by the N th layer vector tiles, and the number of the n+1 th layer vector tiles is four times that of the N th layer vector tiles, so that the whole tile map pyramid model is formed.
Wherein the coding of the vector tile may be denoted (X, Y, Z). X is used to represent the column number of the vector tile in the tile map pyramid model. Y is used to represent the row number of the vector tile in the tile map pyramid model. Z is used to represent the number of layers of the vector tile in the tile map pyramid model.
In practical applications, due to the long time to generate the vector tiles, some vector tiles in the tile map pyramid model may not be completed yet, and the user cannot preview the partial unfinished vector tiles, which may reduce the user experience of the user accessing the online map.
Based on this, the specification proposes a technical scheme of thinning grid vector data corresponding to a set pyramid level to obtain thinned grid vector data, slicing each thinned grid vector data under the condition that a determination vector tile is not finished in slicing, and generating preview tiles so as to display the preview tiles to a user.
The following describes in detail the technical solutions provided by the embodiments of the present specification with reference to the accompanying drawings.
FIG. 2 is a flow chart illustrating a method of map preview in accordance with an exemplary embodiment, comprising the steps of:
s200: dividing map vector data according to tile distribution information of a set pyramid level to obtain grid vector data with mapping relation of at least one vector tile corresponding to the set pyramid level; the vector tiles are used for the map preview.
In the embodiment of the present specification, the execution subject of the method for previewing a map may be a server. The physical carrier of the server is typically a server or a cluster of servers. Of course, in the embodiment of the present disclosure, the operation may be performed by the client auxiliary server to reduce the operation pressure of the server. For convenience of description, a method of map preview provided in the present specification will be described below with only a server side as an execution subject.
In this embodiment of the present disclosure, the server may segment the map vector data according to the tile distribution information of the set pyramid level, to obtain grid vector data having a mapping relationship with at least one vector tile corresponding to the set pyramid level. Vector tiles are used for map preview.
The tile distribution information mentioned here may include: the number of rows, the number of columns, and the location of the vector tile. For example, the number of rows and columns per layer in the tile map pyramid model, where the vector tile is located, may be denoted as (X, Y, Z). X is used to represent the column number of the vector tile in the tile map pyramid model. Y is used to represent the row number of the vector tile in the tile map pyramid model. Z is used to represent the number of layers of the vector tile in the tile map pyramid model.
In the embodiment of the present disclosure, service maps corresponding to different services have different map attributes. The map attributes include: map range, density (size of data amount in the set area), and the like. In order to obtain the vector tile with good preview effect, the server side can determine the set pyramid level according to the map attribute of the service map. For example, the higher the intensity of the business map, the higher the determined set pyramid level. The lower the density of the business map, the lower the determined set pyramid level.
S202: and thinning the grid vector data to obtain thinned grid vector data.
In practical applications, there are two strategies for vector slicing: static vector slices and dynamic vector slices. The static vector slice is to generate vector tiles of all levels in advance, store the vector tiles in a server in the form of a tile map pyramid model, and read corresponding vector tiles from the tile map pyramid model and send the vector tiles to the client when receiving a map access request sent by the client. However, static vector slices cannot render vector data updated in real-time.
And the dynamic vector slicing is used for determining vector data corresponding to a target map area according to the target map area which can be displayed on a display screen of the electronic equipment according to the target pyramid level when a map access request sent by a client is received, slicing the vector data corresponding to the target map area and generating a vector tile. However, the motion vector slice has high performance when the data amount of the vector data is small, and has low performance when the data amount of the vector data is large, and the resources of the server side required for the motion vector slice are very high, so that the problems such as insufficient memory are likely to occur.
Based on the method, the server side can dilute each piece of grid vector data corresponding to the set pyramid level to reduce the data quantity in the grid vector data, so that the performance of dynamic vector slicing is improved, and when a subsequent user previews the preview tile, the preview tile obtained based on the thinned grid vector data corresponding to the set pyramid level is displayed to the user.
In the embodiment of the present disclosure, the server may dilute each grid vector data to obtain the thinned grid vector data.
Because there may be duplicate data and less important data in the vector data, this part of the vector data wastes more memory space on the one hand and causes a lower quality of the generated vector tiles on the other hand. Therefore, the server can extract partial vector data according to a set proportion through the calculation node, so that the data quantity of the vector data is reduced under the condition that the curve shape in the map is unchanged.
In the embodiment of the present disclosure, the server includes a plurality of computing nodes, where the computing nodes may be used to dilute the grid vector data. The server side can determine the data quantity of the vector data required to be reserved for each grid vector data according to the equipment parameters of the equipment to which the computing nodes belong. The device parameters mentioned herein may include: CPU type, motherboard model and performance, memory parameters, disk parameters, etc.
And then, according to the data quantity of the vector data which needs to be reserved for each grid vector data, thinning each grid vector data based on a plurality of calculation nodes to obtain thinned grid vector data.
Currently, the method for extracting vector data at the server side is usually random extraction. Since there are cases where the vector data of the partial area is large in data amount and the vector data of the partial area is small in data amount in the urban map, there is a possibility that the vector data of the area with small data amount is all extracted in the process of randomly extracting the vector data, resulting in distortion of the generated vector tile. Therefore, the server side can determine the data quantity of the vector data in each grid vector data first, and then extract part of the vector data according to the set proportion through the calculation nodes. Specifically, fig. 3 and 4 show the same.
FIG. 3 is a schematic diagram of a type of grid vector data shown in an exemplary embodiment.
In fig. 3, the numerical value in each grid is used to represent the data amount of vector data in one grid vector data.
The vector data comprises a line entity and a plane entity. When a line entity or a plane entity exists in a plurality of mesh vector data, the line entity or the plane entity is regarded as one vector data existing in the plurality of mesh vector data.
FIG. 4 is a schematic diagram illustrating the data volume of each grid vector data that needs to be preserved in accordance with an exemplary embodiment.
In fig. 4, if the data amount of the vector data to be held for each piece of mesh vector data is determined to be 30% of the original data amount, the numerical value in each mesh is used to represent 30% of the data amount of the vector data in one piece of mesh vector data. In order to prevent vector tile distortion caused by the fact that vector data does not exist in grid vector data with small data quantity after processing, a server side at least reserves one vector data in the grid vector data. The vector data in each of the mesh vector data in fig. 4 is calculated by taking the data amount of the vector data in each of the mesh vector data in fig. 3 as an example.
In practical application, in order to improve the computing efficiency, each grid vector data is generally uniformly distributed to each computing node in the server, and then each computing node processes the data, however, the data amounts of vector data in different grid vector data are different, and the situation that the data amount of vector data required to be processed by part of computing nodes is excessive may occur, so that the computing time of the computing nodes of the part is too long, and the overall computing time is prolonged.
Based on the above, the server may divide each grid vector data according to the data amount of the vector data in each grid vector data, so that the data amounts of the vector data required to be processed by each computing node are approximately the same. That is, the difference between the data amounts of the vector data that the respective computing nodes need to process is smaller than the set difference threshold. Setting the difference threshold may be determined by a skilled person based on expert experience.
In the embodiment of the present disclosure, the server may divide, according to the data amount of the vector data in each grid vector data and the determined node number of the computing nodes, a spatial area where each grid vector data is located, to obtain a grid vector data area having a one-to-one mapping relationship with each computing node.
And thinning each grid vector data in each grid vector data area according to the data quantity of the vector data required to be reserved by each grid vector data according to the calculation node corresponding to the grid vector data area, so as to obtain each thinned grid vector data in the grid vector data area. As shown in particular in fig. 5.
Fig. 5 is a schematic diagram of a grid vector data area shown in an exemplary embodiment.
In fig. 5, one mesh vector data area may be composed of a plurality of mesh vector data. The numerical value in each area is used to represent the data amount of vector data in one mesh vector data area. It can be seen that the data amounts of the vector data in the different mesh vector data areas are approximately the same. That is, the difference between the data amounts of the vector data in each mesh vector data area is smaller than the set difference threshold. Wherein a grid vector data area is processed by a computing node. Each of the mesh vector data areas in fig. 5 is calculated by taking the data amount of vector data in each of the mesh vector data in fig. 3 as an example.
In practical application, since the vector data includes the wired entity and the surface entity, in the process of thinning each grid vector data, the wired entity and the surface entity need to be cut or deleted so as to avoid the repetition of the vector data and keep the integrity of the vector data to a certain extent.
In the embodiment of the present disclosure, when it is determined that any extracted vector data exceeds the grid vector data area, deleting a portion of the vector data exceeding the grid vector data area, to obtain each thinned grid vector data in the grid vector data area.
In the event that it is determined that any of the extracted vector data does not exceed the grid vector data area, the vector data is retained. As shown in particular in fig. 6.
FIG. 6 is a schematic diagram of a process vector data shown in an exemplary embodiment.
In fig. 6, a curve is used to represent a line entity. When the computing node is thinning the grid vector data region a, the solid line is used to represent the portion of vector data where the line entity is located within the grid vector data region a. The dashed lines are used to represent the portion of the vector data where the line entity extends beyond the grid vector data area a. The computing node may delete the dotted line portion, leaving the solid line portion. That is, the computing node may delete a portion of the vector data that exceeds the mesh vector data area a, and retain a portion of the vector data that is located within the mesh vector data area a.
Further, when the computing node is thinning the grid vector data region B, the solid line is used to represent a portion of the vector data of the line entity that exceeds the grid vector data region B. The dashed lines are used to represent the portion of the vector data where the line entity is located within the grid vector data area B. The computing node may delete a portion of the vector data that exceeds the grid vector data area B, and retain a portion of the vector data that is located within the grid vector data area B. It can be seen that by the above method, the present method can avoid the repetition of vector data across the grid vector data area.
In the embodiment of the present specification, for each piece of mesh vector data in the mesh vector data area, if it is determined that any piece of extracted vector data exceeds the spatial area in which the mesh vector data is located, the vector data is retained.
And under the condition that any extracted vector data exceeds the space region where the grid vector data is located and does not exceed the grid vector data region, cutting partial vector data, exceeding the space region where the grid vector data is located, in the vector data to obtain the grid vector data after the thinning.
Then, the server can take part of vector data exceeding the space region where the grid vector data is located in the vector data as vector data after cutting;
then, the server may reserve the post-cutting vector data in the grid vector data corresponding to the spatial region in which the post-cutting vector data is located. As particularly shown in fig. 7.
FIG. 7 is a schematic diagram of another processing vector data shown in an exemplary embodiment.
In fig. 7, the mesh vector data area is composed of six mesh vector data. The solid line portion of the vector data 1 is located in the spatial region where the mesh vector data a is located, and the broken line portion of the vector data 1 is located in the spatial region where the mesh vector data B is located. Based on this, the server may cut the solid line portion and the broken line portion of the vector data 1, store the solid line portion of the vector data 1 in the mesh vector data a, and store the broken line portion of the vector data 1 in the mesh vector data B. In calculating vector data in the mesh vector data, the solid line portion of the vector data 1 is regarded as one data in the mesh vector data a, and the broken line portion of the vector data 1 is regarded as one data in the mesh vector data B.
Further, the solid line portion of the vector data 2 is located in a space region where the mesh vector data C is located, and the broken line portion of the vector data 2 is located in a space region where the mesh vector data D is located. Based on this, the server may cut the solid line portion and the broken line portion of the vector data 2, store the solid line portion of the vector data 2 in the mesh vector data C, and store the broken line portion of the vector data 2 in the mesh vector data D. Wherein the solid line part of the vector data 2 is divided into two line entities, but the two line entities are regarded as one data when calculating the vector data within the grid vector data.
Wherein each computing node may follow a left-to-right, top-to-bottom order in processing each of the mesh vector data in the mesh vector data region. For each piece of grid vector data, when the computing node processes the grid vector data, the computing node randomly extracts the vector data in the grid vector data, and if some vector data fall into other pieces of grid vector data, whether the data amount of the vector data in the grid vector data reaches a set data amount threshold value is judged. If yes, deleting the vector data in the grid vector data randomly, and storing the vector data in the grid vector data. If not, the vector data is directly stored in the grid vector data. When all the vector data in the grid vector data are processed, the next grid vector data are processed in sequence.
It should be noted that, there may be various methods for randomly deleting the vector data in the grid vector data. For example, the vector data of which the type is a point entity in the mesh vector data is preferentially deleted. For another example, vector data located only within the grid vector data is preferentially deleted. The present specification does not limit the method of deleting vector data within the mesh vector data.
It can be seen that the above method can guarantee the integrity of vector data to a certain extent.
S204: and in response to a map access request aiming at a target pyramid level, slicing each piece of the thinned grid vector data under the condition that the fact that the vector tiles are not sliced is determined, and generating preview tiles.
S206: and completing the preview of the map based on the preview tile.
In the present description embodiment, in response to a map access request for a target pyramid level, in the case where it is determined that a vector tile has completed slicing, a preview of a map is completed based on the vector tile.
And under the condition that the vector tiles are determined to be unfinished in slicing, slicing the grid vector data after thinning, and generating preview tiles. The server may then complete the preview of the map based on the preview tile. That is, when the user previews the map, the user previews the preview tile generated based on the thinned mesh vector data corresponding to the set pyramid level.
Because of the limited map area that can be presented by the display screen of the electronic device. The higher the pyramid level, the smaller the map area that can be presented on the display screen of the electronic device. Although the map resolution corresponding to the target pyramid level is higher, the data amount of vector data within the map area is still smaller due to the smaller map area. Therefore, the data volume of the vector data of the map area still meets the requirement of the dynamic vector slice, and the server side can directly generate the preview slice through the dynamic vector slice.
Based on the above, when the target pyramid level is larger than the set pyramid level, the server can directly generate the preview vector tile according to the vector data of the target pyramid level in the target map area which can be displayed on the display screen of the electronic device.
In the embodiment of the present disclosure, the map areas that can be displayed on the display screen of the electronic device by different pyramid levels are different in size. The server may write each thinned grid vector data into the cache for use in subsequent motion vector slices.
The server may then determine whether the target pyramid level is greater than the set pyramid level. If so, determining vector data corresponding to the target map area according to the target map area which can be displayed by the target pyramid level on the display screen of the electronic equipment, and slicing the vector data corresponding to the target map area to generate a preview tile.
If not, merging the diluted grid vector data in the cache according to the target pyramid level to obtain diluted grid vector data corresponding to the target pyramid level, and slicing the diluted grid vector data corresponding to the target pyramid level to generate a preview tile.
For example, assuming that the map range is Hangzhou city, the pyramid level is set to be 12, the map area that the pyramid level can show on the display screen of the electronic device is set to be Hangzhou, the target pyramid level is set to be 15, and the target pyramid level can only show part of the target map area, such as the coastal river area, on the display screen of the electronic device. It can be seen that the target pyramid level is larger than the set pyramid level, because the number of vector tiles in the target map area is smaller, even if the data amount of a single vector tile in the target map area is larger, in general, the data amount of vector data in the target map area is still smaller, and the server can directly slice the vector data in the target map area to generate preview tiles. Thus, the detail level of the generated preview tile is improved.
Further, assuming that the target pyramid level is 8-level, the map area that can be displayed on the display screen of the electronic device by the target pyramid level is Hangzhou. It can be seen that the target pyramid level is smaller than the set pyramid level, but the map area that can be presented on the display of the electronic device is the same. At this time, the slicing time required by the server to slice the vector data is long, so the server can combine the diluted grid vector data in the cache according to the level difference between the target pyramid level and the set pyramid level to obtain diluted grid vector data corresponding to the target pyramid level, and slice the diluted grid vector data corresponding to the target pyramid level to generate the preview tile. Thus, the efficiency of vector slicing is improved.
In practical application, when the determined set pyramid level is lower, a problem may occur that the server side spends a longer slicing time in slicing the vector data corresponding to the target map area, which may cause the user to wait for a longer time, thereby reducing the user experience. Therefore, the server can adjust the set pyramid level according to the slicing time length.
In the embodiment of the present specification, the server may acquire the slice duration taken to slice the vector data corresponding to the target map area.
Then, the server can determine whether the slicing time length is greater than the set slicing time length, and if so, determine the number of layers for increasing the set pyramid level according to the difference between the slicing time length and the set slicing time length. For example, when the difference between the slice duration and the set slice duration is greater than a first difference threshold, the set pyramid level is increased by one layer. And when the difference value between the slicing time length and the set slicing time length is larger than a second difference value threshold value, adding two layers to the set pyramid level.
If not, the set pyramid level is not changed.
The method of map preview in the present specification may be applied to raster data in addition to vector data. The server side can store map raster data in advance, and the server side can divide the map raster data according to the tile distribution information of the set pyramid level to obtain grid raster data with a mapping relation with at least one grid tile corresponding to the set pyramid level. Grid tiles are used for map preview.
Secondly, the server side can dilute each grid data to obtain the grid data after the thinning.
Then, the server may slice each thinned grid data in response to a map access request for the target pyramid level, under a condition that it is determined that the grid tiles do not have a slice, and generate a preview grid tile.
Finally, the server may complete the preview of the map based on the preview grid tile.
According to the method, under the condition that slicing is not completed, the map is quickly sliced by utilizing the thinning data to finish efficient preview, and the user experience of accessing the online map is improved. In the process of thinning the grid vector data, the operations such as cutting and deleting the vector data in the grid vector data are performed, so that the curve shape in the map is unchanged, the situation that the generated vector tiles are distorted is avoided, and the storage space required by the vector data is reduced.
In addition, the grid vector data is thinned through the plurality of computing nodes, the data quantity of the vector data which needs to be processed by each computing node is approximately the same, and the total computing time is reduced.
Furthermore, the method can slice the thinned grid vector data in the cache under the condition that the target pyramid level is smaller than the set pyramid level, and improves the vector slicing efficiency. Under the condition that the target pyramid level is larger than the set pyramid level, vector data in the target map area are directly sliced, and the detail degree in the generated preview tile is improved.
Corresponding to the embodiment of the map previewing method, the present specification also provides an embodiment of a map previewing device.
Referring to fig. 8, fig. 8 is a schematic structural diagram of an electronic device where a map preview apparatus is shown in an exemplary embodiment. At the hardware level, the device includes a processor 802, an internal bus 804, a network interface 806, memory 808, and non-volatile storage 810, although other hardware requirements are possible. One or more embodiments of the present description may be implemented in a software-based manner, such as by the processor 802 reading a corresponding computer program from the non-volatile memory 810 into the memory 808 and then running. Of course, in addition to software implementation, one or more embodiments of the present disclosure do not exclude other implementation manners, such as a logic device or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but may also be hardware or a logic device.
Referring to fig. 9, fig. 9 is a block diagram illustrating an apparatus for previewing a map according to an exemplary embodiment. The map preview device can be applied to the electronic equipment shown in fig. 8 to realize the technical scheme of the specification. The map preview device may include:
the segmentation module 900 is configured to segment map vector data according to tile distribution information of a set pyramid level, so as to obtain grid vector data with a mapping relationship between at least one vector tile corresponding to the set pyramid level; the vector tiles are used for the map preview;
the thinning module 902 is configured to thin each piece of the grid vector data to obtain thinned grid vector data;
a generating module 904, configured to, in response to a map access request for a target pyramid level, slice each of the thinned grid vector data to generate a preview tile under a condition that it is determined that the vector tile does not have a slice;
a preview module 906 for completing the preview of the map based on the preview tile.
Optionally, the preview module 906 is specifically further configured to complete the preview of the map based on the vector tile in case it is determined that the vector tile has completed slicing.
Optionally, the method is applied to a plurality of computing nodes, where the computing nodes are configured to dilute the grid vector data, and the thinning module 902 is specifically configured to determine, according to an equipment parameter of an equipment to which the computing nodes belong, a data amount of the vector data that needs to be reserved for each grid vector data, and based on the computing nodes, thin each grid vector data according to the data amount of the vector data that needs to be reserved for each grid vector data, so as to obtain the thinned grid vector data.
Optionally, the thinning module 902 is specifically configured to divide, according to the data amount of the vector data in each grid vector data and the determined node number of the computing node, a spatial area where each grid vector data is located, to obtain a grid vector data area having a one-to-one mapping relationship with each computing node, and for each grid vector data area, thin each grid vector data in the grid vector data area based on the computing node corresponding to the grid vector data area according to the data amount of the vector data required to be reserved by each grid vector data, to obtain each thinned grid vector data in the grid vector data area.
Optionally, the thinning module 902 is specifically further configured to delete a portion of the vector data exceeding the grid vector data area in the vector data under the condition that it is determined that any extracted vector data exceeds the grid vector data area, so as to obtain each thinned grid vector data in the grid vector data area.
Optionally, the thinning module 902 is further specifically configured to, for each grid vector data in the grid vector data area, cut partial vector data in the vector data, which exceeds the space area where the grid vector data is located, under the condition that it is determined that any extracted vector data exceeds the space area where the grid vector data is located and does not exceed the grid vector data area, and obtain the thinned grid vector data.
Optionally, the thinning module 902 is specifically further configured to use, as the post-cutting vector data, a portion of the vector data that exceeds the spatial region where the grid vector data is located, and retain the post-cutting vector data in the grid vector data corresponding to the spatial region where the post-cutting vector data is located.
Optionally, the size of the map area that can be displayed by different pyramid levels on the display screen of the electronic device is different, and the generating module 904 is specifically configured to write each diluted grid vector data into the cache, and determine whether the target pyramid level is greater than a set pyramid level; if so, determining vector data corresponding to a target map area according to the target map area which can be displayed by the target pyramid level on a display screen of the electronic equipment, and slicing the vector data corresponding to the target map area to generate a preview tile; if not, merging the diluted grid vector data in the cache according to the target pyramid level to obtain diluted grid vector data corresponding to the target pyramid level, and slicing the diluted grid vector data corresponding to the target pyramid level to generate preview tiles.
Optionally, the preview module 906 is specifically further configured to obtain a slice duration spent on slicing the vector data corresponding to the target map area, and determine whether the slice duration is greater than a set slice duration; if so, increasing the set pyramid level according to the difference value between the slicing time length and the set slicing time length.
The implementation process of the functions and roles of each unit in the above device is specifically shown in the implementation process of the corresponding steps in the above method, and will not be described herein again.
For the device embodiments, reference is made to the description of the method embodiments for the relevant points, since they essentially correspond to the method embodiments. The apparatus embodiments described above are illustrative only, in that the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purposes of the present description. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. A typical implementation device is a computer, which may be in the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or a combination of any of these devices.
In a typical configuration, a computer includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, read only compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic disk storage, quantum memory, graphene-based storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by the computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
The user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or fully authorized by each party, and the collection, use and processing of related data is required to comply with the relevant laws and regulations and standards of the relevant country and region, and is provided with corresponding operation entries for the user to select authorization or rejection.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
The foregoing describes specific embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
The terminology used in the one or more embodiments of the specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of the specification. As used in this specification, one or more embodiments and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in one or more embodiments of the present description to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of one or more embodiments of the present description. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "responsive to a determination", depending on the context.
The foregoing description of the preferred embodiment(s) is (are) merely intended to illustrate the embodiment(s) of the present invention, and it is not intended to limit the embodiment(s) of the present invention to the particular embodiment(s) described.

Claims (10)

1. A method of map preview, the method comprising:
dividing map vector data according to tile distribution information of a set pyramid level to obtain grid vector data with mapping relation of at least one vector tile corresponding to the set pyramid level; the vector tiles are used for the map preview;
thinning the grid vector data to obtain thinned grid vector data;
responding to a map access request aiming at a target pyramid level, and slicing each piece of the thinned grid vector data under the condition that the fact that the vector tiles are not sliced is determined, so as to generate preview tiles;
and completing the preview of the map based on the preview tile.
2. The method of claim 1, wherein the method is applied to a number of compute nodes that are used to dilute the grid vector data;
The thinning of each grid vector data is carried out to obtain thinned grid vector data, which comprises the following steps:
determining the data quantity of vector data to be reserved for each grid vector data according to the equipment parameters of the equipment to which the computing nodes belong;
and thinning the grid vector data based on the plurality of computing nodes according to the data quantity of the vector data required to be reserved for the grid vector data, so as to obtain thinned grid vector data.
3. The method of claim 2, wherein thinning each of the grid vector data based on the plurality of computing nodes according to the data amount of the vector data to be reserved for each of the grid vector data, to obtain thinned grid vector data, comprising:
dividing a space region where each grid vector data is located according to the data quantity of the vector data in each grid vector data and the determined node quantity of the computing nodes to obtain a grid vector data region with a one-to-one mapping relation with each computing node;
and thinning each grid vector data in each grid vector data area according to the data quantity of the vector data required to be reserved by each grid vector data according to the calculation node corresponding to the grid vector data area, so as to obtain each thinned grid vector data in the grid vector data area.
4. A method as claimed in claim 3, wherein the method further comprises:
and deleting partial vector data exceeding the grid vector data area in the vector data under the condition that any extracted vector data exceeds the grid vector data area, and obtaining each diluted grid vector data in the grid vector data area.
5. A method as claimed in claim 3, wherein the method further comprises;
and aiming at each grid vector data in the grid vector data area, under the condition that any extracted vector data exceeds the space area where the grid vector data is located and does not exceed the grid vector data area, cutting partial vector data, exceeding the space area where the grid vector data is located, in the vector data to obtain the grid vector data after thinning.
6. The method of claim 5, wherein the method further comprises:
taking partial vector data exceeding the space region where the grid vector data is positioned in the vector data as vector data after cutting;
and reserving the cut vector data in grid vector data corresponding to the space region where the cut vector data is located.
7. The method of claim 1, wherein different pyramid levels differ in the size of map area that can be presented on a display screen of the electronic device;
before slicing each of the thinned grid vector data to generate a preview tile, the method further includes:
writing each diluted grid vector data into a cache;
slicing each of the thinned grid vector data to generate preview tiles, including:
determining whether the target pyramid level is greater than a set pyramid level; if so, determining vector data corresponding to a target map area according to the target map area which can be displayed by the target pyramid level on a display screen of the electronic equipment, and slicing the vector data corresponding to the target map area to generate a preview tile; if not, merging the diluted grid vector data in the cache according to the target pyramid level to obtain diluted grid vector data corresponding to the target pyramid level, and slicing the diluted grid vector data corresponding to the target pyramid level to generate preview tiles.
8. An apparatus for map previewing, the apparatus comprising:
the segmentation module is used for segmenting the map vector data according to the tile distribution information of the set pyramid level to obtain grid vector data with mapping relation of at least one vector tile corresponding to the set pyramid level; the vector tiles are used for the map preview;
the thinning module is used for thinning each grid vector data to obtain thinned grid vector data;
the generation module is used for responding to a map access request aiming at a target pyramid level, and slicing each thinned grid vector data under the condition that the vector tiles are determined to be unfinished in slices, so as to generate preview tiles;
and the preview module is used for completing the preview of the map based on the preview tile.
9. An electronic device, comprising a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are connected with each other through the bus;
the memory stores machine readable instructions, the processor executing the method of any of claims 1 to 7 by invoking the machine readable instructions.
10. A machine-readable storage medium storing machine-readable instructions which, when invoked and executed by a processor, implement the method of any one of claims 1 to 7.
CN202311003437.6A 2023-08-09 2023-08-09 Map preview method and device Pending CN117056626A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311003437.6A CN117056626A (en) 2023-08-09 2023-08-09 Map preview method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311003437.6A CN117056626A (en) 2023-08-09 2023-08-09 Map preview method and device

Publications (1)

Publication Number Publication Date
CN117056626A true CN117056626A (en) 2023-11-14

Family

ID=88663820

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311003437.6A Pending CN117056626A (en) 2023-08-09 2023-08-09 Map preview method and device

Country Status (1)

Country Link
CN (1) CN117056626A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117827915A (en) * 2024-03-01 2024-04-05 昆明麦普空间科技有限公司 Rapid vector slicing system and method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117827915A (en) * 2024-03-01 2024-04-05 昆明麦普空间科技有限公司 Rapid vector slicing system and method

Similar Documents

Publication Publication Date Title
CN110442444B (en) Massive remote sensing image-oriented parallel data access method and system
CN110347499B (en) Method for generating and deploying remote sensing image tiles in real time
CN111862292B (en) Data rendering method and device for transmission line corridor and computer equipment
CN110990516A (en) Map data processing method and device and server
US10803129B2 (en) Method and apparatus for processing online user distribution
CN110990612B (en) Method and terminal for rapidly displaying vector big data
CN114020756B (en) Remote sensing image real-time map service publishing method and device
WO2021218037A1 (en) Target detection method and apparatus, computer device and storage medium
CN114596423A (en) Model rendering method and device based on virtual scene gridding and computer equipment
CN114387289B (en) Semantic segmentation method and device for three-dimensional point cloud of power transmission and distribution overhead line
CN114898357A (en) Defect identification method and device, electronic equipment and computer readable storage medium
CN117056626A (en) Map preview method and device
CN113032509B (en) Map slicing method, device, equipment and medium based on distributed cluster
CN115731442A (en) Image processing method, image processing device, computer equipment and storage medium
CN114840792A (en) Web end epidemic situation distribution visualization system and method based on gridding processing
CN116797747A (en) Underwater detection data visualization method, device, computer equipment and storage medium
CN114168697A (en) Tile data publishing method and device
CN115269600A (en) Airplane data management method and device, electronic equipment and storage medium
CN113763240B (en) Point cloud thumbnail generation method, device, equipment and storage medium
CN114913436A (en) Ground object classification method and device based on multi-scale attention mechanism, electronic equipment and medium
CN112765292A (en) Method for processing shp data by using tile technology
CN116595025B (en) Dynamic updating method, terminal and medium of vector tile
CN117874301B (en) Method for processing, storing and calling pyramid slice based on grid data
CN109241229B (en) Layer multiplexing method and system for internet map display data
CN116310226B (en) Three-dimensional object hierarchical model generation method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination