CN115457226A - Vector map generation method and device, electronic equipment and readable storage medium - Google Patents

Vector map generation method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN115457226A
CN115457226A CN202211165875.8A CN202211165875A CN115457226A CN 115457226 A CN115457226 A CN 115457226A CN 202211165875 A CN202211165875 A CN 202211165875A CN 115457226 A CN115457226 A CN 115457226A
Authority
CN
China
Prior art keywords
map
vector
root
grid
grids
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
CN202211165875.8A
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.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication 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 Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202211165875.8A priority Critical patent/CN115457226A/en
Publication of CN115457226A publication Critical patent/CN115457226A/en
Priority to PCT/CN2023/120472 priority patent/WO2024061327A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/05Geographic models
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • G06T3/4038Scaling the whole image or part thereof for image mosaicing, i.e. plane images composed of plane sub-images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20016Hierarchical, coarse-to-fine, multiscale or multiresolution image processing; Pyramid transform

Abstract

The application discloses a vector map generation method, which belongs to the technical field of vector maps and comprises the following steps: acquiring a root grid set corresponding to the vector data to be sliced based on density distribution information of the vector data to be sliced corresponding to the target area, wherein the root grid set comprises a plurality of root grids, each root grid in the plurality of root grids corresponds to a map level, and the density of the vector data in each root grid is less than or equal to the preset data density; generating a set of target vector map tiles based on the vector data within each root mesh and the respective map hierarchy; and obtaining an area vector map corresponding to the target area based on the target vector map tile set.

Description

