A vector tile generation method and system suitable for multiple data sources

By acquiring and converting data from multiple spatial data sources, and combining the Douglas thinning algorithm to simplify the data, the problems of cross-data source assembly and large data volume in vector tile technology are solved, achieving high compatibility and high accuracy in vector tile generation.

CN113535867BActive Publication Date: 2026-01-16福建省自然资源地理信息中心(福建省基础地理遥感影像应用中心、高分辨率对地观测系统福建数据与应用中心)
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110600812.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-31
Publication Date
2026-01-16
Estimated Expiration
2041-05-31

AI Technical Summary

Technical Problem

Existing vector tile technology cannot achieve on-demand assembly and real-time generation across spatial data sources, and the data volume is greatly affected by the map scale, leading to compatibility and accuracy issues.

Method used

By automatically acquiring spatial data corresponding to vector tiles from multiple spatial data sources, performing format conversion and data assembly, and using the Douglas thinning algorithm to simplify the data volume according to the scale, vector tiles conforming to the Mapbox specification are generated.

Benefits of technology

It improves compatibility with multiple data sources and reduces data volume, ensuring accuracy while reducing the amount of vector tile data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113535867B_ABST
    Figure CN113535867B_ABST
Patent Text Reader

Abstract

The application provides a vector tile generation method and system suitable for adapting multiple data sources in the technical field of electronic maps, and the method comprises the following steps: step S10, calculating the longitude and latitude range based on the level and row and column number of the tile pyramid where the vector tile is located, and obtaining the map layer corresponding to the vector tile from a configuration file; step S20, obtaining the spatial data corresponding to the vector tile from a spatial data source based on the longitude and latitude range and the map layer; step S30, performing data assembly and format conversion on the spatial data; step S40, obtaining the scale of the vector tile, and simplifying the spatial data after format conversion based on the scale; and step S50, generating the vector tile based on the simplified spatial data according to the vector tile specification of Mapbox. The application has the advantages that data is assembled on demand, the compatibility of the data source is greatly improved, and the data amount is greatly simplified.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of electronic map, and particularly discloses a vector tile generation method and system suitable for multiple data sources. BACKGROUND

[0002] Currently, mainstream GIS platforms generally use map tile caching technology to speed up map access, reduce server load and improve user experience. Map tile caching technology is to map the remote sensing image data and map vector data, generate fixed-size raster pictures (raster tiles) according to the scale through mainstream GIS software, and then publish them into standard OGC map services for client use.

[0003] Since the raster picture fixes the data and map style of the map into the picture, it has the problems of low clarity and unmodifiable style. With the emergence of Mapbox open source vector tile technology, the deficiencies of raster pictures are solved, and the map display style can be dynamically modified according to actual needs during map rendering, and finally the visualization precision of the map is improved in the vector data rendering mode. However, the traditional vector tile technology is generated through commercial software or open source tools, which has certain limitations and requirements for spatial data sources, and cannot realize on-demand assembly and real-time generation of data across spatial data sources. Although the data volume of vector tiles is significantly reduced compared with raster tiles, the larger the latitude and longitude range of a tile is, the more vector data elements it contains, resulting in larger data volume of the generated vector tiles.

[0004] Therefore, how to provide a vector tile generation method and system suitable for multiple data sources, realize on-demand data assembly, improve data source compatibility, and reduce vector tile data volume while ensuring precision, has become a problem to be solved. SUMMARY

[0005] The technical problem to be solved by the present application is to provide a vector tile generation method and system suitable for multiple data sources, realize on-demand data assembly, improve data source compatibility, and reduce vector tile data volume while ensuring precision.

[0006] In a first aspect, the present application provides a vector tile generation method suitable for multiple data sources, comprising the following steps:

[0007] Step S10, calculating the latitude and longitude range based on the level of the tile pyramid where the vector tile is located and the row and column number, and obtaining the map layer corresponding to the vector tile from the configuration file;

[0008] Step S20, obtaining the spatial data corresponding to the vector tile from the spatial data source based on the latitude and longitude range and the map layer;

[0009] Step S30, data assembly and format conversion of the spatial data;

[0010] Step S40, obtaining the scale of the vector tile, simplifying the format-converted spatial data based on the scale;

[0011] Step S50, generating the vector tile based on the simplified spatial data according to the vector tile specification of Mapbox.

[0012] Further, the step S20 specifically comprises:

