A method and device for generating vector tiles from dameng database

By using clustering templates to generate weight values ​​in the DM database, the problems of low computational efficiency and slow display speed caused by updating geological disaster data in vector tiles are solved, achieving efficient vector tile updates and dynamic display effects.

CN117390033BActive Publication Date: 2026-05-22武汉达梦数据技术有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
武汉达梦数据技术有限公司
Filing Date
2023-04-07
Publication Date
2026-05-22

Smart Images

  • Figure CN117390033B_ABST
    Figure CN117390033B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of vector tiles, and provides a method and device for generating vector tiles based on a dameng database, wherein the method comprises the following steps: obtaining geological disaster hidden danger point vector data corresponding to a vector tile from the dameng database based on the coordinate ranges of the four corner points and a map service name; obtaining a map resolution of the vector tile requested by the vector tile; performing data assembly and format conversion on the geological disaster hidden danger point vector data after thinning the geological disaster hidden danger point vector data based on the map resolution; and presenting the thinned geological disaster hidden danger point vector data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of vector tile technology, and in particular to a method and apparatus for generating vector tiles adapted to the DM database. Background Technology

[0002] When displaying vector feature data on GIS maps, a common problem is the excessively large size of the vector data, leading to long computation times and poor visualization smoothness. This is mainly because vector feature data contains an enormous number of vertices, and current visualization systems on personal and enterprise computers are insufficient to quickly process and visualize tens or hundreds of thousands of line and polygon vector data. Furthermore, displaying large volumes of vector data on a map at once with excessive data density can easily cause browser crashes and freezes, resulting in a poor browsing experience and slow output speed on the map.

[0003] Existing vector feature thinning methods cannot guarantee uniform distribution of vector data after simplification. Furthermore, the generated tiles are static or do not support custom thinning parameter settings for each map level. Additionally, when geological hazard data is added or removed from vector tiles, all preset parameter values ​​directly related to the geological hazard data across the entire map must be updated to ensure a uniform standard for the thinning process. However, this results in significant computational inefficiency due to repeated updates.

[0004] There is currently a lack of unified solutions in the industry to address the above pain points. Application developers often need to develop their own solutions based on their specific needs, which is difficult and the results cannot be guaranteed.

[0005] Therefore, overcoming the shortcomings of the existing technology is an urgent problem to be solved in this technical field. Summary of the Invention

[0006] The technical problem to be solved by this invention is that when geological disaster data in vector tiles is added or deleted, the preset parameter values ​​in the entire map that are directly related to the geological disaster data are updated as a whole in order to ensure that the corresponding thinning process has a unified standard. However, this will greatly affect the efficiency of the back-and-forth update calculation.

[0007] The technical problem that this invention aims to solve further is the slow output speed and fixed display effect of vector data display in the case of large amounts of data in the prior art.

[0008] The present invention adopts the following technical solution:

[0009] A method for generating vector tiles adapted to the DM database, characterized in that, when there is an update of geological hazard vector data in the corresponding vector tiles, and it is necessary to update the preset parameter values ​​of each vector tile contained in the entire map for the added / deleted geological hazard vector data, the method includes:

[0010] The first vector tile containing the target geological hazard vector data to be assigned preset parameter values ​​is determined, as well as the attributes of the target geological hazard vector data; wherein, data of the same attribute of hidden danger points refers to data in which one or more of the following are the same: hidden danger type, degree of harm and scale, and threatened object;

[0011] Based on the spatial distribution shape and density of the first clustering template in the case library, and the spatial distribution shape and density of the clustering of the same attribute hazard points as the target geological disaster vector as a spatial cluster, a weight is assigned to the similarity between the two.

[0012] Based on the spatial distribution shape and density of hazard points with different attributes under different hazard types in the target geological hazard vector data, a weight is assigned to each of them by similarity analysis with the spatial distribution shape and density of the first cluster template, thereby generating a set of weight values ​​associated with the target geological hazard vector data; wherein, the first cluster template is used as the identification identifier for this set of weight values, and the weight values ​​within the set are identified by the attributes of each hazard point in the associated target geological hazard vector data.

[0013] Using the remaining second clustering template, third clustering template, ..., nth clustering template, the weight values ​​of the target geological hazard vector data with n-1 spatial distribution shapes and densities at the map level are calculated respectively, thus generating n-1 sets of weight values, which together with the initial set of weight values ​​constitute n sets of weight values;

[0014] Find n sets of target vector tiles with consistent weight values ​​in the vector tile library, and then obtain the preset parameter values ​​of the target geological disaster vector data from the preset parameter values ​​of the hidden danger points in the target vector tiles.

[0015] Preferably, without involving the updating of the geological hazard vector data, the normal vector tile processing method includes:

[0016] The vector tile information is obtained from the vector tile request URL address. The vector tile information includes the map level where the vector tile is located, the map service name, and the row and column numbers of the vector tile.

[0017] Based on the acquired vector tile information, a tile pyramid object is instantiated; at this point, the tile pyramid object has not yet loaded the vector data of geological disaster hazard points.

[0018] Based on the obtained vector tile information and the map resolution corresponding to the map level of the instantiated tile pyramid object, calculate the coordinates of the four corner points of the vector tile sought by the vector tile request URL address;

[0019] Based on the coordinate range of the four corner points and the map service name, obtain the vector data of geological hazard points corresponding to the vector tiles from the Dameng database;