Vector map generation method and device, electronic equipment and readable storage medium
Technical Field
The application belongs to the technical field of map processing, and particularly relates to a vector map generation method and device, an electronic device and a readable storage medium.
Background
With the rapid development of the internet, vector maps (i.e., electronic maps) become an indispensable part of people's lives. By slicing the vector map, people can obtain more fine map details, and the existing vector map slicing method generally adopts a pyramid model to slice the vector map in a top-down or bottom-up mode.
However, when vector map slicing is performed in a top-down manner, because the hierarchy of the root grid set is small, the spatial range of the vector map corresponding to a single root grid is large, so that the data volume in the single root grid is too large, and the slicing efficiency of the root grid is lower as the data volume in the root grid is larger, thus the overall slicing efficiency is lower. When vector map slicing is performed in a bottom-up mode, the vector map space range corresponding to a single root grid is large due to the fact that the hierarchy of the root grid set is large, and therefore the number of the root grids in the root grid set is large; the larger the number of root grids is, the more the number of times of calculation of data falling into each root grid is in the whole slicing process, and thus the overall slicing efficiency is seriously affected. It can be seen that the vector map slicing in the related art is inefficient.
Disclosure of Invention
An object of the embodiments of the present application is to provide a vector map generation method, an apparatus, an electronic device, and a readable storage medium, which can solve the problem of low vector map slicing efficiency.
In a first aspect, an embodiment of the present application provides a vector map generation method, where the method includes: acquiring a root grid set corresponding to the vector data to be sliced based on density distribution information of the vector data to be sliced corresponding to the target area, wherein the root grid set comprises a plurality of root grids, each root grid in the plurality of root grids corresponds to a map level, and the density of the vector data in each root grid is less than or equal to the preset data density; generating a set of target vector map tiles based on the vector data within each root grid and the corresponding map hierarchy; and obtaining an area vector map corresponding to the target area based on the target vector map tile set.
In a second aspect, an embodiment of the present application provides an apparatus for generating a vector map, where the apparatus includes: the device comprises an acquisition module and a processing module; the device comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for acquiring a root grid set corresponding to vector data to be sliced based on density distribution information of the vector data to be sliced corresponding to a target area, the root grid set comprises a plurality of root grids, each root grid in the plurality of root grids corresponds to a map level, and the density of the vector data in each root grid is less than or equal to the preset data density; the processing module is used for generating a target vector map tile set based on the vector data in each root grid and the map hierarchy obtained by the corresponding acquisition module; and the processing module is also used for obtaining an area vector map corresponding to the target area based on the target vector map tile set.
In a third aspect, embodiments of the present application provide an electronic device, which includes a processor and a memory, where the memory stores a program or instructions executable on the processor, and the program or instructions, when executed by the processor, implement the steps of the method according to the first aspect.
In a fourth aspect, embodiments of the present application provide a readable storage medium, on which a program or instructions are stored, which when executed by a processor, implement the steps of the method according to the first aspect.
In a fifth aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to execute a program or instructions to implement the method according to the first aspect.
In a sixth aspect, embodiments of the present application provide a computer program product, which is stored in a storage medium and executed by at least one processor to implement the method according to the first aspect.
In the embodiment of the application, a root grid set corresponding to the vector data to be sliced is obtained based on density distribution information of the vector data to be sliced corresponding to a target area, the root grid set comprises a plurality of root grids, each root grid in the plurality of root grids corresponds to one map level, and the density of the vector data in each root grid is less than or equal to the preset data density; generating a set of target vector map tiles based on the vector data within each root grid and the corresponding map hierarchy; and obtaining an area vector map corresponding to the target area based on the target vector map tile set. According to the scheme, the root grid set can be obtained according to the density distribution information of the vector data to be sliced, so that the slicing task can be split more reasonably by the electronic equipment, the density of the vector data in each root grid in the grid set is smaller than the preset data density, the split vector data are sliced in a self-adaptive manner, the efficiency of vector map slicing can be improved, and the efficiency of generating the vector map can be improved.
Drawings
FIG. 1 is a schematic diagram of a pyramid model;
fig. 2 is a flowchart of a vector map generation method according to an embodiment of the present application;
fig. 3 is a schematic diagram of a root grid set in a vector map generation method according to an embodiment of the present application;
fig. 4 is a schematic diagram illustrating a comparison between a top-down slicing manner in the related art and an adaptive vector map slicing manner in the vector map generation method according to the embodiment of the present application;
fig. 5 is a second flowchart of a vector map generation method according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a vector map generating apparatus according to an embodiment of the present application;
fig. 7 is a schematic hardware structure diagram of an electronic device according to an embodiment of the present application;
fig. 8 is a second hardware structure schematic diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments that can be derived by one of ordinary skill in the art from the embodiments given herein are intended to be within the scope of the present disclosure.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application may be practiced in sequences other than those illustrated or described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense and do not limit the number of terms, e.g., the first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
Some terms/nouns referred to in the embodiments of the present application are explained below.
1. Vector map layer: data displayed as a base map in a map, most map layers in a map browsed daily by a mobile phone application program or a browser except a satellite map are vector map layers, such as a street map, a traffic route map, an administrative division map and the like, usually the map layers range from 0 to 18, the 0 th layer is a global range, the smaller the visual field range is when one layer is added, the finer the display effect is, and details of a house building can be seen at the 18 th layer. When a map is browsed, the process of finger amplification or mouse roller amplification is the process of loading and displaying a higher-level layer.
2. Vector tile: the basic display units forming the vector map layer are obtained by slicing the vector map, and the vector map layer is formed by splicing vector tile units according to the spatial position sequence.
The lower the level to which a vector tile corresponds, the larger the spatial extent represented by a single vector tile, and the more data that may be contained.
3. Vector map slicing: the process of segmenting the geographic vector data according to a certain space division rule (such as longitude and latitude grids) and distributing the data falling in the same grid unit range together to form a vector tile unit is the vector map slicing. Vector tiles of different levels can be obtained by slicing the vector map, the quantity of the tiles of the global range on the 0 th layer is 1, the tiles of the 0 th layer on the 1 st layer are divided into 4 parts equally, the pixel size of each tile is unchanged, but the represented space range is smaller, the display effect is finer, the n +1 th layer of tiles are obtained by dividing each tile of the n th layer equally by analogy, the quantity is 4 times of that of the n layer, and finally all the tiles of all the levels are obtained by slicing.
4. Grid or grid cell: each grid may correspond to a spatial extent and a map level. The larger the map level corresponding to the grid is, the smaller the spatial range corresponding to the grid is.
For example, as shown in fig. 1, the spatial range corresponding to each (n + 1) th grid includes the spatial ranges corresponding to the 4 (n + 1) th grids, and the spatial range corresponding to each (n + 1) th grid includes the spatial ranges corresponding to the 4 (n + 2) th grids.
The vector map generation method, the vector map generation device, the electronic device, and the readable storage medium according to the embodiments of the present application are described in detail below with reference to the accompanying drawings.
The vector map generation method provided by the embodiment of the application is applied to a scene of generating the vector map corresponding to the area or the space range based on the vector data corresponding to the area or the space range, so as to solve the problem of low efficiency of generating the vector map.
The geographic vector data used by the vector map slice is usually stored in a corresponding server, and when one device needs to generate a vector map of a corresponding geographic area, the geographic vector data may be first acquired from the server through network transmission (Input/Output, IO).
The existing vector map slicing method generally slices the vector map in a top-down or bottom-up manner by using a pyramid model. For example, as shown in FIG. 1, in the pyramid model, the spatial extent of the tile at the previous level is equal to the set of spatial extents of the four tiles at the next level. Take the 5-18 level map level slicing requirements as an example:
in a top-down slicing mode, a corresponding 5-level grid set can be calculated based on the spatial range of vector data to serve as a root grid set, vector data falling into each 5-level grid are obtained, and the vector data are converted into 5-level tiles respectively; then, dividing each 5-level grid equally according to the spatial range to respectively obtain 4 6-level grids, and obtaining corresponding 6-level tiles based on the 6-level grids; and equally dividing the 6-level grids to obtain 7-level grids, obtaining corresponding 7-level tiles based on the 7-level grids, and repeating the steps to obtain 18-level tiles.
In a bottom-up slicing mode, a corresponding 18-level grid set can be calculated according to the space range of vector data to serve as a root grid set, and each data in the vector data set to be sliced is induced into the corresponding 18-level grid to obtain 18-level tiles; and aggregating every four tiles of 18 levels together according to spatial distribution to obtain tiles of 17 levels, and repeating the steps to obtain tiles of 5 levels finally. It should be noted that the "tile" herein, i.e., the "vector tile", has the same meaning and may be interchanged.
As can be seen from the above description, in the related art, the vector map slices are uniformly sliced from a certain level. That is, vector data in each grid corresponding to the same map level are sequentially transmitted to the device, and then after the device completes reception of vector data in one grid, vector map slicing can be performed based on the vector data to obtain corresponding vector tiles. However, because the map levels corresponding to the grids are the same, and the data amount contained in the maps of the same level is not necessarily the same, the data amount of the vector data in some grids may exceed the carrying capacity of the slicing program, thereby causing the vector map slicing failure. It can be seen that the slicing method in the related art is only suitable for scenes with small vector data or more uniform distribution.
Furthermore, since all data in each grid are completely transmitted and stored in the memory or disk of the device, the device can slice based on all data in each grid; the vector data in the corresponding grid can be released or deleted from the memory only after the slicing is completed, so that the vector data in the grid always exists in the memory of the device in the process of transmitting the vector data in the grid to the vector tile corresponding to the vector data in the grid, which may cause the memory occupation to be too high, thereby further reducing the vector efficiency.
The vector map generation method provided by the embodiment of the application can solve the problem of map vector map slicing under the conditions of large range and large data volume.
After a user specifies a required tile level range (for example, a preset map level set) and vector data to be sliced, the embodiment of the present application can adaptively select and select grids of different map levels as a root grid in a corresponding spatial range according to distribution density information of the vector data, that is, the map levels corresponding to the root grids in a root grid set are not unified any more. Therefore, the problem that the slicing efficiency of the vector map is low due to the fact that the data size in a single root grid is too large can be solved, and the slicing efficiency can be improved.
In particular, the present application introduces an adaptive slicing threshold (i.e., threshold data density). Based on the self-adaptive segmentation threshold, performing data evaluation on vector data to be sliced, and determining an optimal subdivision root grid set according to an evaluation result, so that IO (input/output) resources and the memory of equipment can be reasonably utilized, and the computing resources of the equipment are fully utilized; when the slicing speed is increased, the memory occupation is reduced, the slicing efficiency is further improved, and the slicing failure risk is reduced.
Optionally, the self-adaptive segmentation threshold can be flexibly changed or specified according to the type (city, suburb, desert) of the task to be segmented, the data volume, the segmentation requirement and the like, can adapt to vector map segmentation of different scenes and requirements, and is wide in application range.
The mesh segmentation in the vector map generation method provided in the embodiment of the present application may be 4 equal divisions (quadtree slicing, that is, a rectangular mesh is divided into four rectangular meshes having the same size and shape) of the pyramid model to be used, and may also be any form of equal division which is suitable for any parent mesh and can be exactly divided by a child mesh.
The vector map generation method provided by the embodiment of the application is suitable for various vector slicing processes such as single-thread, multi-thread or distributed.
The embodiment of the present application provides a vector map generation method, and fig. 2 shows a flowchart of the vector map generation method provided in the embodiment of the present application, and as shown in fig. 2, the vector map generation method provided in the embodiment of the present application may include steps 201 to 203 described below. The following description will be made by taking as an example the case where the vector map generating apparatus executes the method.
Step 201, the vector map generation device obtains a root grid set corresponding to the vector data to be sliced based on the density distribution information of the vector data to be sliced corresponding to the target area.
In this embodiment, the root grid set may include a plurality of root grids, each root grid in the plurality of root grids corresponds to one map level, and the vector data density in each root grid is less than or equal to the preset data density.
Alternatively, the vector map generating apparatus may be a server or a terminal.
It is to be understood that, in order to satisfy "the vector data density in each root mesh is less than or equal to the threshold data density", the map levels corresponding to different root meshes in the above root meshes may be different; that is, the root grid set includes a root grid corresponding to at least one map level.
For example, as shown in fig. 3, the root grid set includes root grids corresponding to 3 map levels, where the 3 map levels are a map level a, b, and c, respectively, and a < b < c. It can be seen that, in the root grid set shown in fig. 3, the vector map spatial range corresponding to the root grid corresponding to the map level a is the largest, and the vector map spatial range corresponding to the root grid corresponding to the map level b is the smallest.
In the embodiment of the present application, in the subsequent map vector map slicing process, the vector map generation apparatus may perform vector map slicing from top to bottom with each root grid in the root grid set as a unit. I.e. the root mesh is the basic unit for vector map slicing.
Alternatively, the preset data density may be determined according to any one of the following: determining according to configuration information of the equipment and an evaluation result of a task to be sliced, which is also called as manual designation; determining according to the vector data to be sliced and the target quantity, also called algorithm-based designation; wherein the target number is: the number of initial grids corresponding to the vector data to be sliced. This may improve the flexibility of determining the preset data density.
For example, an average vector data may be determined by a ratio of the vector data to be sliced to the target number, and the average vector data may be used as the preset data density.
Alternatively, the step 201 may be specifically realized by the following steps 201a to 201 c.
Step 201a, a vector map generating device acquires an initial grid set corresponding to vector data to be sliced and vector data in each initial grid in the initial grid set.
Wherein each initial mesh corresponds to a first map level. It can be seen that the map levels corresponding to the initial grids in the initial grid set are the same; namely, the space ranges of the vector maps corresponding to different initial grids are the same.
Optionally, the first map level is determined by one of: randomly assigning; determined by the geographic parameters of the target area. Wherein the geographic parameter of the target area may include at least one of: a difference in longitude of the target area, and a difference in latitude of the target area.
Alternatively, the above step 201a may be implemented by the following steps a) to c).
Step a), the vector map generating device can obtain the total space range of the projected vector data to be sliced, and the total space range can represent the space range of the target area.
And step b), the vector map generating device acquires an initial grid set based on the total space range.
Specifically, in one mode, a reasonable map level w is randomly specified, wherein w belongs to [0,30], and is a positive integer, and the minimum grids required when all the grids cover the total space range under the level are calculated and are used as a root grid set.
In another mode, the longitude difference and the latitude difference of the total spatial range are calculated according to the total spatial range, the level where the grid meeting the first rule is located is found according to the longitude difference or the latitude difference, and the minimum grid required by the total spatial range under the level is calculated to serve as the root grid set.
Wherein the first rule may include: the mesh where the warp or weft difference (or the warp and weft differences) and the warp or weft difference (or the warp and weft differences) of the total spatial range are closest or the next closest mesh, and the like, are any rules that are advantageous for determining the map hierarchy.
And c), using the vector data in the space range corresponding to each initial grid in the vector data to be sliced by the vector map generating device as the vector data corresponding to the initial grid.
Step 201b, the vector map generation device divides the vector data in the target initial grid based on the density distribution information of the vector data to be sliced, so as to obtain a plurality of first grids of the next map level of the target initial grid.
The target initial grid is the initial grid in the initial grid set, wherein the density of the vector data is larger than the preset data density.
In this embodiment, the vector map generating device may first obtain a vector data density in an initial mesh, and if the vector data density is greater than a preset data density, equally divide the vector data in the initial mesh to obtain a plurality of first meshes of a next map level of the initial mesh.
For example, the vector map generation means may divide the vector data in the initial mesh into 4 pieces equally, resulting in 4 first meshes.
In the embodiment of the present application, the data distribution density in the initial grid may be represented by the number of vector data in the corresponding initial grid.
A method of acquiring the amount of vector data within the initial mesh is explained below.
In one mode, the number of vector data falling within the spatial range corresponding to each initial grid is queried and counted;
in one approach, the data storage size of the vector data falling within the spatial range corresponding to each initial grid is queried and counted;
in one mode, vector data to be sliced are sampled according to a certain rule, and the number of samples falling in each initial grid is calculated;
in one approach, the vector data to be sliced is sampled according to a certain rule, and the data storage size of the sample in each root grid is calculated.
Alternatively, when estimating the vector data density in the initial grid by sampling, the sampling ratio may be determined first, and then the sampling ratio is set to the actual sampled data amount in each initial grid, and the obtained value is used as the final data amount of the grid.
Step 201c, if the density of the vector data in the target first mesh in the multiple first meshes is greater than the preset data density, the vector map generation device may continue to segment the vector data in the target first mesh until the density of the vector data in all the meshes obtained after the segmentation is less than or equal to the preset data density, so as to obtain the root mesh set.
In this embodiment, the root grid set may include: and the mesh obtained after the first mesh of each target is segmented and other initial meshes except the target initial mesh in the initial mesh set.
It should be noted that the number of the target first grids is determined according to the density distribution information of the vector data to be sliced.
In practical implementation, in step 201b and step 201c, the vector map generation device may delete a mesh from the initial mesh and add the mesh obtained by the division to the initial mesh set after dividing the data in the mesh. In this way, the final initial grid set can be used as the root grid set.
The vector map generation method provided in the embodiments of the present application is exemplarily described below with reference to specific examples.
Illustratively, assume that the initial grid set includes 3 initial grids corresponding to map level 2, respectively: grid 1 to grid 3, if the vector data density in grid 1 is greater than the threshold data density, then: the vector map generation device may equally divide the vector data in the grid 1 according to the spatial position, that is, divide the grid 1 into 4 grids at the next map level of the grid 1, which are: grid 4-grid 7, and grid 4-grid 7 all correspond to map level 3; if the density of the vector data in the grid 7 is still greater than the threshold data density, the vector map generation apparatus may average the vector data in the grid 7 according to the spatial position, that is, divide the grid 7 into 4 grids at the next map level of the grid 7, which are: grid 8-grid 11, and grid 8-grid 11 all correspond to map level 4. If the vector data densities in grid 8-grid 11 are all less than or equal to the preset data density, it may be determined that the root grid set includes: grid 2, grid 3, grids 4-6, and grids 8-11. As can be seen, the root grid set includes grids at 3 map levels.
Optionally, assuming that an upper limit map level in the preset map level set is an upper limit map level j, after the vector map generation device obtains the root grid set, the vector map generation device may further determine a relationship between a map level corresponding to each root grid and the upper limit map level j. Taking a root grid in the root grid set as an example, if a map level n corresponding to the root grid is greater than a map level j, a spatial range corresponding to the root grid and a spatial range adjacent to the root grid and corresponding to at least one root grid of the map level n need to be aggregated to obtain a parent grid a of the root grid corresponding to the map level (n-1), where the parent grid a includes vector data in the root grid and vector data in the at least one root grid.
Then, the vector data density 1 in the parent mesh a is acquired, and the relationship between the vector data density 1 and the preset data density is determined. If the vector data density 1 is greater than the preset data density, the root grid set is kept unchanged. If the vector data density 1 is less than or equal to the preset data density, deleting the root grids participating in aggregation from the root grid set, and adding the parent grid a to the root grid set; and aggregating to obtain a parent grid b of a corresponding map level (m-2) of the parent grid a in a corresponding manner, and judging the relation between the vector data density 2 in the parent grid b and the preset data density. If the vector data density 2 is greater than the preset data density, keeping the root grid set unchanged; if the density 2 of the vector data is less than or equal to the preset data density, deleting all grids participating in aggregation from the root grid set, adding the parent grid b to the root grid set, and so on until the density of the vector data in the parent grid c corresponding to the map level (m-w) obtained by aggregation is greater than the preset data density, adding the child grids corresponding to the map level (m-w + 1) of the parent grid c to the root grid set, and deleting all grids participating in aggregation of the child grids from the root grid set. Therefore, the phenomenon that the number of the root grids is too large can be avoided, and the vector map slicing efficiency can be further improved.
In practical implementation, the vector map generating device may determine whether each initial mesh in the initial mesh set needs to be aggregated based on the mesh aggregation manner, directly after acquiring the initial mesh set. And after the initial mesh aggregation for aggregating the requirements of the initial mesh set is completed, performing the step 101ab and the step 101c.
Optionally, the preset map level set may include a continuous map level range, and the map level set may be: [ i, j ], i < j, and i and j are positive integers. Alternatively, the preset map level set may include a plurality of discrete map levels, such as map level 1, map level 3, map level 8, and map level 10. Alternatively, the preset map level set may include at least two discrete map level ranges, such as: [1,5] and [7, 13].
Step 202, the vector map generation means generates a set of target vector map tiles based on the vector data within each root mesh and the corresponding map hierarchy.
In this embodiment of the present application, the vector map generation device may perform vector map slicing processing on each root grid according to the vector data in each root grid and the corresponding map hierarchy, so as to obtain vector map tiles of all required hierarchies in the corresponding spatial range. Then, for a root mesh whose map level corresponding to the root mesh is greater than the lower-limit map level of the required tile level set, the vector map generation apparatus may continue to obtain the required vector map tiles of all map levels by aggregating the obtained respective vector tiles. Therefore, the situation that the data density of the vector data to be sliced is large can be better coped with. Details will be described in the following examples.
Possible implementation mode
Optionally, for one of the root grids in the root grid set, in a case that the map level n corresponding to the one root grid satisfies the first condition, the step 202 may include the following steps A1 to A2. Wherein the first condition comprises: the map level corresponding to the root grid is greater than a lower limit map level i in the preset map level set and less than an upper limit map level j in the preset map level set, and i, j and n are positive integers.
Step A1, a vector map generation device converts vector data in one root grid into a vector map tile corresponding to the root grid.
In the embodiment of the present application, it is assumed that one root grid corresponds to a map level n, and the vector map tile corresponding to the root grid also corresponds to the map level n. That is, if a vector map tile corresponds to a grid, the vector map tile corresponds to the same map level as the grid.
A2, a vector map generation device divides vector data in one root grid until a plurality of second grids corresponding to a map level f of the root grid are obtained through division; converting the vector data in the second grids into a plurality of vector map tiles corresponding to the second grids one by one until converting the vector data in the third grids into a plurality of vector map tiles corresponding to the third grids one by one;
wherein the plurality of third meshes may include all meshes of one root mesh corresponding to the upper limit map level j.
In this embodiment of the present application, the set of target vector map tiles may include: the map tiles may include a vector map tile corresponding to one root grid, a plurality of vector map tiles corresponding one-to-one to the plurality of second grids, and a plurality of vector map tiles corresponding one-to-one to the plurality of third grids. The map level f is the map level with the minimum difference with the map level n in the preset map level set, n, i, j and f are positive integers, and i is more than or equal to n and less than or equal to f and less than or equal to j. That is, all the vector tiles obtained in step A1 and step A2 may be included in the target vector map tile set.
In the embodiment of the present application, the release time of the vector data in the multiple third grids is determined by the first time, which is the time for obtaining the multiple vector map tiles corresponding to the multiple third grids one to one.
In this embodiment, the vector data in each second grid may be converted into a vector map tile corresponding to map level f, that is, each second grid corresponds to a vector map tile corresponding to map level f. Accordingly, the vector data in each third mesh may be converted into a vector map tile corresponding to the upper limit map level j, i.e., a vector map tile corresponding to the upper limit map level j in each third mesh.
In the embodiment of the present application, the "release time of the vector data in the plurality of third grids is determined by the first time" may be understood as: the vector map generating device releases the vector data in the plurality of third grids at a first time, namely the release time of the vector data in the plurality of third grids is the same as the first time; or the vector map generating device releases the vector data in the multiple third grids after a preset time length after the first time, that is, the release time of the vector data in the multiple third grids = the first time + the preset time length.
In the embodiment of the present application, the vector map generation apparatus may release vector data in a plurality of third grids as follows: the vector map generation device deletes the vector data in the plurality of third grids from the memory or the disk, so as to avoid the influence on the slicing processing efficiency of the vector data in the subsequent root grid due to the fact that the vector data occupy too much memory.
The vector map generation device may perform the above-described steps A1 to A2 on all the root grids whose root grid centralized map level satisfies the first condition.
One possible implementation is illustrated below.
Illustratively, assume that the preset map hierarchy includes: map level range [1,8], i.e., i =1, j =8, then: if the map level n =5 for one root mesh in the set of root meshes, the vector data in the root mesh in the map level 5 is converted into a vector map tile corresponding to the root mesh. Then, the vector data in the root mesh is divided to obtain a plurality of meshes 1 corresponding to the map level 6 (i.e., the map level f) of the root mesh, and the vector data in the plurality of meshes 1 is converted into a plurality of vector map tiles corresponding to the plurality of meshes 1 one to one. The vector data in each grid 1 is divided to obtain a plurality of grids 2 corresponding to the map levels 7 of each grid 1, and the vector data in the grids 2 are respectively converted into a plurality of vector map tiles corresponding to the grids 2 one by one. The vector data in each grid 2 is then divided to obtain a plurality of grids 3 corresponding to the map levels 8 of each grid 2, and the vector data in the plurality of grids 3 is converted into a plurality of vector map tiles corresponding to the plurality of grids 3 one to one. At this time, the vector map generating means may release the vector data within the plurality of meshes 3, that is, the first time is the same as the second time. It should be noted that the set of target vector map tiles may include: a vector map tile corresponding to the root grid, a plurality of vector map tiles corresponding one-to-one to the plurality of grids 1, a plurality of vector map tiles corresponding one-to-one to the plurality of grids 2, and a plurality of vector map tiles corresponding one-to-one to the plurality of grids 3.
For all the root grids in the root grid set whose map levels are greater than or equal to 1 and less than 8, vector map slicing processing may be performed according to the above-described exemplary method, and details are not described here again to avoid repetition.
Therefore, the vector data in each root grid can be sliced by taking the root grid as a unit, and the vector data completing the slicing task can be released in time, so that the occupation of the memory can be reduced, and the slicing efficiency can be improved.
Another possible implementation
Optionally, for one of the root grids in the root grid set, in a case that the map level n corresponding to the one root grid satisfies the second condition, the step 202 may include the following steps B1 to B2. Wherein the second condition comprises: the map level corresponding to the root grid is smaller than a lower-limit map level i in a preset map level set, i and n are positive integers, and n is smaller than i.
B1, a vector map generation device divides vector data in one root grid until a plurality of fourth grids corresponding to a lower limit map level i of the root grid are obtained through division; and converting the vector data in the plurality of fourth grids into a plurality of vector map tiles in one-to-one correspondence with the plurality of fourth grids.
Step B2, the vector map generation device divides the vector data in the fourth grids respectively until a plurality of fifth grids corresponding to the map hierarchy g of one root grid are obtained; and vector data in the plurality of fifth grids and the plurality of vector map tiles corresponding to the plurality of fifth grids one to one are converted into a plurality of vector map tiles corresponding to the plurality of third grids one to one.
The plurality of third grids may include all grids corresponding to the upper limit map level j of one root grid, the map level g is a map level with the smallest difference with the lower limit map level i in a preset map level set, g is a positive integer, n is greater than i and less than g and less than j, and n, i, g and j are positive integers.
The set of target vector map tiles may include: a plurality of vector map tiles in one-to-one correspondence with the plurality of fourth grids, a plurality of vector map tiles in one-to-one correspondence with the plurality of fifth grids, and a plurality of vector map tiles in one-to-one correspondence with the plurality of third grids.
In this embodiment of the present application, the release time of the vector data in the plurality of third grids is determined by a first time, where the first time is a time for obtaining the plurality of vector map tiles corresponding to the plurality of third grids one to one. For other descriptions of the release times of the vector data in the multiple third grids, reference is made to the related description of the release times of the vector data in the multiple third grids in the above possible implementation manner.
The vector map generation device may perform the above-described steps B1 to B2 on all root cells whose root cell concentration map hierarchy satisfies the second condition.
Another possible implementation is exemplarily described below.
Illustratively, assume that the preset map hierarchy includes: map level range [5,7], i.e., i =5,j =7, then: if one root grid corresponds to the map level n =3, the vector data in the root grid can be divided to obtain a plurality of grids corresponding to the map level 4 of the root grid; dividing the vector data in each grid of the multiple grids respectively to obtain multiple grids 4 of the root grid corresponding to the map level 5, namely the multiple fourth grids; and converts the vector data within the plurality of grids 4 into a plurality of vector map tiles in one-to-one correspondence with the plurality of grids 4. The vector data in each of the plurality of grids 4 is divided to obtain a plurality of grids 5 corresponding to the map level 6 (i.e., the map level g) of the root grid, and the vector data in the plurality of grids 5 is converted into a plurality of vector map tiles corresponding to the plurality of grids 5 one to one. The vector data in each grid 5 of the multiple grids 5 is divided to obtain multiple grids 6 of the map level 7 corresponding to each grid, and the vector data in the multiple grids 6 is converted into multiple vector map tiles corresponding to the multiple grids 6 one by one. It should be noted that the set of target vector map tiles may include: a plurality of vector map tiles corresponding one-to-one to the plurality of grids 4, a plurality of vector map tiles corresponding one-to-one to the plurality of grids 5, and a plurality of vector map tiles corresponding one-to-one to the plurality of grids 6.
All root grids with a map level less than 5 in the root grid set can be processed according to the above exemplary method, and are not described herein again in order to avoid repetition.
For other descriptions of another possible implementation, reference may be made to the related description in the above one possible implementation, and details are not repeated here to avoid repetition.
Therefore, the vector data in each root grid can be sliced by taking the root grid as a unit, and the vector data completing the slicing task can be released in time, so that the occupation of the memory can be reduced, and the slicing efficiency can be improved.
Further, when the map level corresponding to the root grid is smaller than the lower-limit map level in the preset map level set, vector data in the root grid can be directly segmented at least once to obtain a plurality of fourth grids of the root grid corresponding to the lower-limit map level, and then slicing processing is performed on the basis of the vector data in the fourth grids, namely, vector tiles between the map level n and the lower-limit map level do not need to be generated; therefore, the vector tiles of all map levels in the preset map level set corresponding to the root grid can be obtained, and the time length of vector map slicing can be further reduced. This may further improve vector map slicing efficiency.
Yet another possible implementation
Optionally, for one root mesh in the root mesh set, in a case that the map level n corresponding to the root mesh satisfies the third condition, the step 202 may include the following step C1. Wherein the third condition comprises: the map level corresponding to the root grid is greater than or equal to an upper line upper limit map level j in a preset map level set, n and j are positive integers, and n is greater than or equal to j.
And step C1, the vector map generation device converts the vector data in one root grid into a vector map tile corresponding to the root grid.
Wherein, the target vector map tile set comprises: a vector map tile corresponding to a root grid; the release time of vector data within one root grid is determined by the time at which the vector map tile corresponding to one root grid is obtained. For other descriptions of the release time of the vector data in the root grid, reference may be specifically made to the related description of "release times of vector data in multiple third grids" in the above possible implementation manner.
The vector map generation device may perform step C1 described above for each of all the root grids whose root grid centralized map level satisfies the third condition.
Yet another possible implementation is exemplarily described below.
Illustratively, assume that the preset map hierarchy set includes: layer level range [5,8], i.e., i =5,j =8, then: if one root grid corresponds to map level n =10, the vector data within each root grid in map level 10 may be converted into vector map tiles corresponding to map level 10. The vector data within the root mesh is then released.
It will be appreciated that the vector map tile in yet another possible implementation described above is used to: and obtaining the vector map tiles of the corresponding map levels in the preset map level set in a tile aggregation mode.
For other descriptions of another possible implementation, reference may be made to the related description in the above one possible implementation, and details are not repeated here to avoid repetition.
In this way, when the map level n corresponding to one root grid is greater than the upper limit map level in the preset map level set, the vector data in the root grid can be directly converted into the vector map tiles, so that the vector map generation device can obtain the vector map tiles corresponding to the corresponding parent grids of the root grid in a tile aggregation manner; therefore, the vector map tiles corresponding to the corresponding parent grids do not need to be obtained through conversion based on the vector data in the corresponding parent grids, and therefore the situation that the time consumption of vector map slicing is long or the vector map slicing fails due to the fact that the vector data in the grids are too large can be avoided.
Further, when the vector data in the parent grid is large, the vector map tiles corresponding to the parent grid do not need to be read to obtain all data in the grid, and the lightweight child vector map tiles corresponding to the parent grid are directly aggregated to obtain the vector map tiles, so that the possibility of memory overflow and IO transmission timeout can be reduced, and the system robustness is increased.
It should be noted that, after the vector map generating device performs the vector map slicing process on the vector data in one root mesh in the root mesh set according to the one possible implementation manner, the another possible implementation manner, or the yet another possible implementation manner, the vector map generating device may continue to perform the corresponding vector map slicing process on the vector data in the next root mesh in the root mesh set until the vector map slicing process on the vector data in the last root mesh in the root mesh set is completed.
It will be appreciated that the three possible implementations described above are by fetching the corresponding vector map tiles in a top-down manner.
Alternatively, after the vector map generation apparatus completes the release of the vector data of all the meshes in the root mesh set, the above step 202 may further include the following step D1 and step D2.
Step D1, if the map level n corresponding to one root grid is greater than the lower limit map level i, the vector map generation device aggregates vector map tiles corresponding to at least two first root grids to obtain first vector map tiles corresponding to a first parent grid; and replacing at least two first root grids in the root grid set with first parent grids. Wherein the at least two first root meshes comprise: the one root mesh, the first parent mesh is a parent mesh of a corresponding map level (n-1) of the one root mesh.
D2, if the map level (n-1) is greater than the lower limit map level i, the vector map generation device aggregates the vector map tiles corresponding to the at least two second parent grids to obtain second vector map tiles corresponding to a second parent grid; and replacing the at least two second root grids in the root grid set with second parent grids until a vector map tile corresponding to a third parent grid is obtained through aggregation. The at least two second root grids comprise a first father grid, the second father grid is a father grid of a map level (n-2) corresponding to the root grid, and the third father grid is a father grid of a lower limit map level i corresponding to the root grid.
It is to be understood that the above steps D1 and D2 may be performed after the above three possible implementations, i.e. after the electronic device has finished releasing the vector data of all grids in the root grid set.
Alternatively, the vector map generation device may determine the relationship between the maximum map level and the lower limit map level i corresponding to the root mesh set after performing vector map slicing processing on all the root meshes in the root mesh set. If the maximum map level is less than or equal to the lower limit map level i, the vector map generation apparatus may determine that the map slicing is finished, that is, it means that all vector map tiles required for generating the vector map corresponding to the target area can be obtained in a top-down slicing manner. If the maximum map level is greater than the lower limit map level i, the vector map generation device may find a root mesh in the root mesh set, where the map level is greater than the lower limit map level i, and perform the above-described steps D1 and D2 on the found root mesh.
The following exemplarily describes the steps D1 and D2.
Exemplarily, it is assumed that the lower limit map level i =4 in the preset map level set, and it is further assumed that the root grid 1 in the root grid set corresponds to the map level 6, the parent grid of the root grid 1 corresponding to the map level 5 is grid a, and other child grids of grid a corresponding to the map level 6 include those of the root grid set corresponding to the map level 6: root grid 2, root grid 3, and root grid 4, then: after the vector map generation device performs vector map slicing processing on all root grids in the root grid set, the vector map generation device may aggregate the vector map tile corresponding to the root grid 1, the vector map tile corresponding to the root grid 2, the vector map tile corresponding to the root grid 3, and the vector map tile corresponding to the root grid 4 to obtain the vector map tile corresponding to grid a. And replacing the root grid 1 to the root grid 4 in the root grid set with grid a.
Further, assume that the parent grid of grid a corresponding to map level 4 is grid B, and the other child grids of grid B corresponding to map level 5 include the parent grid of the corresponding map level 4 in the root grid set: root mesh 5, root mesh 6, and root mesh 7, then: because map level 5 corresponding to grid a is greater than 4, the vector map generation device can aggregate the vector map tile corresponding to grid a, the vector map tile corresponding to root grid 5, the vector map tile corresponding to root grid 6, and the vector map tile corresponding to root grid 7 to obtain the vector map tile corresponding to grid B; and replacing the root mesh 5 to the root mesh 7 in the root mesh set and the mesh a with the mesh B.
Then, the vector map generation device may continue to determine whether the root grid set includes a root grid whose corresponding map level is smaller than the lower limit map level i, and if so, aggregate the corresponding vector map tiles until the map levels corresponding to all the root grids in the root grid set are greater than or equal to the lower limit map level i.
It can be seen that steps D1 and D2 are obtained by bottom-up approach to the corresponding vector map tiles.
It should be noted that the target vector map tile set may further include vector map tiles obtained in step D1 and step D2.
Therefore, when the root grid set comprises the root grids of which the map levels are greater than the lower limit map level in the preset map level set, the vector map tiles corresponding to the corresponding root grids can be directly aggregated to obtain the vector map tiles of the required map level, and the vector map tiles of the required map level are not required to be obtained in a mode of reading all data in the corresponding grids, so that the overtime of network transmission can be avoided, the memory overflow is reduced, and the slicing efficiency of the vector map can be improved.
It should be noted that, the process of generating the target vector map tile set based on the vector data in each root mesh and the corresponding map hierarchy may also be referred to as a process of adaptive vector map slicing.
The following compares a top-down slicing method in the related art with an adaptive vector map slicing method in the embodiment of the present application with reference to the drawings. As shown in fig. 4, (a) in fig. 4 is a schematic diagram of slicing efficiency and memory occupation corresponding to a top-down slicing manner in the related art, and (b) in fig. 4 is a schematic diagram of slicing efficiency and memory occupation corresponding to a slicing manner of an adaptive vector map in the embodiment of the present application.
Wherein, the length of each box in the row corresponding to "IO" in fig. 4 represents: the transmission of vector data within one root mesh is time consuming. The length of each filled box in the row corresponding to "CPU" in fig. 4 represents: the spatial duration of a processing unit of the vector map generation device; the length of each blank box in the row corresponding to "CPU" indicates: a processing duration of vector data within a root mesh; the total length of all blank boxes in the row corresponding to "CPU" indicates: the total time length of the processing unit for processing data in the slicing mode is corresponded. The different blank boxes in the rows corresponding to "IO" and "CPU" in FIG. 4 represent different root grids. The "memory" in fig. 4 corresponds to the values: the vector data occupies the memory in unit time, and the larger the number is, the larger the occupation of the memory is.
As can be seen from fig. 4, compared with the related art, in the present application, transmission of vector data in each root grid is less time-consuming, idle length of a processing unit of the vector map generation apparatus in the whole slicing process is less, and memory occupation time and occupation amount of the vector data in each root grid to the vector map generation apparatus are less. Therefore, the adaptive vector map slicing method provided by the embodiment of the application can more reasonably utilize various resources, such as computing resources, of the vector map generation device.
Therefore, as can be seen from fig. 4, compared with the related art, in the adaptive vector map slicing method in the embodiment of the present application, under the condition of a large data volume and a large space range, the memory occupation in the slicing process is significantly reduced, and the slicing efficiency is improved by about one third.
And step 203, the vector map generation device obtains an area vector map corresponding to the target area based on the target vector map tile set.
Optionally, it is assumed that a preset map level set corresponding to the vector data to be sliced includes M map levels, where M is an integer greater than 1. The step 203 can be specifically realized by the step 203a described below.
And 203a, splicing the vector tiles corresponding to the same map level in the target vector map tile set by the vector map generation device based on the M map levels to obtain M map layers.
Specifically, assume that the M map levels include: map level 3 and map level 4, and the set of target vector map tiles includes: vector map tiles corresponding to map level 3, vector map tiles corresponding to map level 4, and vector map tiles corresponding to map level 5, then: the vector map generation device may splice vector map tiles corresponding to map level 3 into map layer 3, and splice vector map tiles corresponding to map level 4 into map layer 4. It can be seen that the vector map tiles for the corresponding map level 5 are only used to participate in the aggregation of the respective vector map tiles for the corresponding map level 4, i.e. the vector map tiles for the corresponding map level 5 belong to intermediate quantities.
And step 203b, the vector map generating device obtains an area vector map corresponding to the target area based on the M map layers.
Alternatively, the vector map generation device may arrange or combine the M map layers in an order in which the map levels sequentially increase, so as to obtain the area vector map corresponding to the target area. Alternatively, the vector map generation device may arrange or combine the M map layers in order of decreasing map levels in order to obtain the area vector map corresponding to the target area.
In the vector map generation method provided by the embodiment of the application, because the root grid set can be obtained according to the density distribution information of the vector data to be sliced, the electronic device can split the slicing task more reasonably, so that the density of the vector data in each root grid in the grid set is smaller than the preset data density, and the split vector data is adaptively split and sliced, so that the efficiency of slicing the vector map can be improved, and the efficiency of generating the vector map can be improved.
Optionally, the vector map generating apparatus may perform step 201 after receiving a vector map request, where the vector map request is used to request an area vector map corresponding to the target area, and the vector map request may include an identifier indicating the target area and a preset map hierarchy set.
Optionally, after obtaining the area vector map corresponding to the target area, the vector map generating device may send the area vector map to the target terminal, so that the target terminal may output the area vector corresponding to the target area after receiving the target vector map tile set; the target terminal is a terminal, such as a mobile phone, that sends the vector map request. Alternatively, the vector map generation device may obtain the area vector map corresponding to the target area and then output the area vector map as it is.
Certainly, in actual implementation, the vector map generating apparatus may also directly send the target vector map tile set to the target terminal, so that after receiving the target vector map tile set, the target terminal obtains and outputs the area vector map corresponding to the target area based on the target vector map tile set.
The following describes an exemplary vector map generation method provided in the embodiments of the present application with reference to the drawings.
The following "hierarchy" refers to "map hierarchy", both of which have the same meaning and are interchangeable; the following "tiles" are all referred to as "vector map tiles", and they are identical in meaning and interchangeable.
The embodiment of the application provides a high-efficiency vector map generation method, which aims to solve the problem of low slicing efficiency of the vector map under the conditions of large range and large data volume. The method can be described in general terms as: after a user specifies a required map level set (namely a preset map level set) and vector data to be sliced, the method can adaptively obtain the data density of the root grid set according to the data range and the data quantity, and further select grids of different levels as root grids in a corresponding space range (namely a space range corresponding to a target area). And then, segmenting each root grid according to a top-down mode to obtain all the tiles of the required levels in the space range. If the level of the root grid (namely, the map level corresponding to the root grid) is greater than the minimum level (namely, the lower limit map level) of the required tile level range, the tiles corresponding to the corresponding root grid are aggregated to obtain all the tiles of each tile level in the tile level range, so as to better cope with the condition of large data volume. Through the steps, IO, computing resources and memory can be efficiently utilized, slicing efficiency is improved, and risk of slicing failure is reduced.
Illustratively, as shown in fig. 5, the vector map generation method provided by the embodiment of the present application may include steps 501 to 508 described below.
And 501, acquiring a root grid set.
In the embodiment of the application, in the subsequent map slicing process, each root grid in the root grid set can be used as a unit to be sliced from top to bottom.
Alternatively, step 501 may be specifically realized by step 501a and step 501b described below.
And step 501a, acquiring a total space range of the projected vector data to be sliced.
It is understood that the total spatial range is a spatial range corresponding to the target region.
And step 501b, acquiring a root grid set according to the total space range.
The acquisition of the root grid set may be determined by a random assignment or by geographic parameters of the target area.
Wherein, the random assignment means that a reasonable map level n (n belongs to [0,30 ]) is assigned immediately, and the minimum grid needed when the total space range is completely covered under the level is calculated and is used as a root grid set; the geographic parameter of the target area is determined according to the total spatial range, the longitude difference and the latitude difference of the spatial range are calculated, the level n where grids meeting certain rules are located is found according to the longitude difference or the latitude difference, and the minimum grids which are required by completely covering the spatial range under the level n are calculated to serve as a root grid set. Some rules may refer to a grid or a next-nearest grid where the longitude or latitude (or the longitude and latitude) difference is closest to the longitude or latitude (or the longitude and latitude) difference of the acquired total spatial range, and the like, which are favorable for determining the map hierarchy.
And 502, acquiring a self-adaptive segmentation threshold value.
In the embodiment of the present application, the "adaptive slicing threshold" is the preset data density.
The self-adaptive segmentation threshold is the number of vector data or a numerical value representing the size of a specific space, namely when the density of the vector data in a certain root grid exceeds the threshold, the root grid is equally divided to obtain a sub-grid with one level higher than the level of the root grid.
The acquisition of the adaptive slicing threshold may be specified by a human or an algorithm. The artificial designation refers to determining a reasonable value according to experience after the processing capacity, the memory and other configurations of the machine are combined with task evaluation to be sliced; the algorithm designation refers to calculation or estimation according to parameters such as the total data size to be sliced and the range of the number of the root grids, for example, the total data size to be sliced and the number of grids in a root grid set are obtained, the average data size in each root grid can be obtained through the total data size/the number of the root grids, and the average data size is used as a self-adaptive slicing threshold.
Step 503, obtaining data density distribution information of the root grid.
The data distribution density information of the root mesh may be represented by the amount of data within the root mesh.
A method of acquiring the data amount in the root mesh is explained below.
In one approach, the number of pieces of vector data falling within the spatial range corresponding to each root mesh is queried and counted;
in one approach, the data storage size of the vector data falling within the spatial range corresponding to each root grid is queried and counted;
in one mode, sampling vector data to be sliced according to a certain rule, and calculating the number of samples falling into each root grid;
in one approach, the vector data to be sliced is sampled according to certain rules, and the data storage size of the samples in each root grid is calculated.
Alternatively, when estimating the vector data density in the root mesh by sampling, the sampling ratio may be determined first, and then the sampling ratio is set to the actual sampled data amount in each root mesh, and the obtained value is used as the final data amount of the mesh.
It is to be understood that the "root grid set" in step 503 may also be referred to as the "initial grid set".
And step 504, judging the relation between the data volume in the root grid and the self-adaptive segmentation threshold value.
In the embodiment of the present application, it is assumed that the required map layer level set is [ i, j ], where i and j are positive integers, and j is greater than i. Then: when the data amount in one root grid is less than or equal to the adaptive slicing threshold, the following step 506 is executed, when the data amount in one root grid is greater than the adaptive slicing threshold, the following step 505 is executed, and after the step 505 is executed, the step 504 is continuously executed.
And step 505, the root grids are evenly divided.
Illustratively, assuming that the required map level set is [ i, j ], when the amount of data in a root grid is greater than the adaptive slicing threshold, the root grid can be equally divided into four sub-grids, and the root grid is removed from the root grid set, and the four sub-grids are added to the root grid set. And jumping to step 503 to continue execution to judge the relationship between the data volume in each of the four sub-grids and the adaptive segmentation threshold value until the data volume in all the sub-grids obtained by segmentation is less than or equal to the adaptive segmentation threshold value.
Then, judging the relationship between the map levels k and j corresponding to the child grids which are added into the root grid set at the last time, if k is larger than j, aggregating the space ranges corresponding to the adjacent k-level root grids to obtain parent grids of a k-1 layer, acquiring the data volume in the parent grids and judging the relationship with a self-adaptive segmentation threshold, and if the data volume of the parent grids is smaller than or equal to the segmentation threshold, deleting the grids which participate in aggregation from the root grid set and adding the parent grids obtained by aggregation into the root grid set; and if the data volume of the father grid is larger than the segmentation threshold, canceling the space range aggregation of the k-level root grid and the adjacent root grid, deleting the k-1 layer father grid, and keeping the root grid set unchanged.
Step 506, vector map slicing.
The vector map slicing in the embodiment of the application is not limited to 4 equal divisions of the used pyramid model (quadtree slicing, namely, a rectangular grid is divided into four rectangular grids with the same size and shape), but is applicable to any form of equal division of any parent grid which can be completely divided by a sub-tile.
The vector map slicing method and device are suitable for various vector slicing processes such as single-thread, multi-thread or distributed.
Alternatively, the step 506 may specifically include the following steps 506a to 506g.
Step 506a, vector data in one root grid in the root grid set is obtained, and all the root grids are regarded as common grids.
In step 506b, if the map level n of the grid is smaller than i, the following step 506g is performed.
Step 506c, if the map level n of the grid is equal to i, storing the vector data in the grid into tiles, and continuing to execute the following step 506g;
step 506d, when the map level n of the grid belongs to any level in the (i, j) interval, storing the vector data in the grid into tiles, and continuing to execute the following step 506g;
step 506e, if the map level n is equal to j, the vector data in the grid is saved as a tile, and the step 506a is continuously executed, that is, the step 506a is executed on the next root grid. And the rest can be done in the same way until all the root grids in the root grid set are traversed.
Step 506f, when the map level n of the grid is equal to j and is the last grid under the corresponding root grid, storing the vector data in the grid into tiles, and releasing all the data of the corresponding root grid.
Step 506g, the vector data in the grid is divided into four n + 1-level sub-grids with equal size and shape according to the space range, and the step 506b is continuously executed on each sub-grid.
It will be appreciated that the above steps are performed for each root mesh.
And 507, judging the relation between the maximum map level in the root grid set and the required map level set [ i, j ].
Specifically, assuming that the maximum map level in the root grid set is the map level n, then: when the map level n is less than or equal to the lower limit map level i, the map slice ends. When the map level n is greater than the lower limit map level i, step 508 described below is performed.
Step 508, aggregating the tiles corresponding to the respective root grids in the root grid set.
Specifically, step 508a, find out a n-level grid that the map level is greater than the map level i of the lower limit in the root grid set first;
step 508b, acquiring other n-level child grids corresponding to the (n-1) level parent grid of the n-level grid; and aggregating the vector map tiles corresponding to the n-level grids and the vector map tiles corresponding to the other n-level sub-grids. Then, the n-level mesh and the other n-level sub-meshes are deleted from the root mesh set, and the aggregated (n-1) -level mesh is added to the root mesh set. And proceeds to step 508a as described above.
It can be seen that after step 508 is performed, the map levels corresponding to all root grids in the root grid set are less than or equal to the lower limit map level i.
In this example, step 1 and steps 502 to 505 obtain a root grid set which changes adaptively according to the density distribution of vector data to be sliced, and the slicing task is split reasonably according to the data volume so as to make reasonable use of IO;
2. step 506, according to the reasonably split task, computing resources are fully utilized, the completed slicing task is released in time, and memory occupation is reduced, so that slicing efficiency is improved;
3. step 507 and step 508 can well cope with the situation of large data volume of a single grid, the tiles corresponding to the grid with large data volume do not need to read all data in the grid any more, but are obtained by directly aggregating lightweight sub-tiles, so that the possibility of memory overflow and IO transmission timeout is reduced, and the robustness of the system is increased.
Optionally, the adaptive segmentation threshold may be implemented by an artificial intelligence algorithm, and after a large number of map slices are performed by the artificial intelligence algorithm, the most reasonable adaptive segmentation threshold may be calculated from a slice task type, a slice data range, a slice data amount, and the like, or even the most reasonable root grid set may be directly calculated, that is, the adaptive vector slicing is more artificial intelligent.
Optionally, in the face of a situation where a parent mesh cannot be completely divided by multiple child meshes or there is a slice where one child mesh contains the contents of two parent meshes, how to implement adaptive vector map slicing.
In the vector map generation method provided in the embodiment of the present application, the execution subject may be a vector map generation apparatus. In the embodiment of the present application, a method for executing vector map generation by a vector map generation device is taken as an example, and a device for generating a vector map provided in the embodiment of the present application is described.
Fig. 6 shows a schematic diagram of a possible structure of the vector map generation apparatus according to the embodiment of the present application. As shown in fig. 6, the vector map generating apparatus 60 may include: an acquisition module 61 and a processing module 62. Fig. 6 shows a schematic diagram of a possible structure of the vector map generation apparatus according to the embodiment of the present application. As shown in fig. 6, the application icon display device 60 may include: an acquisition module 61 and a processing module 62.
The obtaining module 61 is configured to obtain a root grid set corresponding to the vector data to be sliced based on density distribution information of the vector data to be sliced corresponding to the target area, where the root grid set includes a plurality of root grids, each root grid in the plurality of root grids corresponds to one map level, and the density of the vector data in each root grid is less than or equal to a preset data density; a processing module 62 configured to generate a set of target vector map tiles based on the vector data in each root mesh and the corresponding acquisitions; and the processing module is also used for obtaining an area vector map corresponding to the target area based on the target vector map tile set.
In a possible implementation manner, the obtaining module 61 includes an obtaining sub-module and a processing sub-module; the acquisition submodule is used for acquiring an initial grid set corresponding to vector data to be sliced and vector data in each initial grid in the initial grid set, and each initial grid corresponds to a first map level; the processing submodule is used for segmenting the vector data in the target initial grid based on the density distribution information acquired by the acquisition submodule to obtain a plurality of first grids of a next map level of the target initial grid, and the target initial grid is an initial grid of which the density of the vector data in the initial grid set is greater than the preset data density; and if the density of the vector data in the target first grid in the plurality of first grids is greater than the preset data density, continuing to divide the vector data in the target first grid until the density of the vector data in all the grids obtained after division is less than or equal to the preset data density to obtain a root grid set.
In one possible implementation, the first map level is determined by one of:
randomly assigning;
determined by the geographic parameters of the target area;
wherein the geographic parameter comprises at least one of: the longitude difference of the target area and the latitude difference of the target area.
In a possible implementation manner, the processing module 62 is specifically configured to, for one root grid in the root grid set, when a map level n corresponding to the root grid is greater than a lower limit map level i in the preset map level set and is less than an upper limit map level j in the preset map level set:
converting vector data in a root grid into vector map tiles corresponding to a map level n;
dividing vector data in one root grid until a plurality of second grids of the root grid corresponding to the map level f are obtained through division; respectively converting the vector data in the second grids into vector map tiles corresponding to the map level f until the vector data in the third grids are respectively converted into vector map tiles corresponding to the upper limit map level j; the plurality of third grids include all grids of one root grid corresponding to the upper limit map level j;
wherein the set of target vector map tiles comprises: a vector map tile corresponding to the one root grid, a plurality of vector map tiles corresponding one-to-one to the plurality of second grids, and a plurality of vector map tiles corresponding one-to-one to the plurality of third grids; the map level f is the map level with the minimum difference with the map level n in the preset map level set, n, i, j and f are positive integers, and i is more than or equal to n and less than or equal to f and less than or equal to j; the release time of the vector data in the third grids is determined by a first time, which is a time to obtain the vector map tiles corresponding to the third vector map tiles one to one.
In a possible implementation manner, the processing module 62 is specifically configured to, for one root mesh in the root mesh set, in a case that the map level n is smaller than the lower limit map level i:
dividing vector data in one root grid until a plurality of fourth grids of the root grid corresponding to the lower limit map level i are obtained through division; respectively converting the vector data in the fourth grids into vector map tiles corresponding to the lower limit map level i;
respectively segmenting the vector data in the fourth grids until a plurality of fifth grids corresponding to the map level g of one root grid are obtained; respectively converting the vector data in the fifth grids into vector map tiles corresponding to the map level g until the vector data in the third grids are respectively converted into vector map tiles corresponding to the upper limit map level j; the plurality of third meshes includes all meshes of the one root mesh corresponding to the upper limit map level j;
the map level g is a map level with a lower limit of difference between the preset map level set and the lower limit map level i, n is more than i and less than g and less than or equal to j, and n, i, g and j are positive integers;
the target vector map tile set comprises: a plurality of vector map tiles corresponding one-to-one to the plurality of fourth grids, a plurality of vector map tiles corresponding one-to-one to the plurality of fifth grids, and a plurality of vector map tiles corresponding one-to-one to the plurality of third grids;
the release time of the vector data in the plurality of third grids is determined by first time, and the first time is time for obtaining a plurality of vector map tiles corresponding to the plurality of third vector map tiles one to one.
In a possible implementation manner, the processing module 62 is specifically configured to, for one root mesh in the root mesh set, when the map level n is greater than or equal to the upper limit map level j:
converting vector data in a root grid into vector map tiles corresponding to map level n;
wherein the set of target vector map tiles includes: a vector map tile corresponding to the one root grid;
the release time of the vector data within the one root grid is determined by the time at which the vector map tile corresponding to the one root grid is obtained. In a possible implementation manner, the processing module 62 is further configured to, after completing the release of the vector data of all grids in the root grid set:
if the map level n is greater than the lower limit map level i, aggregating the vector map tiles obtained by converting the vector data in the at least two first grids to obtain first vector map tiles corresponding to the map level (n-1); replacing at least two first root grids in the root grid set with first parent grids; the at least two first root grids comprise a root grid, and the first parent grid is a parent grid of a corresponding map level (n-1) of the at least two first root grids;
if the map level (n-1) is greater than the lower limit map level i, aggregating the vector map tiles obtained by converting the vector data in at least two second grids to obtain second vector map tiles corresponding to the map level (n-2); replacing at least two second root grids in the root grid set with second parent grids until a vector map tile corresponding to the lower limit map level i is obtained through aggregation; the at least two second root grids comprise a first father grid, and the second father grid is a father grid of a corresponding map level (n-2) of the at least two second root grids.
In a possible implementation manner, the preset map level set corresponding to the vector data to be sliced includes M map levels, where M is an integer greater than 1;
the processing module 62 is specifically configured to:
splicing vector tiles corresponding to the same map level in a target vector map tile set based on M map levels to obtain M map layers; and are combined
And obtaining the regional vector map based on the M map layers.
In a possible implementation, the preset data density is determined according to any one of the following:
determining according to the configuration information of the equipment and the evaluation result of the task to be sliced;
determining according to the vector data to be sliced and the target quantity;
wherein the target number is: the number of initial grids corresponding to the vector data to be sliced.
The embodiment of the application provides a vector map slicing generation device, because can be according to waiting to slice the density distribution information acquisition root net set of vector data, consequently can make electronic equipment can split the section task more rationally to make the vector data density in each root net in the net set be less than preset data density, and the self-adaptation is torn open and is carried out the section to the vector data after the split, thereby can improve the efficiency that the vector map is sliced, and then can improve the efficiency that generates the vector map.
The vector map generation apparatus in the embodiment of the present application may be an electronic device, or may be a component in the electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal, or may be a device other than a terminal. The electronic Device may be, for example, a Mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic Device, a Mobile Internet Device (MID), an Augmented Reality (AR)/Virtual Reality (VR) Device, a robot, a wearable Device, an ultra-Mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and may also be a server, a Network Attached Storage (Network Attached Storage, NAS), a personal computer (NAS), a Television (TV), a teller machine, a self-service machine, and the like, and the embodiments of the present application are not limited in particular.
The vector map generation device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present application are not limited specifically.
The vector map generation apparatus provided in the embodiment of the present application can implement each process implemented in the method embodiments of fig. 2 to 5, and is not described here again to avoid repetition.
Optionally, as shown in fig. 7, an electronic device 700 is further provided in an embodiment of the present application, and includes a processor 701 and a memory 702, where the memory 702 stores a program or an instruction that can be executed on the processor 701, and when the program or the instruction is executed by the processor 701, the steps of the embodiment of the vector map generation method are implemented, and the same technical effects can be achieved, and are not described again to avoid repetition.
Fig. 8 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
The electronic device 800 includes, but is not limited to: a radio frequency unit 801, a network module 802, an audio output unit 803, an input unit 804, a sensor 805, a display unit 806, a user input unit 807, an interface unit 808, a memory 809, and a processor 810.
Those skilled in the art will appreciate that the electronic device 800 may further comprise a power source (e.g., a battery) for supplying power to the various components, and the power source may be logically connected to the processor 810 via a power management system, so as to manage charging, discharging, and power consumption management functions via the power management system. The electronic device structure shown in fig. 8 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components, and thus, the description is omitted here.
The input unit 804 is configured to obtain a root grid set corresponding to vector data to be sliced based on density distribution information of the vector data to be sliced corresponding to a target area, where the root grid set includes a plurality of root grids, each root grid in the plurality of root grids corresponds to a map level, and the density of vector data in each root grid is less than or equal to a preset data density; a processor 810 for generating a set of target vector map tiles based on the vector data within each root grid and the corresponding acquisitions; and the processing module is also used for obtaining an area vector map corresponding to the target area based on the target vector map tile set.
Optionally, the processor 810 is configured to obtain an initial grid set corresponding to vector data to be sliced, and vector data in each initial grid in the initial grid set, where each initial grid corresponds to a first map level; the processor 810 is further configured to segment the vector data in the target initial mesh based on the density distribution information to obtain a plurality of first meshes of a next map level of the target initial mesh, where the target initial mesh is an initial mesh in the initial mesh set, where the density of the vector data is greater than the preset data density; and if the density of the vector data in the target first grid in the plurality of first grids is greater than the preset data density, continuing to divide the vector data in the target first grid until the density of the vector data in all the grids obtained after division is less than or equal to the preset data density to obtain a root grid set.
Optionally, the first map level is determined by one of:
randomly appointing;
determining from the geographic parameter of the target area;
wherein the geographic parameter comprises at least one of: the longitude difference of the target area and the latitude difference of the target area.
Optionally, the processor 810 is specifically configured to, for one root grid in the root grid set, if a map level n corresponding to the root grid is greater than a lower limit map level i in a preset map level set and is less than an upper limit map level j in the preset map level set:
converting vector data in a root grid into vector map tiles corresponding to map level n;
dividing vector data in one root grid until a plurality of second grids of one root grid corresponding to the map level f are obtained through division; respectively converting the vector data in the second grids into vector map tiles corresponding to the map level f until the vector data in the third grids are respectively converted into vector map tiles corresponding to the upper limit map level j; the plurality of third grids include all grids of one root grid corresponding to the upper limit map level j;
wherein the set of target vector map tiles includes: a vector map tile corresponding to the one root grid, a plurality of vector map tiles corresponding to the plurality of second grids one to one, and a plurality of vector map tiles corresponding to the plurality of third grids one to one; the map level f is the map level with the minimum difference with the map level n in the preset map level set, n, i, j and f are positive integers, and i is more than or equal to n and less than or equal to f; the release time of the vector data in the third grids is determined by a first time, which is a time to obtain the vector map tiles corresponding to the third vector map tiles one to one.
Optionally, the processor 810 is specifically configured to, for one root mesh in the root mesh set, when the map level n is smaller than the lower limit map level i:
dividing vector data in one root grid until a plurality of fourth grids of the root grid corresponding to the lower limit map level i are obtained through division; respectively converting the vector data in the fourth grids into vector map tiles corresponding to the lower limit map level i;
respectively segmenting the vector data in the fourth grids until a plurality of fifth grids corresponding to the map level g of one root grid are obtained; respectively converting the vector data in the fifth grids into vector map tiles corresponding to the map level g until the vector data in the third grids are respectively converted into vector map tiles corresponding to the upper limit map level j; the plurality of third meshes includes all meshes of the one root mesh corresponding to the upper limit map level j;
the map level g is a map level with a lower limit of difference between the preset map level set and the lower limit map level i, n is more than i and less than g and less than or equal to j, and n, i, g and j are positive integers;
the target vector map tile set comprises: a plurality of vector map tiles in one-to-one correspondence with the plurality of fourth grids, a plurality of vector map tiles in one-to-one correspondence with the plurality of fifth grids, and a plurality of vector map tiles in one-to-one correspondence with the plurality of third grids;
the release time of the vector data in the plurality of third grids is determined by first time, and the first time is time for obtaining a plurality of vector map tiles corresponding to the plurality of third vector map tiles one to one.
Optionally, the processor 810 is specifically configured to, for one root mesh in the root mesh set, when the map level n is greater than or equal to the upper limit map level j:
converting vector data in a root grid into vector map tiles corresponding to map level n;
wherein the set of target vector map tiles includes: a vector map tile corresponding to the one root grid;
the release time of the vector data within the one root mesh is determined by the time at which the vector map tile corresponding to the one root mesh is obtained. Optionally, the processor 810 is further configured to, after completing the releasing of the vector data of all grids in the root grid set:
if the map level n is greater than the lower-limit map level i, aggregating vector map tiles obtained by converting vector data in at least two first root grids to obtain first vector map tiles corresponding to the map level (n-1); replacing at least two first root grids in the root grid set with first parent grids; the at least two first root grids comprise a root grid, and the first father grid is a father grid of a corresponding map level (n-1) of the at least two first root grids;
if the map level (n-1) is greater than the lower limit map level i, aggregating the vector map tiles obtained by converting the vector data in at least two second grids to obtain second vector map tiles corresponding to the map level (n-2); replacing at least two second root grids in the root grid set with second father grids until the vector map tiles corresponding to the lower limit map level i are obtained in an aggregation mode; the at least two second root grids comprise a first parent grid, and the second parent grid is a parent grid of a corresponding map level (n-2) of the at least two second root grids.
Optionally, the preset map level set corresponding to the vector data to be sliced includes M map levels, where M is an integer greater than 1;
the processor 810 is specifically configured to:
splicing vector tiles corresponding to the same map level in the target vector map tile set based on the M map levels to obtain M map layers; and are combined
And obtaining the regional vector map based on the M map layers.
Optionally, the preset data density is determined according to any one of the following:
determining according to the configuration information of the equipment and the evaluation result of the task to be sliced;
determining according to the vector data to be sliced and the target quantity;
wherein the target number is: the number of initial grids corresponding to the vector data to be sliced.
The embodiment of the application provides a vector map slicing generation device, because can be according to waiting to slice the density distribution information acquisition root net set of vector data, consequently can make electronic equipment can split the section task more rationally to make the vector data density in each root net in the net set be less than preset data density, and the self-adaptation is torn open and is carried out the section to the vector data after the split, thereby can improve the efficiency that the vector map is sliced, and then can improve the efficiency that generates the vector map.
It should be understood that in the embodiment of the present application, the input Unit 804 may include a Graphics Processing Unit (GPU) 8041 and a microphone 8042, and the Graphics Processing Unit 8041 processes image data of still pictures or videos obtained by an image capturing device (such as a camera) in a video capturing mode or an image capturing mode. The display unit 806 may include a display panel 8061, and the display panel 8061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The input unit 804 includes at least one of a touch panel 8071 and other input devices 8072. A touch panel 8071, also referred to as a touch screen. The touch panel 8071 may include two portions of a touch detection device and a touch controller. Other input devices 8072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein.
The memory 809 may be used to store software programs as well as various data. The memory 809 may mainly include a first storage area storing programs or instructions and a second storage area storing data, wherein the first storage area may store an operating system, application programs or instructions required for at least one function (such as a sound playing function, an image playing function, etc.), and the like. Further, the memory 809 can include volatile memory or nonvolatile memory, or the memory 809 can include both volatile and nonvolatile memory. The non-volatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash Memory. The volatile Memory may be a Random Access Memory (RAM), a Static Random Access Memory (Static RAM, SRAM), a Dynamic Random Access Memory (Dynamic RAM, DRAM), a Synchronous Dynamic Random Access Memory (Synchronous DRAM, SDRAM), a Double Data Rate Synchronous Dynamic Random Access Memory (Double Data Rate SDRAM, ddr SDRAM), an Enhanced Synchronous SDRAM (ESDRAM), a Synchronous Link DRAM (SLDRAM), and a Direct Memory bus RAM (DRRAM). The memory 809 in the present embodiment includes, but is not limited to, these and any other suitable types of memory.
Processor 810 may include one or more processing units; optionally, the processor 810 integrates an application processor, which primarily handles operations related to the operating system, user interface, and applications, and a modem processor, which primarily handles wireless communication signals, such as a baseband processor. It will be appreciated that the modem processor described above may not be integrated into processor 810.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements each process of the embodiment of the vector map generation method, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read only memory ROM, a random access memory RAM, a magnetic or optical disk, and the like.
The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run a program or an instruction to implement each process of the embodiment of the vector map generation method, and can achieve the same technical effect, and in order to avoid repetition, the description is omitted here.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as a system-on-chip, or a system-on-chip.
Embodiments of the present application provide a computer program product, where the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the processes of the embodiment of the vector map generation method, where the processes can achieve the same technical effect, and are not described herein again to avoid repetition.
It should be noted that, in this document, 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 phrases "comprising a component of' 8230; \8230;" does not exclude the presence of another like element in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application or portions thereof that contribute to the prior art may be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (which may be a mobile phone, a computer, a server, or a network device, etc.) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (20)