[0013] Obtaining the database-type spatial data: corresponding the layer name of the map layer to the table name of the spatial database, taking the longitude and latitude range of the vector tile as the SQL query statement of the spatial database engine, and obtaining the spatial data within the longitude and latitude range by executing the SQL query statement;

[0014] Obtaining the file-type spatial data: obtaining the spatial data file through the layer name of the map layer, constructing the longitude and latitude range of the vector tile into a geometric object, and performing spatial overlay analysis with the spatial data file, and then cutting out the spatial data within the longitude and latitude range.

[0015] Further, the spatial database at least includes Oracle Spatial, SqlServer Spatial, PostGIS, MySQL Spatial and SpatiaLite.

[0016] The file type of the spatial data file at least includes Shapefile, GeoJSON, GeoBuf, FileGDB, MDB and KML.

[0017] Further, the step S30 specifically comprises:

[0018] Assembling the spatial data obtained from different spatial data sources, and converting the spatial data into a spatial data set with unified format.

[0019] Further, the step S40 specifically comprises:

[0020] Obtaining the scale of the vector tile based on the level of the tile pyramid where the vector tile is located, calculating the threshold distance based on the scale, and simplifying the format-converted spatial data by using the Douglas thinning algorithm combined with the threshold distance.

[0021] In the second aspect, the application provides a vector tile generation system suitable for multiple data sources, comprising the following modules:

[0022] The map initialization module is configured to calculate a latitude and longitude range based on a level of a tile pyramid in which the vector tile is located and a row and column number, and obtain a map layer corresponding to the vector tile from a configuration file;

[0023] The spatial data access module is configured to obtain spatial data corresponding to the vector tile from a spatial data source based on the latitude and longitude range and the map layer;

[0024] The spatial data adaptation module is configured to assemble and convert the spatial data.

[0025] The spatial data simplification module is configured to obtain a scale of the vector tile, and simplify the spatial data after the conversion based on the scale.

[0026] The vector tile generation module is configured to generate a vector tile based on a Mapbox vector tile specification from the simplified spatial data.

[0027] Further, the spatial data access module specifically includes:

[0028] The spatial data access module is configured to obtain spatial data in the latitude and longitude range by executing a SQL query statement of a spatial database engine based on the latitude and longitude range of the vector tile.

[0029] The spatial data access module is configured to obtain a spatial data file through the layer name of the map layer, and to obtain the spatial data in the latitude and longitude range by constructing the latitude and longitude range into a geometric object and performing spatial overlay analysis on the spatial data file.

[0030] Further, the spatial database at least includes Oracle Spatial, SqlServer Spatial, PostGIS, MySQL Spatial, and SpatiaLite.

[0031] The file type of the spatial data file at least includes Shapefile, GeoJSON, GeoBuf, FileGDB, MDB, and KML.

[0032] Further, the spatial data adaptation module specifically includes:

[0033] The spatial data adaptation module is configured to assemble the spatial data obtained from different spatial data sources, and to convert the spatial data into a spatial data set with a unified format.

[0034] Further, the spatial data simplification module specifically includes:

[0035] The scale of the vector tile is obtained based on the level of the tile pyramid in which the vector tile is located, a threshold distance is calculated based on the scale, and the spatial data after format conversion is simplified by using a Douglas-Poole simplification algorithm combined with the threshold distance.

[0036] The present application has the advantages of:

[0037] 1. By automatically obtaining the spatial data corresponding to the vector tile from a spatial database of the type of Oracle Spatial, SqlServer Spatial, PostGIS, MySQL Spatial, SpatiaLite, or by automatically obtaining the spatial data corresponding to the vector tile from file-type spatial data of the type of Shapefile, GeoJSON, GeoBuf, FileGDB, MDB, KML, and performing uniform format conversion on the spatial data, the corresponding spatial data can be assembled in real time on demand from different types of spatial data sources according to actual needs, avoiding the traditional inability to realize on-demand assembly of data across spatial data sources, real-time generation, and thereby greatly improving the compatibility of the data source.

[0038] 2. The spatial data is simplified by the Douglas-Poole simplification algorithm, and the threshold distance used by the Douglas-Poole simplification algorithm is calculated based on the scale of the vector tile, i.e., dynamically combined with the resolution of the vector tile, to achieve optimal simplification of the vector data according to different levels, thereby greatly reducing the data volume of the vector tile while ensuring accuracy. BRIEF DESCRIPTION OF DRAWINGS

[0039] The present application will be further described below with reference to the accompanying drawings and embodiments.