[0020] Obtain the map resolution of the vector tile requested by the vector tile; based on the map resolution, thin the vector data of geological hazard hazard points; and then perform data assembly and format conversion on the vector data of geological hazard hazard points.

[0021] The diluted vector data of the geological hazard points are presented.

[0022] Preferably, obtaining the map resolution of vector tiles specifically includes:

[0023] First, calculate the resolution of the map level 0 in the tile pyramid object. Then, based on the distance between the map level specified in the vector tile request URL address and level 0, calculate the map resolution of the vector tile requested by the vector tile.

[0024] The calculation of map resolution at level 0 includes solving for the spatial resolutions resolutionX and resolutionY in the x and y directions, respectively:

[0025] resolutionX = (maxx-minx) / tileSize;

[0026] resolutionY = (maxy-miny) / tileSize;

[0027] The minimum value between resolutionX and resolutionY is taken as the map resolution resolution; where minx represents the minimum x-coordinate of the four corner points of the spatial coordinate system; maxx represents the maximum x-coordinate of the four corner points of the spatial coordinate system; miny represents the minimum y-coordinate of the four corner points of the spatial coordinate system; maxy represents the maximum y-coordinate of the four corner points of the spatial coordinate system; tileSize represents the size of the vector tile at level 0.

[0028] Preferred vector data of potential geological disaster sites specifically includes:

[0029] Geological hazard sites are classified according to the type of hazard as one or more of the following: unstable slope, landslide, collapse, debris flow, ground subsidence, ground settlement, and ground fissure.

[0030] Geological hazard sites are classified into four levels according to their degree of hazard and size: extra-large, large, medium, and small.

[0031] Geological hazard sites are classified according to the threatened objects as one or more of the following: towns, villages, railways, highways, shipping, irrigation canals, reservoirs, power stations, factories, mines, farms, forests, transmission lines, communication facilities, and national defense facilities.

[0032] Preferably, in the process of thinning the vector data of geological hazard hazard points based on the map resolution, it is necessary to first calculate the thinning threshold, which specifically includes:

[0033] From the hazard point vector data at the map level, a combination of hazard point data of one type is randomly selected. The hazard point data combination contains hazard point data from at least two vector tiles at map level 0. For the data combination, hazard point data with the same attribute are clustered as a spatial cluster, thereby obtaining different spatial distribution shapes presented by the combination of point location information. Wherein, the hazard point data with the same attribute refers to data that are identical in one or more of the following: hazard type, degree of harm and scale, and threatened object.

[0034] Based on the spatial distribution shape and density of the first clustering template in the case library, the spatial distribution shape and density of the clustering of the same attribute hidden danger point data as a spatial cluster are combined with the data, and the similarity between the two is assigned a weight.

[0035] Based on the spatial distribution shape and density of different attribute hazard points under different hazard types in the hazard point data combination, a similarity analysis is performed between the spatial distribution shape and density and the first cluster template, and each is assigned a weight, thereby generating a set of weight values; wherein, the first cluster template is used as the identification identifier for this set of weight values, and the weight values ​​within the set are identified by the associated hazard point attributes.

[0036] Using the remaining second clustering template, third clustering template, ..., nth clustering template, the weight values ​​of the vector data of hazard points with n-1 spatial distribution shapes and densities at the map level are calculated respectively, thus generating n-1 sets of weight values, which together with the initial set of weight values ​​constitute n sets of weight values; wherein, each set of weight values ​​is identified by its respective clustering template, and the weight values ​​within a set are identified by the associated hazard point attributes;

[0037] By determining the spatial distribution shape and density of potential hazard points with the same attribute in each data combination at the map level, and then generating a thinning threshold group based on the map resolution corresponding to the map level and the n sets of weight values.

[0038] Preferably, the first clustering template, the second clustering template, and the nth clustering template are generated based on historical geological disaster data and are organized according to the similar collection method of the geological disaster vector data to be imported. In actual operation, the corresponding clustering templates will be pre-adjusted or generated according to the temporal and spatial characteristics of the geological disaster vector data to be imported.

[0039] Preferably, the step of determining the spatial distribution shape and density of potential hazard points with the same attribute in each data combination at the map level, and then generating a thinning threshold group based on the map resolution corresponding to the map level and the n sets of weight values, specifically includes:

[0040] The thinning threshold group includes thinning thresholds corresponding to the same attribute potential points in each data combination; correspondingly, the thinning threshold for the same attribute potential points in each data combination is determined by the weight value associated with it, which determines the retention quota of potential points after thinning; and correspondingly, the thinning threshold for itself is calculated based on the spatial distribution shape, density calculation, map resolution, and retention quota.

[0041] Preferably, the step of thinning the vector data of geological hazard hazard points based on the map resolution specifically includes:

[0042] By determining the spatial distribution shape and density of potential hazard points with the same attribute in each data combination under the map level, and then generating a thinning threshold based on the map resolution corresponding to the map level and the n sets of weight values.

[0043] The preset parameter values ​​of the vector data associated with each potential hazard point are compared with the thinning threshold. Potential hazard points whose preset parameter values ​​of the corresponding vector data are less than the thinning threshold are thinned, while the remaining potential hazard points that are not thinned are presented as the thinned geological hazard point vector data.

[0044] Secondly, the present invention also provides an apparatus for generating vector tiles adapted to the DM database, used to implement the method for generating vector tiles adapted to the DM database described in the first aspect, the apparatus comprising:

