A method and apparatus for generating vector tiles by thinning vector features.

By using vector feature thinning to generate vector tiles, the problem of slow display speed and poor effect of vector data is solved. This simplifies the data volume, improves the display effect, avoids browser crashes, and enhances the browsing experience.

CN117009607BActive Publication Date: 2025-10-28武汉达梦数据技术有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310386698.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-07
Publication Date
2025-10-28
Estimated Expiration
2043-04-07

AI Technical Summary

Technical Problem

Existing technologies suffer from slow output speed and poor display quality when displaying large amounts of data in vector data, and lack a unified solution, leading to browser crashes and a poor browsing experience.

Method used

The method of generating vector tiles by thinning vector features involves obtaining vector tile information, calculating the coordinates of the four corner points, acquiring vector data of potential geological hazards, thinning the data based on map resolution, and then assembling and converting the data format to generate vector tiles.

Benefits of technology

While ensuring that the spatial distribution shape of vector data is not destroyed, the amount of vector tile data is simplified, the display speed and effect are improved, browser crashes are avoided, and the browsing experience is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117009607B_ABST
    Figure CN117009607B_ABST
Patent Text Reader

Abstract

This invention relates to the field of vector tile technology, and provides a method and apparatus for generating vector tiles by thinning vector features. Based on the coordinate range of the four corner points and the map service name, vector data of geological hazard points corresponding to the vector tiles are obtained from a spatial data source; the map resolution of the requested vector tiles is obtained; the geological hazard point vector data is thinned based on the map resolution; the geological hazard point vector data is then assembled and its format converted; and the thinned geological hazard point vector data is presented. This invention can simplify vector features under vector tiles without destroying the spatial distribution shape of the 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 by thinning vector elements. 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] 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.

[0004] In view of this, overcoming the defects of the prior art is an urgent problem to be solved in this technical field. Summary of the Invention

[0005] The technical problem to be solved by the present invention is the slow output speed and fixed display effect of vector data display when displaying large amounts of data in the prior art.

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

[0007] A method for generating vector tiles by thinning vector features includes:

[0008] 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.

[0009] 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.

[0010] 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;

[0011] 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 spatial data source;

[0012] 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 assemble and convert the vector data of geological hazard hazard points.

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

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

[0015] 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.

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

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

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

[0019] 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.

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

[0021] 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.

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

[0023] 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.

[0024] 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:

[0025] 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.

[0026] 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.

[0027] 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.

[0028] 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;

[0029] 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.

[0030] 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.

[0031] 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:

[0032] 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.

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

[0034] 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.

[0035] 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.

[0036] Preferably, the process of assigning the preset parameter value specifically includes:

[0037] The preset parameter values ​​for potential hazard points throughout the entire map are calculated and set using a random value algorithm.

[0038] Secondly, the present invention also provides an apparatus for generating vector tiles by thinning vector features, used to implement the method for generating vector tiles by thinning vector features as described in the first aspect, the apparatus comprising:

[0039] 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 of generating vector tiles by vector feature thinning as described in the first aspect.

[0040] 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 by thinning vector features as described in the first aspect.

[0041] This invention simplifies vector elements under vector tiles without destroying the spatial distribution shape of vector data. It uses the actual spatial distribution of vector point elements to obtain the convex hull polygon of the point elements and retains the original shape without distortion. Attached Figure Description

[0042] 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.

[0043] Figure 1 This is a schematic flowchart of a method for generating vector tiles by thinning vector features according to an embodiment of the present invention;

[0044] Figure 2 This is a schematic flowchart of a method for generating vector tiles by thinning vector features according to an embodiment of the present invention;

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

[0046] Figure 4 This is a schematic flowchart of a method for generating vector tiles by thinning vector features according to an embodiment of the present invention;

[0047] Figure 5 This is a schematic diagram of a device for generating vector tiles by thinning vector elements according to an embodiment of the present invention. Detailed Implementation

[0048] 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.

[0049] 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.

[0050] 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.

[0051] Example 1:

[0052] Embodiment 1 of this invention provides a method for generating vector tiles by thinning vector features. In this embodiment, the vector data of geological hazard points specifically includes geological 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 hazard points classified according to severity and scale as four levels: extra-large, large, medium, and small; and geological 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:

[0053] 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.

[0054] 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.

[0055] 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.

[0056] 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.

[0057] 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 spatial data source.

[0058] 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.

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

[0060] Existing vector feature thinning methods cannot guarantee uniform distribution of vector data after simplification. Furthermore, the generated tiles are static tiles or do not support custom thinning parameter settings for each map level based on the specific business characteristics of the data. This invention simplifies vector features under vector tiles without destroying the spatial distribution shape of the vector data. Specifically, it uses the actual spatial distribution of vector point features to obtain the convex hull polygons of the point features, preserving their original shape without distortion.

[0061] 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.

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

[0063] 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.

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

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

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

[0067] 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.

[0068] 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, specifically including:

[0069] 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.

[0070] 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.

[0071] 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.

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

[0073] 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.

[0074] 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.

[0075] 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.

[0076] 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.

[0077] 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.

[0078] 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.

[0079] 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.

[0080] 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.

[0081] 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.

[0082] 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:

[0083] 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.

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

[0085] 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.

[0086] 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.