1. A vector map generation method, characterized in that the method comprises:
acquiring a root grid set corresponding to vector data to be sliced based on density distribution information of the vector data to be sliced corresponding to a target area, wherein the root grid set comprises a plurality of root grids, each root grid in the plurality of root grids corresponds to one map level, and the density of the vector data in each root grid is less than or equal to a preset data density;
generating a set of target vector map tiles based on the vector data within each root mesh and the respective map hierarchy;
and obtaining an area vector map corresponding to the target area based on the target vector map tile set.
2. The vector map generation method according to claim 1, wherein the obtaining a root grid set corresponding to the vector data to be sliced based on density distribution information of the vector data to be sliced corresponding to the target area comprises:
acquiring an initial grid set corresponding to the vector data to be sliced and vector data in each initial grid in the initial grid set, wherein each initial grid corresponds to a first map level;
based on the density distribution information, dividing vector data in a target initial grid to obtain a plurality of first grids of a next map level of the target initial grid, wherein the target initial grid is an initial grid of which the density of the vector data in the initial grid set is greater than the preset data density;
if the density of the vector data in the target first mesh in the first meshes is larger than the preset data density, the vector data in the target first mesh are continuously segmented until the density of the vector data in all the meshes obtained after segmentation is smaller than or equal to the preset data density, and the root mesh set is obtained.
3. The vector map generation method of claim 2, wherein the first map level is determined by one of:
randomly appointing;
determining from a geographic parameter of the target area;
wherein the geographic parameter comprises at least one of: a longitude difference of the target area, and a latitude difference of the target area.
4. The method of claim 1, wherein generating a set of target vector map tiles based on the vector data within each root mesh and the respective map hierarchy comprises:
for one root grid in the root grid set, if a map level n corresponding to the root grid is greater than a lower limit map level i in a preset map level set and is less than an upper limit map level j in the preset map level set:
converting the vector data within the one root mesh into a vector map tile corresponding to the one root mesh;
dividing the vector data in the root grid until a plurality of second grids of the root grid corresponding to the map level f are obtained through division; converting the vector data in the second grids into a plurality of vector map tiles corresponding to the second grids one by one until converting the vector data in the third grids into a plurality of vector map tiles corresponding to the third grids one by one; the plurality of third meshes includes all meshes of the one root mesh corresponding to the upper limit map level j;
wherein the set of target vector map tiles comprises: a vector map tile corresponding to the one root grid, a plurality of vector map tiles corresponding to the plurality of second grids one to one, and a plurality of vector map tiles corresponding to the plurality of third grids one to one;
the map level f is the map level with the minimum difference with the map level n in the preset map level set, n, i, j and f are positive integers, and i is more than or equal to n and less than or equal to f;
the release time of the vector data in the third grids is determined by a first time, and the first time is a time for obtaining a plurality of vector map tiles corresponding to the third grids one to one.
5. The method of claim 1, wherein generating a set of target vector map tiles based on the vector data within each root mesh and the respective map hierarchy comprises:
for one root grid in the root grid set, under the condition that the map level n is smaller than the lower limit map level i, dividing vector data in the root grid until a plurality of fourth grids of the root grid corresponding to the lower limit map level i are obtained through division;
converting the vector data in the plurality of fourth grids into a plurality of vector map tiles in one-to-one correspondence with the plurality of fourth grids;
respectively segmenting the vector data in the fourth grids until a plurality of fifth grids of the root grid corresponding to the map level g are obtained; converting the vector data in the fifth grids into a plurality of vector map tiles corresponding to the fifth grids one by one until the vector data in the third grids are converted into a plurality of vector map tiles corresponding to the third grids one by one; the plurality of third meshes includes all meshes of the one root mesh corresponding to the upper limit map level j;
the map level g is the map level with the minimum difference with the lower limit map level i in the preset map level set, n is more than i and less than g and less than or equal to j, and n, i, g and j are positive integers;
the target vector map tile set comprises: a plurality of vector map tiles corresponding one-to-one to the plurality of fourth grids, a plurality of vector map tiles corresponding one-to-one to the plurality of fifth grids, and a plurality of vector map tiles corresponding one-to-one to the plurality of third grids;
the release time of the vector data in the plurality of third grids is determined by first time, and the first time is the time for obtaining a plurality of vector map tiles corresponding to the plurality of third grids one by one.
6. The method of claim 1, wherein generating a set of target vector map tiles based on the vector data within each root mesh and the respective map hierarchy comprises:
for one of the root mesh sets, if the map level n is greater than or equal to the upper bound map level j:
converting the vector data within the one root grid into a vector map tile corresponding to the one root grid;
wherein the set of target vector map tiles includes: a vector map tile corresponding to the one root grid;
the release time of the vector data within the one root grid is determined by the time at which the vector map tile corresponding to the one root grid is obtained.
7. The method according to any of claims 4 to 6, wherein after completing the release of vector data for all grids in the root grid set, the method further comprises:
if the map level n is greater than the lower-limit map level i, aggregating the vector map tiles corresponding to at least two first root grids to obtain a first vector map tile corresponding to a first father grid; and replacing the at least two first root grids in the root grid set with the first parent grid; the at least two first root grids comprise the one root grid, and the first parent grid is a parent grid of the one root grid corresponding to the map level (n-1);
if the map level (n-1) is greater than the lower limit map level i, aggregating the vector map tiles corresponding to at least two second parent grids to obtain second vector map tiles corresponding to a second parent grid; replacing the at least two second root grids in the root grid set with the second parent grids until a vector map tile corresponding to a third parent grid is obtained through aggregation; the at least two second root grids include the first parent grid, the second parent grid is a parent grid of the root grid corresponding to the map level (n-2), and the third parent grid is a parent grid of the root grid corresponding to the lower limit map level i.
8. The method according to claim 1, wherein the preset map level set corresponding to the vector data to be sliced includes M map levels, where M is an integer greater than 1;
the obtaining of the area vector map corresponding to the target area based on the target vector map tile set includes:
splicing vector tiles corresponding to the same map level in the target vector map tile set based on the M map levels to obtain M map layers;
and obtaining the regional vector map based on the M map layers.
9. The method of claim 1, wherein the preset data density is determined according to any one of:
determining according to configuration information of the equipment and an evaluation result of the task to be sliced;
determining according to the vector data to be sliced and the target quantity;
wherein the target number is: and the number of the initial grids corresponding to the vector data to be sliced.
10. A vector map generation apparatus, characterized in that the apparatus comprises: the device comprises an acquisition module and a processing module;
the acquisition module is used for acquiring a root grid set corresponding to the vector data to be sliced based on density distribution information of the vector data to be sliced corresponding to a target area, wherein the root grid set comprises a plurality of root grids, each root grid in the plurality of root grids corresponds to one map level, and the density of the vector data in each root grid is less than or equal to a preset data density;
the processing module is used for generating a target vector map tile set based on the vector data in each root grid and the map hierarchy obtained by the corresponding obtaining module;
the processing module is further configured to obtain an area vector map corresponding to the target area based on the target vector map tile set.
11. The apparatus of claim 10, wherein the obtaining module comprises an obtaining sub-module and a processing sub-module;
the obtaining submodule is used for obtaining an initial grid set corresponding to the vector data to be sliced and vector data in each initial grid in the initial grid set, and each initial grid corresponds to a first map level;
the processing submodule is configured to segment vector data in a target initial grid based on the density distribution information acquired by the acquisition submodule to obtain multiple first grids of a next map level of the target initial grid, where the target initial grid is an initial grid in which the density of vector data in the initial grid set is greater than the preset data density; and if the density of the vector data in the target first mesh in the multiple first meshes is greater than the preset data density, continuing to divide the vector data in the target first mesh until the density of the vector data in all the meshes obtained after division is less than or equal to the preset data density to obtain the root mesh set.
12. The apparatus of claim 11, wherein the first map level is determined by one of:
randomly appointing;
determining from a geographic parameter of the target area;
wherein the geographic parameter comprises at least one of: a longitude difference of the target area, and a latitude difference of the target area.
13. The apparatus of claim 10,
the processing module is specifically configured to, for one root grid in the root grid set, when a map level n corresponding to the root grid is greater than a lower limit map level i in a preset map level set and is less than an upper limit map level j in the preset map level set:
converting the vector data within the one root grid into vector map tiles corresponding to a map level n;
dividing the vector data in the root grid until a plurality of second grids of the root grid corresponding to the map level f are obtained through division; respectively converting the vector data in the second grids into vector map tiles corresponding to the map level f until the vector data in the third grids are respectively converted into vector map tiles corresponding to the upper limit map level j; the plurality of third meshes includes all meshes of the one root mesh corresponding to the upper limit map level j;
wherein the set of target vector map tiles includes: a vector map tile corresponding to the one root grid, a plurality of vector map tiles corresponding one-to-one to the plurality of second grids, and a plurality of vector map tiles corresponding one-to-one to the plurality of third grids; the map level f is the map level with the minimum difference with the map level n in the preset map level set, n, i, j and f are positive integers, and i is more than or equal to n and less than or equal to f and less than or equal to j;
the release time of the vector data in the plurality of third grids is determined by first time, and the first time is time for obtaining a plurality of vector map tiles corresponding to the plurality of third vector map tiles one to one.
14. The apparatus of claim 10,
the processing module is specifically configured to, for one of the root meshes in the root mesh set, in a case that the map level n is smaller than the lower limit map level i,
dividing the vector data in the root grid until a plurality of fourth grids of the root grid corresponding to the lower-limit map level i are obtained through division; respectively converting the vector data in the fourth grids into vector map tiles corresponding to the lower-limit map level i;
respectively segmenting the vector data in the fourth grids until a plurality of fifth grids of the root grid corresponding to the map level g are obtained; respectively converting the vector data in the fifth grids into vector map tiles corresponding to the map level g until the vector data in the third grids are respectively converted into vector map tiles corresponding to the upper limit map level j; the plurality of third meshes includes all meshes of the one root mesh corresponding to the upper limit map level j;
the map level g is a map level with a lower limit of difference between the preset map level set and the lower limit map level i, n is more than i and less than g and less than or equal to j, and n, i, g and j are positive integers;
the target vector map tile set comprises: a plurality of vector map tiles in one-to-one correspondence with the plurality of fourth grids, a plurality of vector map tiles in one-to-one correspondence with the plurality of fifth grids, and a plurality of vector map tiles in one-to-one correspondence with the plurality of third grids;
the release time of the vector data in the third grids is determined by a first time, which is a time to obtain the vector map tiles corresponding to the third vector map tiles one to one.
15. The apparatus of claim 10,
the processing module is specifically configured to, for one of the root meshes in the root mesh set, if the map level n is greater than or equal to the upper limit map level j:
converting the vector data within the one root grid into vector map tiles corresponding to a map level n;
wherein the set of target vector map tiles includes: a vector map tile corresponding to the one root grid;
the release time of the vector data within the one root grid is determined by the time at which the vector map tile corresponding to the one root grid is obtained.
16. The apparatus of any one of claims 13 to 15,
the processing module is further configured to, after completing the release of the vector data of all the grids in the root grid set, in a case where the map level n is greater than the lower limit map level i:
aggregating vector map tiles obtained by converting vector data in at least two first root grids to obtain first vector map tiles corresponding to a map level (n-1); and replacing the at least two first root grids in the root grid set with first parent grids; the at least two first root grids comprise the root grid, and the first parent grid is a parent grid of the at least two first root grids corresponding to the map level (n-1);
if the map level (n-1) is greater than the lower limit map level i, aggregating vector map tiles obtained by converting vector data in at least two second grids to obtain second vector map tiles corresponding to the map level (n-2); replacing the at least two second root grids in the root grid set with second parent grids until the vector map tiles corresponding to the lower limit map level i are obtained in an aggregation manner; the at least two second root meshes comprise the first parent mesh, and the second parent mesh is a parent mesh of the at least two second root meshes corresponding to the map level (n-2).
17. The device according to claim 10, wherein the preset map level set corresponding to the vector data to be sliced includes M map levels, where M is an integer greater than 1;
the processing module is specifically configured to: splicing vector tiles corresponding to the same map level in the target vector map tile set based on the M map levels to obtain M map layers; and obtaining the regional vector map based on the M map layers.
18. The apparatus of claim 10, wherein the preset data density is determined according to any one of:
determining according to configuration information of the equipment and an evaluation result of the task to be sliced;
determining according to the vector data to be sliced and the target quantity;
wherein the target number is: and the number of the initial grids corresponding to the vector data to be sliced.
19. An electronic device comprising a processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions when executed by the processor implementing the steps of the vector map generation method of any of claims 1 to 9.
20. A readable storage medium, on which a program or instructions are stored which, when executed by a processor, carry out the steps of the vector map generation method of any one of claims 1 to 9.
CN202211165875.8A 2022-09-23 2022-09-23 Vector map generation method and device, electronic equipment and readable storage medium Pending CN115457226A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202211165875.8A CN115457226A (en) 2022-09-23 2022-09-23 Vector map generation method and device, electronic equipment and readable storage medium
PCT/CN2023/120472 WO2024061327A1 (en) 2022-09-23 2023-09-21 Vector map generation method and apparatus, electronic device, and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211165875.8A CN115457226A (en) 2022-09-23 2022-09-23 Vector map generation method and device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN115457226A true CN115457226A (en) 2022-12-09