[0045] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor for performing the method for generating vector tiles adapted to the DM database as described in the first aspect.

[0046] Thirdly, the present invention also provides a non-volatile computer storage medium storing computer-executable instructions that are executed by one or more processors to perform the method for generating vector tiles adapted to the DM database described in the first aspect.

[0047] This invention uses n sets of weight values ​​generated from n clustering templates as fingerprints to match historical vector tile data. This results in a system that, when updating the preset parameter values ​​of each vector tile in the entire map for newly added / deleted geological hazard vector data, can update the first vector tile data associated with the current target geological hazard vector data using only the preset parameter values ​​of the target vector tile, greatly improving efficiency.

[0048] In a preferred embodiment of the present invention, the vector elements under the vector tiles can be simplified while ensuring that the spatial distribution shape of the vector data is not destroyed. That is, the convex hull polygon of the point elements obtained by utilizing the actual spatial distribution of the vector point elements retains the original shape without distortion. Attached Figure Description

[0049] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments of the present invention will be briefly described below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.

[0050] Figure 1 This is a schematic flowchart of a method for generating vector tiles adapted to the DM database provided in an embodiment of the present invention;

[0051] Figure 2 This is a schematic flowchart of a method for generating vector tiles adapted to the DM database provided in an embodiment of the present invention;

[0052] Figure 3 These are schematic diagrams of several clustering templates provided in embodiments of the present invention;

[0053] Figure 4 This is a schematic flowchart of a method for generating vector tiles adapted to the DM database provided in an embodiment of the present invention;

[0054] Figure 5 This is a schematic diagram of a device structure for generating vector tiles adapted to the DM database, provided in an embodiment of the present invention. Detailed Implementation

[0055] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0056] In the description of this invention, the terms "inner", "outer", "longitudinal", "lateral", "upper", "lower", "top", "bottom", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and do not require that this invention must be constructed and operated in a specific orientation. Therefore, they should not be construed as limiting this invention.

[0057] Furthermore, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0058] Example 1:

[0059] This invention proposes a method for generating vector tiles adapted to the DM database, comprising:

[0060] When updating geological hazard vector data in corresponding vector tiles, and when it is necessary to update the preset parameter values ​​of each vector tile contained in the entire map for the newly added / deleted geological hazard vector data, the methods include:

[0061] The first vector tile containing the target geological hazard vector data to be assigned preset parameter values ​​is determined, as well as the attributes of the target geological hazard vector data; wherein, data of the same attribute of hidden danger points refers to data in which one or more of the following are the same: hidden danger type, degree of harm and scale, and threatened object;

[0062] Based on the spatial distribution shape and density of the first clustering template in the case library, and the spatial distribution shape and density of the clustering of the same attribute hazard points as the target geological disaster vector as a spatial cluster, a weight is assigned to the similarity between the two.

[0063] Based on the spatial distribution shape and density of hazard points with different attributes under different hazard types in the target geological hazard vector data, a weight is assigned to each of them by similarity analysis with the spatial distribution shape and density of the first cluster template, thereby generating a set of weight values ​​associated with the target geological hazard vector data; wherein, the first cluster template is used as the identification identifier for this set of weight values, and the weight values ​​within the set are identified by the attributes of each hazard point in the associated target geological hazard vector data.

[0064] Using the remaining second clustering template, third clustering template, ..., nth clustering template, the weight values ​​of the target geological hazard vector data with n-1 spatial distribution shapes and densities at the map level are calculated respectively, thus generating n-1 sets of weight values, which together with the initial set of weight values ​​constitute n sets of weight values;

[0065] Find n sets of target vector tiles with consistent weight values ​​in the vector tile library, and then obtain the preset parameter values ​​of the target geological disaster vector data from the preset parameter values ​​of the hidden danger points in the target vector tiles.

[0066] Example 2:

[0067] Embodiment 1 of this invention provides a method for generating vector tiles adapted to the Dameng database. In this embodiment, the vector data of geological disaster hazard points specifically includes geological disaster hazard points classified according to hazard type as one or more of unstable slopes, landslides, collapses, debris flows, ground subsidence, ground settlement, and ground fissures; geological disaster hazard points classified according to severity and scale as four levels: extra-large, large, medium, and small; and geological disaster hazard points classified according to the threatened object as one or more of the following: towns, villages, railways, highways, shipping, irrigation canals, reservoirs, power stations, factories, mines, farms, forests, transmission lines, communication facilities, and national defense facilities. Figure 1 As shown, it includes:

[0068] In step 201, vector tile information is obtained based on the vector tile request URL address. The vector tile information includes the map level where the vector tile is located, the map service name, and the row and column numbers of the vector tile.

[0069] In step 202, a tile pyramid object is instantiated based on the acquired vector tile information; at this point, the tile pyramid object has not yet loaded the vector data of geological disaster hazard points.

[0070] In step 203, based on the acquired vector tile information and the map resolution corresponding to the map level of the instantiated tile pyramid object, the coordinates of the four corner points of the vector tile sought by the vector tile request URL address are calculated.

[0071] At this point, the vector data of potential geological hazards in the corresponding vector tiles (also referred to as vector data in this embodiment of the invention) has not yet been loaded; it is merely the process of generating map content information.

[0072] In step 204, based on the coordinate range of the four corner points and the map service name, the vector data of the geological hazard points corresponding to the vector tiles are obtained from the Dameng database.