[0087] In this invention, the process of assigning the preset parameter values ​​also employs an optional method, namely, calculating and setting the preset parameter values ​​of the hidden danger points throughout the entire map using a random value algorithm.

[0088] Example 2:

[0089] This invention primarily provides a method for generating vector tiles by thinning vector elements. 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, excessive explanations or elaborations on these connections are omitted. Figure 4 As shown, it includes the following steps:

[0090] 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.

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

[0092] The complete vector tile request URL above is in the following format: http: / / IP:8788 / dmglobe-serverx / dmglobe / services / mvt / {workspace} / {serviceName} / {coordinateSystem} / {z} / {x} / {y}.pbf;

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

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

[0095] Main parameter descriptions:

[0096] 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.

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

[0098] 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:

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

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

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

[0102] 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.

[0103] The TileInfo format is as follows:

[0104] {

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

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

[0107] "compressionQuality": 0,

[0108] "spatialReference": {

[0109] "wkid": "4326"

[0110] },

[0111] "rows": 256,

[0112] "cols": 256,

[0113] "origin": {

[0114] "x": -180,

[0115] "y": 90

[0116] },

[0117] "lods": [

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0139] }

[0140] 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.

[0141] 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.

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

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

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

[0145] 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.

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

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

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

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

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

[0151] 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.

[0152] In step 304, specifically: obtaining vector data of spatial database type: mapping the vector tile service name to the table name in the spatial data source, and obtaining the spatial data source through the unique identifier of the map service (generated by combining the workspace to which the service belongs and the 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.

[0153] In step 305, the vector data obtained from the spatial data source is assembled and converted into a vector feature set with a uniform format.

[0154] 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.

[0155] 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.

[0156] 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.

[0157] 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.

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

[0159] 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.

[0160] The vector data is compressed using the thinning algorithm, which dynamically combines the resolution of the vector tiles to achieve optimal vector data simplification at different levels, thereby greatly reducing the amount of vector tile data while ensuring accuracy.

[0161] Example 3:

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

[0163] The processor 21 and the memory 22 may be connected via a bus or other means. Figure 5 The bus connection is taken as an example.

[0164] 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 by thinning vector features in Embodiment 1. The processor 21 executes the method for generating vector tiles by running the non-volatile software program and instructions stored in the memory 22.

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

[0166] The program instructions / modules are stored in the memory 22. When executed by one or more processors 21, they perform the vector feature thinning and vector tile generation method described in Embodiment 1 above. For example, they perform the above-described... Figure 1 and Figure 2 The steps shown.

[0167] It is worth noting that the information interaction, execution process, etc. between the modules and units within the above-mentioned devices and systems are based on the same concept as the processing method embodiment of the present invention. The specific content can be found in the description of the method embodiment of the present invention and will not be repeated here.

[0168] 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.

[0169] 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 by thinning vector features, characterized in that, include: 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 spatial data source; 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 assemble and convert the vector data of geological hazard hazard points. The diluted vector data of the geological hazard hazard points are presented. In this process, a combination of hazard point data of one type is randomly selected from the map-level hazard point vector data. This combination includes hazard point data from at least two vector tiles at map level 0. For each data combination, hazard points with the same attribute are clustered into a spatial cluster, resulting in different spatial distribution shapes formed by combining point location information. The hazard points with the same attribute refer to data sharing one or more of the following characteristics: hazard type, severity and scale, and threat object. The spatial distribution shape and density of the first clustering template in the case library are compared with the spatial distribution shape and density of the cluster formed by the hazard points with the same attribute in the data combination, and a weight is assigned to the similarity between the two. The spatial distribution shapes and densities generated based on the different attribute hazard points of different hazard types in the hazard point data combination are compared with the first clustering template. Similarity analysis is performed between the spatial distribution shape and density of the templates, and weights are assigned to each, thereby generating a set of weight values. This set of weight values ​​uses the first clustering template as the identification identifier, while the weight values ​​within the set use the associated hazard point attributes as the identification identifier. The remaining second, third, ..., nth clustering templates are used to calculate the weight values ​​of the hazard point vector data for n-1 spatial distribution shapes and densities at the map level, generating n-1 sets of weight values, which, together with the initial set of weight values, constitute n sets of weight values. Each set of weight values ​​uses its respective clustering template as the identification identifier, while the weight values ​​within the set use the associated hazard point attributes as the identification identifier. By determining the spatial distribution shape and density of hazard points with the same attribute in each data combination at the map level, a thinning threshold group is generated based on the map resolution corresponding to the map level and the n sets of weight values.

2. The method for generating vector tiles by thinning vector features according to claim 1, 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.

3. The method for generating vector tiles by thinning vector features according to claim 1, 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.

4. The method for generating vector tiles by thinning vector features according to claim 1, 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.

5. The method for generating vector tiles by thinning vector features according to claim 1, 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.

6. The method for generating vector tiles by thinning vector features according to claim 1, 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.

7. The method for generating vector tiles by thinning vector features according to claim 6, 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.

8. An apparatus for thinning vector features to generate vector tiles, 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 of generating vector tiles by thinning vector features according to any one of claims 1-7.

Citation Information

Patent Citations

  • Vector tile generation method and system adaptive to multiple data sources

    CN113535867A

  • Refined efficient dynamic tile map service publishing method, medium and electronic equipment

    CN114297206A