Family

ID=84306810

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211165875.8A Pending CN115457226A (en) 2022-09-23 2022-09-23 Vector map generation method and device, electronic equipment and readable storage medium

Country Status (2)

Country Link
CN (1) CN115457226A (en)
WO (1) WO2024061327A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116541479A (en) * 2023-07-06 2023-08-04 深圳依时货拉拉科技有限公司 Tile data compiling method, device, computer equipment and storage medium
CN116628123A (en) * 2023-07-19 2023-08-22 深圳市易图资讯股份有限公司 Dynamic slice generation method and system based on spatial database
WO2024061327A1 (en) * 2022-09-23 2024-03-28 维沃移动通信有限公司 Vector map generation method and apparatus, electronic device, and readable storage medium
CN117827915A (en) * 2024-03-01 2024-04-05 昆明麦普空间科技有限公司 Rapid vector slicing system and method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100321399A1 (en) * 2009-06-18 2010-12-23 Patrik Ellren Maps from Sparse Geospatial Data Tiles
CN111061729B (en) * 2019-11-29 2021-04-16 武汉大学 Granularity-considered vector tile organization method
CN111737393B (en) * 2020-07-01 2023-10-27 自然资源部四川基础地理信息中心(自然资源部四川测绘资料档案馆) Vector data self-adaptive management method and system in web environment
CN115457226A (en) * 2022-09-23 2022-12-09 维沃移动通信有限公司 Vector map generation method and device, electronic equipment and readable storage medium

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024061327A1 (en) * 2022-09-23 2024-03-28 维沃移动通信有限公司 Vector map generation method and apparatus, electronic device, and readable storage medium
CN116541479A (en) * 2023-07-06 2023-08-04 深圳依时货拉拉科技有限公司 Tile data compiling method, device, computer equipment and storage medium
CN116541479B (en) * 2023-07-06 2023-09-19 深圳依时货拉拉科技有限公司 Tile data compiling method, device, computer equipment and storage medium
CN116628123A (en) * 2023-07-19 2023-08-22 深圳市易图资讯股份有限公司 Dynamic slice generation method and system based on spatial database
CN116628123B (en) * 2023-07-19 2023-12-12 深圳市易图资讯股份有限公司 Dynamic slice generation method and system based on spatial database
CN117827915A (en) * 2024-03-01 2024-04-05 昆明麦普空间科技有限公司 Rapid vector slicing system and method