[0073] In step 205, the map resolution of the vector tile requested by the vector tile is obtained. Based on the map resolution, the vector data of geological hazard point is thinned, and then the vector data of geological hazard point is assembled and converted in format.

[0074] In step 206, the thinned vector data of the geological hazard hazard points is presented.

[0075] The embodiments of the present invention can simplify the vector elements under the vector tiles without destroying the spatial distribution shape of the vector data. That is, the convex hull polygon of the point elements obtained by using the actual spatial distribution of the vector point elements retains the original shape without distortion.

[0076] The core element lies in thinning the vector data of geological hazard points based on the map resolution. The true innovation of this invention is that it divides the vector data of geological hazard points into different attributes (data with the same attribute refers to data with one or more of the same hazard type, degree of harm and scale, or threatened object), and assigns a weight value to each attribute. This ensures that the thinning is performed according to the vector data of geological hazard points under each attribute, thus ensuring the consistency of the spatial distribution characteristics of the final thinning result.

[0077] In this embodiment of the invention, an optional implementation method for obtaining the map resolution of vector tiles is also provided, specifically including:

[0078] First, calculate the resolution of the map level 0 in the tile pyramid object. Then, based on the distance between the map level specified in the vector tile request URL address and level 0, calculate the map resolution of the vector tile requested by the vector tile.

[0079] The calculation of map resolution at level 0 includes solving for the spatial resolutions resolutionX and resolutionY in the x and y directions, respectively:

[0080] resolutionX = (maxx-minx) / tileSize;

[0081] resolutionY = (maxy-miny) / tileSize;

[0082] The minimum value between resolutionX and resolutionY is taken as the map resolution resolution; where minx represents the minimum x-coordinate of the four corner points of the spatial coordinate system; maxx represents the maximum x-coordinate of the four corner points of the spatial coordinate system; miny represents the minimum y-coordinate of the four corner points of the spatial coordinate system; maxy represents the maximum y-coordinate of the four corner points of the spatial coordinate system; tileSize represents the size of the vector tile at level 0.

[0083] In this embodiment of the invention, step 205 involves performing a thinning process on the vector data of geological hazard hazard points based on the map resolution. This requires first calculating the thinning threshold, such as... Figure 2 As shown, it specifically includes:

[0084] In step 2051, a combination of hazard point data of one type is randomly selected from the hazard point vector data at the map level. The hazard point data combination contains hazard point data from at least two vector tiles at map level 0. For the data combination, hazard point data of the same attribute are clustered as a spatial cluster, thereby obtaining different spatial distribution shapes presented by the combination of point location information.

[0085] The data on potential hazards with the same attributes refers to data that are identical in one or more of the following: hazard type, degree of harm and scale, and threatened object.

[0086] In step 2052, based on the spatial distribution shape and density of the first clustering template in the case library, the spatial distribution shape and density of the clustering of the same attribute hidden danger point data as a spatial cluster are combined with the data, and a weight is assigned to the similarity between the two.

[0087] The density mentioned here refers to the number of samples within the same region, which indicates a higher density.

[0088] What is meant here is that by associating the attribute content of geological hazard hazard points with their spatial distribution shape and density, a weighted expression under unified rule constraints can be formed. That is, the corresponding weights represent the similarity between the currently analyzed geological hazard hazard point data and the generated historical clustering template, thus forming the aforementioned weighted expression under unified rule constraints.

[0089] The specific values ​​to be taken under the corresponding rules are set based on human experience and are not the focus of this invention. To use a somewhat inaccurate analogy, it's similar to the traditional classification of earthquakes from magnitude 1 to 10, or typhoons from level 1 to 10. In the embodiments of this invention, a unified described weight is used. The setting of this weight is not intended to objectively and rigorously unify various geological hazards, but rather to provide a basis for judgment in the thinning process involved in this invention.

[0090] In step 2053, based on the spatial distribution shape and density of different attribute hazard points under different hazard types in the hazard point data combination, a similarity analysis is performed between the spatial distribution shape and density of the first cluster template, and each is assigned a weight, thereby generating a set of weight values.

[0091] The set of weight values ​​is identified by the first clustering template, while the weight values ​​within the set are identified by the associated hazard point attributes.

[0092] In step 2054, the weight values ​​of the hazard point vector data with n-1 spatial distribution shapes and densities under the map level are calculated from the remaining second clustering template, third clustering template, ..., nth clustering template, respectively, thus generating n-1 sets of weight values, which together with the initial set of weight values ​​constitute n sets of weight values.

[0093] Each set of weight values ​​is identified by its own clustering template, while the weight values ​​within a set are identified by the associated hazard point attributes.

[0094] In the specific implementation of this invention, considering the complexity of actual calculations, there are at least two dimensions that can compress the specific computational complexity of the scheme. One is to compress the number of clustering templates, which can reduce the total number of sets of corresponding weight values ​​generated. The other is to compress the total number of attribute classifications of geological disaster vector data. The most intuitive way is to generalize its degree of harm and scale, and reduce the impact of these two dimensions on attribute differentiation, etc. This is why one or more descriptive methods are used in the description of the technical solution of this invention.

[0095] In step 2055, by determining the spatial distribution shape and density of potential hazard points with the same attribute in each data combination under the map level, a thinning threshold group is generated according to the map resolution corresponding to the map level and the n sets of weight values.