[0040] Fig. 1 is a flowchart of a vector tile generation method adapted to multiple data sources according to the present application.

[0041] Fig. 2 is a structural schematic diagram of a vector tile generation system adapted to multiple data sources according to the present application.

[0042] Fig. 3 is a structural schematic diagram of a tile pyramid according to the present application. DETAILED DESCRIPTION

[0043] The technical solutions in the embodiments of the present application have the following general idea: spatial data corresponding to a vector tile is automatically obtained from a spatial database of the type Oracle Spatial, SqlServer Spatial, PostGIS, MySQL Spatial, or SpatiaLite, or is automatically obtained from file-type spatial data of the type Shapefile, GeoJSON, GeoBuf, FileGDB, MDB, or KML, so as to improve the compatibility of data sources; the spatial data is simplified by using the Douglas-Poole thinning algorithm, and the resolution of the vector tile is dynamically combined, so that optimal simplification of the vector data is achieved according to different levels.

[0044] Please refer to Figs. 1 to 3 A preferred embodiment of a vector tile generation method suitable for multiple data sources provided by the present application comprises the following steps:

[0045] Step S10: Calculate the latitude and longitude range based on the level and the row and column number of the tile pyramid in which the vector tile is located, and obtain the map layer corresponding to the vector tile from a configuration file;

[0046] Step S20: Obtain spatial data corresponding to the vector tile from a spatial data source based on the latitude and longitude range and the map layer, that is, obtain the required spatial data from multiple spatial data sources; the spatial data source is a spatial database or a spatial data file;

[0047] Step S30: Perform data assembly and format conversion on the spatial data;

[0048] Step S40: Obtain the scale of the vector tile, and simplify the spatial data after format conversion based on the scale;

[0049] Step S50: Generate a vector tile based on the simplified spatial data and the vector tile specification of Mapbox.

[0050] As Fig. 3As shown, the tile pyramid is a kind of multi-resolution hierarchical model, from the bottom layer to the top layer of the tile pyramid, the resolution is lower and lower, but the geographical range represented is unchanged. First, the number N of zoom levels to be provided by the map service platform is determined, the map picture with the highest zoom level and the largest map scale is taken as the bottom layer, i.e. the 0th layer, and is blocked, starting from the top left corner of the map picture, cutting from left to right and from top to bottom to cut into square map tiles of the same size (such as 256x256 pixels) to form the 0th layer tile matrix; on the basis of the 0th layer map picture, the 1st layer map picture is generated by dividing each pixel into 2x2 pixels, and is blocked to divide into square map tiles of the same size as the next layer to form the 1st layer tile matrix; the 2nd layer tile matrix is generated by the same method; and so on, until the Nth layer, to constitute the entire tile pyramid.

[0051] The step S20 is specifically:

[0052] Obtaining database type spatial data: corresponding the layer name of the map layer to the table name of the spatial database, based on the latitude and longitude range of the vector tile as a SQL query statement of a spatial database engine, obtaining the spatial data within the latitude and longitude range by executing the SQL query statement;

[0053] Obtaining file type spatial data: obtaining a spatial data file through the layer name of the map layer, constructing the latitude and longitude range of the vector tile into a geometric object and performing spatial overlay analysis with the spatial data file, and taking out the spatial data within the latitude and longitude range after cutting.

[0054] The spatial database at least includes Oracle Spatial, SqlServer Spatial, PostGIS, MySQLSpatial and SpatiaLite;

[0055] The file type of the spatial data file at least includes Shapefile, GeoJSON, GeoBuf, FileGDB, MDB and KML.

[0056] The step S30 is specifically:

[0057] The spatial data obtained from different spatial data sources is assembled and converted into a spatial data set with unified format, stored in the computer memory, and the multi-source data is assembled on demand; each element in the spatial data set contains geometric data and corresponding key-value pair attributes, and then the spatial data sets are combined and added to the corresponding map layer of the vector tile to provide a data source for spatial data simplification.

[0058] The step S40 is specifically:

[0059] The scale of the vector tile is obtained based on its level within the tile pyramid. A threshold distance is then calculated based on this scale. The Douglas thinning algorithm, combined with this threshold distance, is used to simplify the spatial data after format conversion. The threshold distance is preferably set to 0.1 times the resolution value corresponding to the scale. Simplifying the spatial data using the Douglas thinning algorithm combined with the threshold distance reduces the amount of vector tile data while maintaining accuracy.