Also Published As

Publication number Publication date
WO2024061327A1 (en) 2024-03-28

Similar Documents

Publication Publication Date Title
CN115457226A (en) Vector map generation method and device, electronic equipment and readable storage medium
CN113628314B (en) Visualization method, device and equipment for photographic measurement model in illusion engine
US20060132488A1 (en) Apparatus and method for representing multi-level LOD three-dimensional image
CN111985597B (en) Model compression method and device
CN112799599B (en) Data storage method, computing core, chip and electronic equipment
AU2017288044B2 (en) Method and system for flexible, high performance structured data processing
CN111143039A (en) Virtual machine scheduling method and device and computer storage medium
CN114463473A (en) Image rendering processing method and device, storage medium and electronic equipment
CN113010296B (en) Formalized model based task analysis and resource allocation method and system
CN114185679A (en) Container resource scheduling method and device, computer equipment and storage medium
CN116796083B (en) Space data partitioning method and system
CN109741421B (en) GPU-based dynamic graph coloring method
CN115018712B (en) Distributed scheduling method and system for map data
CN111062171A (en) Application method, device and system of EFDC model based on cloud computing
CN110674134A (en) Geographic information data storage method, query method and device
CN114756352A (en) Method, device and medium for scheduling server computing resources
CN114329058A (en) Image gathering method and device and electronic equipment
CN111190952A (en) Method for extracting and persisting multi-scale features of urban portrait based on image pyramid
CN112817898A (en) Data transmission method, processor, chip and electronic equipment
CN112597323A (en) Remote sensing image storage and migration method and device and storage medium
US11709812B2 (en) Techniques for generating and processing hierarchical representations of sparse matrices
US20220374961A1 (en) Techniques for performing matrix computations using hierarchical representations of sparse matrices
US20220374496A1 (en) Techniques for accelerating matrix multiplication computations using hierarchical representations of sparse matrices
CN111290850B (en) Data storage method, device and equipment
CN108363736B (en) Storage method, device and storage system of line entity

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