[0096] The first, second, and nth clustering templates are generated based on historical geological disaster data and organized according to a similar collection method for the geological disaster vector data to be imported. In practice, the corresponding clustering templates are pre-adjusted or generated based on the temporal and spatial characteristics of the geological disaster vector data to be imported. Figure 3 The diagram shown is a schematic representation of the clustering template provided in the embodiment of the present invention.

[0097] In steps 2051-2055 above, determining the spatial distribution shape and density of potential hazard points with the same attribute in each data combination at the map level, and then generating a thinning threshold group based on the map resolution corresponding to the map level and the n sets of weight values, specifically includes:

[0098] The thinning threshold group includes thinning thresholds corresponding to the same attribute potential points in each data combination; correspondingly, the thinning threshold for the same attribute potential points in each data combination is determined by the weight value associated with it, which determines the retention quota of potential points after thinning; and correspondingly, the thinning threshold for itself is calculated based on the spatial distribution shape, density calculation, map resolution, and retention quota.

[0099] Furthermore, the thinning of the vector data of geological hazard hazard points based on the map resolution specifically includes:

[0100] By determining the spatial distribution shape and density of potential hazard points with the same attribute in each data combination under the map level, and then generating a thinning threshold based on the map resolution corresponding to the map level and the n sets of weight values.

[0101] The preset parameter values ​​of the vector data associated with each potential hazard point are compared with the thinning threshold. Potential hazard points whose preset parameter values ​​of the corresponding vector data are less than the thinning threshold are thinned, while the remaining potential hazard points that are not thinned are presented as the thinned geological hazard point vector data.

[0102] Example 3:

[0103] This invention primarily provides a method for generating vector tiles adapted to the DM database. It continues the approach from Embodiment 1, demonstrating the completeness of the solution within a specific scenario. While some terminology in this embodiment may not strictly adhere to the content of Embodiment 1, their interconnections can be reasonably deduced from the context and related steps. Therefore, further explanations and elaborations on these connections are omitted. Figure 4 As shown, it includes the following steps:

[0104] In step 301, obtain vector tile information: obtain the map level, row and column number, and tile size of the vector tile based on the vector tile request URL address.

[0105] Vector tile request URL generation: Load vector tile layers in the web map, and generate tile request URLs based on the tile pyramid of the map base map according to the map level and row and column numbers.

[0106] The complete vector tile request URL above is in the following format: http: / / IP:port / server / globe / services / mvt / {workspace} / {serviceName} / {coordinateSystem} / {z} / {x} / {y}.pbf;

[0107] layerName (representing the layer name) = {layerName};

[0108] &tileSize (representing tile size) = 256;

[0109] Main parameter descriptions:

[0110] The `coordinateSystem` parameter specifies the map coordinate system; the `serviceName` parameter specifies the map service name; the `workspace` parameter specifies the workspace name; the `z` parameter specifies the map level; the `x` parameter specifies the map coordinate column number; and the `y` parameter specifies the map coordinate row number.

[0111] In step 302, instantiate a TileInfo object: instantiate a TileInfo object based on the vector tile information obtained in step 301.

[0112] First, the map's level 0 resolution is calculated. The level 0 resolution is calculated using the following formulas to solve for the spatial resolution in the x and y directions respectively:

[0113] resolutionX = (maxx-minx) / tileSize;

[0114] resolutionY = (maxy-miny) / tileSize;

[0115] The minimum value between resolutionX and resolutionY is taken as resolution.

[0116] In the formula, minx represents the minimum x-coordinate of the four corner points of the spatial coordinate system. maxx represents the maximum x-coordinate of the four corner points of the spatial coordinate system. miny represents the minimum y-coordinate of the four corner points of the spatial coordinate system. maxy represents the maximum y-coordinate of the four corner points of the spatial coordinate system. tileSize represents the size of the vector tile.

[0117] The TileInfo format is as follows:

[0118] {

[0119] "dpi": "96" (standard DPI)

[0120] "format": "image / png",

[0121] "compressionQuality": 0,

[0122] "spatialReference": {

[0123] "wkid": "4326"

[0124] },

[0125] "rows": 256,

[0126] "cols": 256,

[0127] "origin": {

[0128] "x": -180,

[0129] "y": 90

[0130] },

[0131] "lods": [

[0132] { "level": 1, "resolution": resolution / Math.pow(2, 0), "scale":295497600 / Math.pow(2, 0)},

[0133] { "level": 2, "resolution": resolution / Math.pow(2, 1), "scale":295497600 / Math.pow(2, 1)},

[0134] { "level": 3, "resolution": resolution / Math.pow(2, 2), "scale":295497600 / Math.pow(2, 2)},

[0135] { "level": 4, "resolution": resolution / Math.pow(2, 3), "scale":295497600 / Math.pow(2, 3)},

[0136] { "level": 5, "resolution": resolution / Math.pow(2, 4), "scale":295497600 / Math.pow(2, 4)},

[0137] { "level": 6, "resolution": resolution / Math.pow(2, 5), "scale":295497600 / Math.pow(2, 5)},

[0138] { "level": 7, "resolution": resolution / Math.pow(2, 6), "scale":295497600 / Math.pow(2, 6)},

[0139] { "level": 8, "resolution": resolution / Math.pow(2, 7), "scale":295497600 / Math.pow(2, 7)},

[0140] { "level": 9, "resolution": resolution / Math.pow(2, 8), "scale":295497600 / Math.pow(2, 8)},

[0141] { "level": 10, "resolution": resolution / Math.pow(2, 9), "scale":295497600 / Math.pow(2, 9)},

[0142] { "level": 11, "resolution": resolution / Math.pow(2, 10), "scale":295497600 / Math.pow(2, 10)},

[0143] { "level": 12, "resolution": resolution / Math.pow(2, 11), "scale":295497600 / Math.pow(2, 11)},

[0144] { "level": 13, "resolution": resolution / Math.pow(2, 12), "scale":295497600 / Math.pow(2, 12)},

[0145] { "level": 14, "resolution": resolution / Math.pow(2, 13), "scale":295497600 / Math.pow(2, 13)},

[0146] { "level": 15, "resolution": resolution / Math.pow(2, 14), "scale":295497600 / Math.pow(2, 14)},

[0147] { "level": 16, "resolution": resolution / Math.pow(2, 15), "scale":295497600 / Math.pow(2, 15)},

[0148] { "level": 17, "resolution": resolution / Math.pow(2, 16), "scale":295497600 / Math.pow(2, 16)},

[0149] { "level": 18, "resolution": resolution / Math.pow(2, 17), "scale":295497600 / Math.pow(2, 17)},

[0150] { "level": 19, "resolution": resolution / Math.pow(2, 18), "scale":295497600 / Math.pow(2, 18)},

[0151] { "level": 20, "resolution": resolution / Math.pow(2, 19), "scale":295497600 / Math.pow(2, 19)} ]

[0153] }