[0060] A preferred embodiment of the vector tile generation system adapted to multiple data sources according to the present invention includes the following modules:

[0061] The map initialization module is used to calculate the latitude and longitude range based on the level and row and column numbers of the tile pyramid where the vector tile is located, and to obtain the map layer corresponding to the vector tile from the configuration file.

[0062] The spatial data access module is used to obtain spatial data corresponding to vector tiles from a spatial data source based on the latitude and longitude range and map layer, that is, to obtain the required spatial data from a multi-source spatial data source; the spatial data source is a spatial database or a spatial data file.

[0063] A spatial data adaptation module is used to assemble and convert the spatial data.

[0064] The spatial data simplification module is used to obtain the scale of the vector tiles and simplify the spatial data after format conversion based on the scale.

[0065] The vector tile generation module is used to generate vector tiles from the simplified spatial data based on Mapbox's vector tile specification.

[0066] like Fig. 3 As shown, a tile pyramid is a multi-resolution hierarchical model. From the bottom to the top of the tile pyramid, the resolution decreases, but the geographical area represented remains unchanged. First, determine the number N of zoom levels to be provided by the map service platform. Take the map image with the highest zoom level and largest map scale as the bottom layer of the pyramid, i.e., layer 0. Divide this layer into tiles, starting from the top left corner of the map image, cutting from left to right and top to bottom, into square map tiles of the same size (e.g., 256x256 pixels), forming the layer 0 tile matrix. Based on the layer 0 map image, generate the layer 1 map image by dividing each pixel into 2×2 pixels, and divide it into tiles of the same size as the next layer, forming the layer 1 tile matrix. Use the same method to generate the layer 2 tile matrix; ...; and so on, until the N-1th layer, constituting the entire tile pyramid.

[0067] The spatial data access module specifically comprises:

[0068] The spatial data of the database type is obtained by: corresponding the layer name of the map layer with the table name of the spatial database, taking the longitude and latitude range of the vector tile as a SQL query statement of a spatial database engine, and obtaining the spatial data within the longitude and latitude range by executing the SQL query statement;

[0069] The spatial data of the file type is obtained by: obtaining the spatial data file through the layer name of the map layer, constructing the longitude and latitude range of the vector tile into a geometric object, and performing spatial overlay analysis on the geometric object and the spatial data file, and taking out the spatial data within the longitude and latitude range after cutting.

[0070] The spatial database at least comprises Oracle Spatial, SqlServer Spatial, PostGIS, MySQLSpatial and SpatiaLite;

[0071] The file type of the spatial data file at least comprises Shapefile, GeoJSON, GeoBuf, FileGDB, MDB and KML.

[0072] The spatial data adaptation module specifically comprises:

[0073] The spatial data obtained from different spatial data sources is assembled and converted into a spatial data set with unified format, stored in the computer memory, and the multi-source data is assembled on demand; each element in the spatial data set contains geometric data and corresponding key-value pair attributes, and then the spatial data sets are combined and added to the corresponding map layer of the vector tile, so as to provide a data source for spatial data simplification.

[0074] The spatial data simplification module specifically comprises:

[0075] The scale of the vector tile is obtained based on the level of the tile pyramid where the vector tile is located, the threshold distance is calculated based on the scale, and the spatial data after format conversion is simplified by using the Douglas thinning algorithm and the threshold distance. The value of the threshold distance is preferably the Resolution value corresponding to the scale multiplied by 0.1. The spatial data is simplified based on the Douglas thinning algorithm combined with the threshold distance, which can reduce the data amount of the vector tile while ensuring the accuracy.

[0076] In summary, the advantages of the present application are:

[0077] 1. By automatically obtaining the spatial data corresponding to the vector tiles from the spatial databases of the types of Oracle Spatial, SqlServer Spatial, PostGIS, MySQL Spatial, SpatiaLite, or by automatically obtaining the spatial data corresponding to the vector tiles from the file-type spatial data of the types of Shapefile, GeoJSON, GeoBuf, FileGDB, MDB, KML, and by uniformly converting the spatial data, the corresponding spatial data can be assembled in real time according to actual needs from different types of spatial data sources, avoiding the traditional inability to realize the on-demand assembly and real-time generation of data across spatial data sources, and greatly improving the compatibility of the data sources.

[0078] 2. The spatial data is simplified by the Douglas-Poiker algorithm, and the threshold distance used by the Douglas-Poiker algorithm is calculated based on the scale of the vector tiles, that is, the resolution of the vector tiles is dynamically combined to achieve optimal vector data simplification according to different levels, thereby greatly simplifying the data amount of the vector tiles while ensuring the accuracy.