[0154] Here, Math.pow(2, 19) represents a power of 2, indicating the reduction in resolution compared to level 0; while 295497600 is the default parameter value for the scale.

[0155] In step 303, the coordinates of the four corner points of the tile are calculated: based on the map tile information obtained in step 301 and the map resolution corresponding to the map level z of the TileInfo object in step 302, the coordinates of the four corner points of a tile are calculated.

[0156] In step 304, based on the coordinate range of the four corner points and the map service name, the vector data corresponding to the vector tiles is obtained from the Dameng database.

[0157] In step 305, the map resolution of the vector tiles is obtained, and the vector data is assembled and converted in format.

[0158] In step 306, the vector data is thinned and then converted to a new format based on the map resolution.

[0159] In step 307, the thinned vector data is used to generate vector tiles based on the Google Protox Buffer specification and then compressed and stored.

[0160] Specifically, step 303 involves the following preferred formula for calculating the coordinates of the four corner points of the tile:

[0161] xmin=TileInfo.origin.x+tileSize*resolution*x.

[0162] ymin=TileInfo.origin.y-tileSize*(y+1)*resolution.

[0163] xmax=TileInfo.origin.x+tileSize*resolution*(x+1).

[0164] ymax=TileInfo.origin.y-tileSize*y*resolution.

[0165] In the formula, xmin represents the minimum x-coordinate of the tile. xmax represents the maximum x-coordinate of the tile. ymin represents the minimum y-coordinate of the tile. ymax represents the maximum y-coordinate of the tile. TileInfo.origin.x represents the x-coordinate of the tile origin. TileInfo.origin.y represents the y-coordinate of the tile origin. tileSize represents the size of the vector tile. resolution represents the map resolution. y represents the row number of the map coordinate. x represents the column number of the map coordinate.

[0166] In step 304, specifically: obtaining vector data of spatial database type: mapping the vector tile service name to the table name in the DM database, and obtaining the DM database through the unique identifier of the map service (generated by combining the service's workspace and service name), using the coordinate range of the four corner points of the vector tile and the table field value filtering conditions as the SQL query statement of the spatial database engine, and obtaining the vector data within the coordinate range of the four corner points by executing the SQL query statement.

[0167] In step 305, the vector data obtained from the DM database is assembled and converted into a vector feature set with a uniform format.

[0168] In step 306, the specific steps are as follows: obtain the map resolution based on the map level where the vector tiles are located, calculate the thinning threshold for the vector point data based on the map resolution, compare it with the preset parameter value of the vector data, and determine whether the parameter value is less than the thinning threshold. If so, then the vector feature is clipped.

[0169] Calculating the thinning threshold: For example, in the case of geological hazard hazard vector data, a hazard data combination is randomly selected from the hazard vector data at the map level. The data combination contains hazard data from at least two vector tiles. For hazard data of the same attribute in the data combination, different weights are assigned to the corresponding spatial distribution of hazard vector data in the data combination based on the spatial distribution (obtaining the spatial distribution of convex hull polygon point features of hazard features) and density. This generates a set of weight values, which are then used to calculate the hazard vector data at the map level with the corresponding spatial distribution and density. By calculating the hazard vector data at the map level with n different spatial distributions and densities from the randomly selected hazard data combination, n sets of weight values ​​are generated. By determining the spatial distribution and density of each hazard vector data at the map level, a thinning threshold is generated based on the map resolution and the weight values ​​of the corresponding spatial distribution and density of the hazard vector data.

[0170] Preset parameter values ​​for vector data: For example, preset parameter values ​​for vector data of geological disaster hazard points. Based on the vector tile set, a vector tile is randomly selected to obtain the hazard point vector data within the coordinate range of its four corner points. For hazard point vector data of the same attribute, different weights are assigned to the corresponding types of hazard points in the vector tile according to the distribution position of the hazard point vector data in the vector tile and the different critical types of the hazard points, thereby generating a set of weight values. The hazard point vector data of n types in the vector tile are deduced from the hazard point vector data within the coordinate range of the four corner points of a randomly selected vector tile, thus generating n sets of weight values. Among the randomly selected different vector tiles, a target vector tile with n sets of weight values ​​are found, and the preset parameter values ​​of the hazard point vector data in each vector tile are deduced from the hazard point weights in the target vector tile.

[0171] In step 307, the thinned vector data is converted to the pbf format of the Google ProtoxBuffer specification, and the data is compressed by the LZ4 algorithm during data storage to reduce the size of the stored data.

[0172] Beneficial effects of the technical solution of this invention

[0173] The vector data thinning method and vector tile generation method first analyze the original vector information of the map, obtain vector data within the data range of the original vector information, generate vector tiles, and synthesize a new map. The method first thins the vector information, then generates vector tiles from the thinned vector information for visualization processing. During the visualization processing of vector tile stitching, the vector information has already been thinned, simplified, and compressed, which avoids the problems of low smoothness and poor image performance caused by excessively large vector information in traditional processing methods.

[0174] The vector data is compressed using the thinning algorithm described above. By dynamically combining the resolution of the vector tiles, the optimal simplification of vector data is achieved according to different levels, thereby greatly reducing the amount of data in the vector tiles while ensuring accuracy.

[0175] Example 3:

[0176] like Figure 5 The diagram shown is a schematic representation of the architecture of a device for generating vector tiles using the DM database according to an embodiment of the present invention. The device for generating vector tiles using the DM database in this embodiment includes one or more processors 21 and a memory 22. Figure 5 Take a processor 21 as an example.

[0177] Processor 21 and memory 22 can be connected via a bus or other means. Figure 5Taking the example of a connection between China and Israel via a bus.

[0178] The memory 22, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs and non-volatile computer-executable programs, such as the method for generating vector tiles adapted to the DM database in Embodiment 1. The processor 21 executes the method for generating vector tiles adapted to the DM database by running the non-volatile software program and instructions stored in the memory 22.

[0179] Memory 22 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 22 may optionally include memory remotely located relative to processor 21, which can be connected to processor 21 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0180] The program instructions / modules are stored in the memory 22. When executed by one or more processors 21, they perform the method for generating vector tiles adapted to the DM database in Embodiment 1 above, for example, performing the above-described method. Figure 1 and Figure 2 The steps shown.

[0181] It is worth noting that the information interaction and execution process between the modules and units in the above-mentioned device and system are based on the same concept as the processing method embodiment of the present invention. For details, please refer to the description in the method embodiment of the present invention, and will not be repeated here.

[0182] Those skilled in the art will understand that all or part of the steps in the various methods of the embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc.

[0183] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for generating vector tiles adapted to the DM database, characterized in that, When updating geological hazard vector data in corresponding vector tiles, the methods include: The first vector tile containing the target geological hazard vector data to be assigned preset parameter values ​​is determined, as well as the attributes of the target geological hazard vector data; wherein, hazard point data with the same attribute refers to data that has one or more of the same hazard type, degree of harm and scale, and threatened object; Based on the spatial distribution shape and density of the first clustering template in the case library, and the spatial distribution shape and density of the clustering of the same attribute hazard points as the target geological disaster vector as a spatial cluster, a weight is assigned to the similarity between the two. Based on the spatial distribution shape and density of hazard points with different attributes under different hazard types in the target geological hazard vector data, a weight is assigned to each of them by similarity analysis with the spatial distribution shape and density of the first cluster template, thereby generating a set of weight values ​​associated with the target geological hazard vector data; wherein, the first cluster template is used as the identification identifier for this set of weight values, and the weight values ​​within the set are identified by the attributes of each hazard point in the associated target geological hazard vector data. Using the remaining second clustering template, third clustering template, ..., nth clustering template, the weight values ​​of the target geological hazard vector data with n-1 spatial distribution shapes and densities at the map level are calculated respectively, thus generating n-1 sets of weight values, which together with the initial set of weight values ​​constitute n sets of weight values; Find n sets of target vector tiles with consistent weight values ​​in the vector tile library, and then obtain the preset parameter values ​​of the target geological disaster vector data from the preset parameter values ​​of the hidden danger points in the target vector tiles.

2. The method for generating vector tiles adapted to the DM database according to claim 1, characterized in that, Without involving updates to the geological hazard vector data, the normal vector tile processing procedure includes: The vector tile information is obtained from the vector tile request URL address. The vector tile information includes the map level where the vector tile is located, the map service name, and the row and column numbers of the vector tile. Based on the acquired vector tile information, a tile pyramid object is instantiated; at this point, the tile pyramid object has not yet loaded the vector data of geological disaster hazard points. Based on the obtained vector tile information and the map resolution corresponding to the map level of the instantiated tile pyramid object, calculate the coordinates of the four corner points of the vector tile sought by the vector tile request URL address; Based on the coordinate range of the four corner points and the map service name, obtain the vector data of geological hazard points corresponding to the vector tiles from the Dameng database; Obtain the map resolution of the vector tile requested by the vector tile; based on the map resolution, thin the vector data of geological hazard hazard points; and then perform data assembly and format conversion on the vector data of geological hazard hazard points. The diluted vector data of the geological hazard points are presented.