[0079] Although the specific embodiments of the present application are described above, those skilled in the art should understand that the specific examples described are only illustrative, and are not intended to limit the scope of the present application, and equivalent modifications and changes made by those skilled in the art in accordance with the spirit of the present application should be covered within the scope of the claims of the present application.

Claims

1. A method for adapting vector tile generation for multiple data sources, the method comprising: The method comprises the following steps: ​ Step S10, calculating the latitude and longitude range based on the level of the tile pyramid where the vector tile is located and the row and column numbers, and obtaining the map layer corresponding to the vector tile from a configuration file; Step S20, obtaining database-type spatial data: corresponding the layer name of the map layer to the table name of the spatial database, making the latitude and longitude range of the vector tile as a SQL query statement of a spatial database engine, and obtaining the spatial data within the latitude and longitude range by executing the SQL query statement; the spatial database at least includes Oracle Spatial, SqlServer Spatial, PostGIS, MySQL Spatial and SpatiaLite; obtaining file-type spatial data: obtaining a spatial data file through the layer name of the map layer, constructing the latitude and longitude range of the vector tile into a geometric object, and performing spatial overlay analysis on the spatial data file, and taking out the spatial data within the latitude and longitude range after cutting; the file types of the spatial data file at least include Shapefile, GeoJSON, GeoBuf, FileGDB, MDB and KML; Step S30, assembling the spatial data obtained from different spatial data sources and converting them into a spatial data set with unified format, storing them in the computer memory, and realizing on-demand assembly of multi-source data; each feature in the spatial data set contains geometric data and corresponding key-value pair attributes, and then the spatial data sets are combined and added to the map layer corresponding to the vector tile to provide a data source for spatial data simplification; Step S40, obtaining the scale of the vector tile based on the level of the tile pyramid where the vector tile is located, calculating the threshold distance based on the scale, and simplifying the spatial data after format conversion by using the Douglas thinning algorithm combined with the threshold distance; the value of the threshold distance is the Resolution value corresponding to the scale multiplied by 0.1; Step S50, generating a vector tile based on the simplified spatial data according to the vector tile specification of Mapbox.

2. A vector tile generation system adapted for multiple data sources, characterized by: The method comprises the following modules: a map initialization module for calculating the latitude and longitude range based on the level of the tile pyramid where the vector tile is located and the row and column numbers, and obtaining the map layer corresponding to the vector tile from a configuration file; a spatial data access module for obtaining database-type spatial data: corresponding the layer name of the map layer to the table name of the spatial database, making the latitude and longitude range of the vector tile as a SQL query statement of a spatial database engine, and obtaining the spatial data within the latitude and longitude range by executing the SQL query statement; the spatial database at least includes Oracle Spatial, SqlServer Spatial, PostGIS, MySQL Spatial and SpatiaLite; Obtaining a file type of spatial data: obtaining a spatial data file through a layer name of the map layer, constructing a latitude and longitude range of the vector tile into a geometric object, and performing spatial overlay analysis with the spatial data file, and taking out spatial data in the latitude and longitude range after cutting; The file type of the spatial data file at least includes Shapefile, GeoJSON, GeoBuf, FileGDB, MDB and KML; A spatial data adaptation module is configured to assemble the spatial data obtained from different spatial data sources and convert the spatial data into a spatial data set with unified format, store the spatial data set in a computer memory, and realize on-demand assembly of multi-source data; each element in the spatial data set contains geometric data and corresponding key-value pair attributes, and the spatial data sets are combined and added to a corresponding map layer of the vector tile to provide a data source for spatial data simplification; A spatial data simplification module is configured to obtain a scale of the vector tile based on a level of a tile pyramid in which the vector tile is located, calculate a threshold distance based on the scale, and simplify the spatial data after format conversion by using a Douglas thinning algorithm combined with the threshold distance; the threshold distance is valued as a Resolution value corresponding to the scale multiplied by 0.1; A vector tile generation module is configured to generate a vector tile based on a vector tile specification of Mapbox from the simplified spatial data.

Citation Information

Patent Citations

  • Web GIS map layer establishing method based on SharpMap

    CN103927374A

  • Vector tile data processing method and device, equipment and storage medium

    CN111090716A

  • Road network map multistage dynamic loading method based on multistage thinning algorithm

    CN112579942A