3. The method for generating vector tiles adapted to the DM database according to claim 2, characterized in that, Obtain the map resolution of vector tiles, specifically including: First, calculate the resolution of the map level 0 in the tile pyramid object. Then, based on the distance between the map level specified in the vector tile request URL address and level 0, calculate the map resolution of the vector tile requested by the vector tile. The calculation of map resolution at level 0 includes solving for the spatial resolutions resolutionX and resolutionY in the x and y directions, respectively: resolutionX = (maxx-minx) / tileSize; resolutionY = (maxy-miny) / tileSize; The minimum value between resolutionX and resolutionY is taken as the map resolution resolution; where minx represents the minimum x-coordinate of the four corner points of the spatial coordinate system; maxx represents the maximum x-coordinate of the four corner points of the spatial coordinate system; miny represents the minimum y-coordinate of the four corner points of the spatial coordinate system; maxy represents the maximum y-coordinate of the four corner points of the spatial coordinate system; tileSize represents the size of the vector tile at level 0.

4. The method for generating vector tiles adapted to the DM database according to claim 2, characterized in that, Vector data of potential geological hazards, specifically including: Geological hazard points are classified according to the type of hazard into one or more of the following: unstable slope, landslide, collapse, debris flow, ground subsidence, ground settlement, and ground fissure. Geological hazard sites are classified into four levels according to their degree of hazard and size: extra-large, large, medium, and small. Geological hazard sites are classified according to the threatened objects as one or more of the following: towns, villages, railways, highways, shipping, irrigation canals, reservoirs, power stations, factories, mines, farms, forests, transmission lines, communication facilities, and national defense facilities.

5. The method for generating vector tiles adapted to the DM database according to claim 4, characterized in that, During the process of thinning the vector data of geological hazard hazard points based on the aforementioned map resolution, it is necessary to first calculate the thinning threshold, which specifically includes: From the hazard point vector data at the map level, a combination of hazard point data of one type is randomly selected. The hazard point data combination contains hazard point data from at least two vector tiles at map level 0. For the data combination, hazard point data with the same attribute are clustered as a spatial cluster, thereby obtaining different spatial distribution shapes presented by the combination of point location information. Wherein, the hazard point data with the same attribute refers to data that are identical in one or more of the following: hazard type, degree of harm and scale, and threatened object. Based on the spatial distribution shape and density of the first clustering template in the case library, the spatial distribution shape and density of the clustering of the same attribute hidden danger point data as a spatial cluster are combined with the data, and the similarity between the two is assigned a weight. Based on the spatial distribution shape and density of different attribute hazard points under different hazard types in the hazard point data combination, a similarity analysis is performed between the spatial distribution shape and density and the first cluster template, and each is assigned a weight, thereby generating a set of weight values; wherein, the first cluster template is used as the identification identifier for this set of weight values, and the weight values ​​within the set are identified by the associated hazard point attributes. Using the remaining second clustering template, third clustering template, ..., nth clustering template, the weight values ​​of the vector data of hazard points with n-1 spatial distribution shapes and densities at the map level are calculated respectively, thus generating n-1 sets of weight values, which together with the initial set of weight values ​​constitute n sets of weight values; wherein, each set of weight values ​​is identified by its respective clustering template, and the weight values ​​within a set are identified by the associated hazard point attributes; By determining the spatial distribution shape and density of potential hazard points with the same attribute in each data combination at the map level, and then generating a thinning threshold group based on the map resolution corresponding to the map level and the n sets of weight values.

6. The method for generating vector tiles adapted to the DM database according to claim 5, characterized in that, The first clustering template, the second clustering template, and the nth clustering template are generated based on historical geological disaster data and are organized according to the similarity collection method of the current geological disaster vector data to be imported. In practice, the corresponding clustering templates will be pre-adjusted or generated based on the temporal and spatial characteristics of the geological disaster vector data to be imported.

7. The method for generating vector tiles adapted to the DM database according to claim 5, characterized in that, The process of determining the spatial distribution shape and density of potential hazard points with the same attribute in each data combination at the map level, and then generating a thinning threshold group based on the map resolution corresponding to the map level and the n sets of weight values, specifically includes: The thinning threshold group includes thinning thresholds corresponding to the same attribute potential points in each data combination; correspondingly, the thinning threshold for the same attribute potential points in each data combination is determined by the weight value associated with it, which determines the retention quota of potential points after thinning; and correspondingly, the thinning threshold for itself is calculated based on the spatial distribution shape, density calculation, map resolution, and retention quota.

8. The method for generating vector tiles adapted to the DM database according to claim 5, characterized in that, The process of thinning the vector data of geological hazard hazard points based on the map resolution specifically includes: By determining the spatial distribution shape and density of potential hazard points with the same attribute in each data combination under the map level, and then generating a thinning threshold based on the map resolution corresponding to the map level and the n sets of weight values. The preset parameter values ​​of the vector data associated with each potential hazard point are compared with the thinning threshold. Potential hazard points whose preset parameter values ​​of the corresponding vector data are less than the thinning threshold are thinned, while the remaining potential hazard points that are not thinned are presented as the thinned geological hazard point vector data.

9. The method for generating vector tiles adapted to the DM database according to claim 5, characterized in that, The process of assigning the preset parameter value specifically includes: The preset parameter values ​​of potential hazards in the entire map are calculated and set using a random value algorithm, so that the preset parameter values ​​of potential hazards in the entire map satisfy a normal distribution.

10. A device for generating vector tiles adapted to the DM database, characterized in that, The device includes: At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor for performing the method for generating vector tiles adapted to the DM database according to any one of claims 1-9.