GIS data TMS tile generation method and system suitable for highway design

Through vector data rasterization and block encoding technology, the problem of unsupported vector data slicing and slow processing speed in the existing technology is solved. It is suitable for large volumes of GIS data in highway design, and achieves fast rendering and efficient tile generation. .

CN118520132BActive Publication Date: 2024-10-01SHANDONG TRAFFIC PLANNING DESIGN INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411000740.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-25
Publication Date
2024-10-01
Estimated Expiration
2044-07-25

AI Technical Summary

Technical Problem

In existing highway designs, the TMS tile method only supports raster data and does not support vector data slicing. It is slow or crashes when processing large amounts of data, and is not suitable for large-volume GIS data in the form of highway strips.

Method used

The vector data rasterization method is used to generate tiles, and the regular blocking of vector data is realized through blocking and encoding principles. The pixel discrimination method is combined with the pixel discrimination method to reduce unnecessary blocking and tiles, improve slicing efficiency, and solve the problem of tiles through the merging of multiple pictures. Slice boundary issues.

Benefits of technology

It realizes fast slicing and rendering of large-volume vector data, solves the problem of slow processing speed or crash, is suitable for large-volume GIS data in highway strips, and improves the response speed and efficiency of tile data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118520132B_ABST
    Figure CN118520132B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of highway survey and design, and provides a GIS data TMS tile generation method and system suitable for highway design. GIS vector data and GIS raster data are divided into blocks to obtain vector data block TIF images and raster data block TIF images; the geographical range of each level of tiles is calculated by tile slicing parameters, and the block TIF images are quickly located, taken out and saved in a tile folder. Finally, the boundary tiles with the same semantics in the temporary folder are traversed, superimposed into a picture, and saved in a target tile folder. The problem that GIS vector data cannot be sliced ​​is solved by rasterizing vector data; the idea of ​​dividing the original GIS data into blocks and slicing is adopted to solve the problems of slow efficiency and collapse of traditional slicing methods; the tile pixel self-discrimination algorithm is used to identify valid tiles in the slicing process, reduce the tile volume, and improve the response speed of tile data, which is suitable for slicing large-volume GIS data in highway strips.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of highway survey and design, and in particular relates to a GIS data TMS tile generation method and system suitable for highway design. Background Art

[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.

[0003] In highway survey and design, GIS data such as terrain, images and vectors are used to build a 3D scene base for highway 3D visualization design. The scale of existing highway design projects is often hundreds of kilometers, and the GIS data used is large in volume, strip-shaped and high in resolution. Using TMS tiles to store and display GIS data has become an indispensable means.

[0004] TMS tiles (Tile Map Service) are a format and protocol for storing and transmitting geospatial data. It divides map data into small tiles, each representing a small part of the map, and organizes them according to a specific hierarchy and coordinate system. TMS tiles can improve the optimization strategy of user map browsing experience, achieve rapid response of map data, and improve the stability and efficiency of the entire system.

[0005] However, the existing slicing methods have the following problems: (1) they only support slicing operations on raster data, but not vector data; (2) when the volume of sliced ​​data becomes large, problems such as slow processing speed or crash will occur; (3) the object data processed can only be regular rectangular data, which is not suitable for large-volume GIS data in the form of road strips. Summary of the invention

[0006] In order to solve the above problems, the present invention proposes a GIS data TMS tile generation method and system suitable for highway design. The present invention realizes vector data tile generation through a vector data rasterization method, which greatly reduces the pressure of large-volume vector lines on scene rendering; the method of extracting each level of tiles by blocking the original data solves the problem of slow efficiency or collapse of large-volume GIS vector raster data in the later stage of slicing; the method of merging multiple pictures solves the problem of tiles being at different block boundaries; in the process of blocking or slicing, the pixel discrimination method is used to retain only blocks and tiles with valid pixels, which greatly reduces the number of blocks and tiles, speeds up the traversal of blocks and tiles, and improves the response speed of tile data.

[0007] According to some embodiments, a first solution of the present invention provides a GIS data TMS tile generation method and system suitable for highway design, which adopts the following technical solutions:

[0008] The TMS tile generation method of GIS data suitable for highway design includes:

[0009] Based on the original GIS vector data and original GIS raster data, the GIS vector and raster data are divided into regular blocks using the block and encoding principles respectively, and vector data block TIF images and raster data block TIF images are obtained;

[0010] According to the vector data block TIF image and the raster data block TIF image, the coordinate system of the block TIF image is checked; based on the original GIS vector data and the original GIS raster data, the tile slicing range is obtained and the tile level and tile geographic range are calculated, and then the position of the tile is determined and extracted, and the TMS slicing based on the block TIF data image is completed. The tiles at the boundary of the block TIF image are stored in a temporary folder, and the tiles that are not at the boundary of the block TIF image are stored in the target folder;

[0011] Find tiles with the same semantics in the temporary folder, overlap them into one tile and save them to the target folder, process the tiles at the boundary of the block TIF image, and obtain vector data block tiles and raster data block tiles.

[0012] Furthermore, based on the original GIS vector data, the GIS vector data is segmented according to the principle of segmentation and encoding to obtain the vector data segmentation TIF image, specifically:

[0013] According to the number of pixels limited by the drawing and the resolution that meets the display requirements, the size L of the vector data block TIF image is determined by multiplying the two;

[0014] The original GIS vector data is divided into square blocks of size L*L and assigned the code "Col_Row", where Col and Row are the row and column numbers of the block respectively;

[0015] Read and parse the primitives in the original GIS vector data and calculate the rectangular bounding box of the primitives to obtain the rectangular bounding box of the vector primitives;

[0016] A mapping set of block codes and image elements is created according to the position discrimination relationship between the block codes and the image elements, that is, an image element set of the block code mapping;

[0017] Traverse the primitive collection of the block-coded mapping, draw all primitives, save them as the vector data block TIF image of "Col_Row.tif", and complete the rasterization of vector primitives.

[0018] Furthermore, the mapping set of block codes and picture elements is created according to the position discrimination relationship between the block codes and the picture elements, specifically:

[0019] Calculate the rectangular bounding box of each block;

[0020] A Boolean operation is performed on each vector primitive rectangular bounding box and the block rectangular bounding box. If they intersect, the primitive is stored in the primitive set of the block coding map; otherwise, the vector primitive is not in the primitive set of the block coding map.

[0021] Furthermore, the primitive set of the block-coded mapping is traversed, all primitives are drawn, and saved as a vector data block TIF image of "Col_Row.tif", and the vector primitives are rasterized, specifically:

[0022] The coordinates of the graphics elements in each graphics element set mapped by block coding are converted from the engineering coordinate system to the drawing normalized coordinates, that is, [X, Y] is converted to [(X-X0-Col*L) / L, (Y-Y0-Row*L) / L], where X0 and Y0 are the coordinates of the lower left corner of the original GIS vector data;

[0023] Draw all the primitives in the primitive set of the block-coded map, generate PNG images according to the determined number of pixels, automatically crop the parts outside the canvas, convert the PNG images into vector data block TIF images containing geographic range and coordinate information, and complete the rasterization of vector primitives;

[0024] The vector data block TIF image names are distinguished by block row and column numbers.

[0025] Furthermore, based on the original GIS raster data, the GIS raster data is divided into regular blocks using the block and encoding principles to obtain the raster data block TIF image, specifically:

[0026] Based on the geographic range, resolution and multi-threaded processing requirements of the original GIS raster data, determine the size of the raster data block TIF image and encode it in rows and columns;

[0027] Generate a blank tiled TIF image and record its file size;

[0028] Starting from the upper left corner of the original GIS raster data geographic range, the data in the ranges of Col*L, (Row+1)*L, (Col+1)*L, and Row*L are clipped in sequence, where Col and Row are the row and column numbers of the blocks respectively;

[0029] Perform pixel discrimination on the cropped raster data block TIF image. If the file size of the raster data block TIF image is equal to the file size of the blank block TIF image, the raster data block TIF image has no valid pixels and is discarded. Otherwise, save the raster data block TIF image and name it "Col_Row.tif" to obtain the raster data block TIF image.

[0030] Furthermore, the coordinate system check of the block TIF image is to check whether the coordinate system of the block TIF image is consistent with the generated tile coordinate system. If not, the coordinate system of the block TIF image is projected and converted into the tile coordinate system.

[0031] Furthermore, the method of obtaining the tile slice range and calculating the tile level and tile geographic range based on the original GIS vector data and the original GIS raster data is specifically as follows:

[0032] Read the resolution R of the block TIF image after inspection,

[0033] Assuming the geographic range of the entire original data is X0min, Y0min, X0max, Y0max, the specification parameters of the TMS tile are set as follows:

[0034] a. Origin coordinate calculation:

[0035] [Xorigin,Yorigin]=[Xcenter-0.5×Width0,Ycenter-0.5×Width0];

[0036] Among them, the width of the entire slice range Width0=max(X0max-X0min,Y0max-Y0min);

[0037] The horizontal coordinate of the center point is Xcenter=0.5×(X0min+X0max);

[0038] The vertical coordinate of the center point is Ycenter=0.5×(Y0min+Y0max);

[0039] b. Calculation of the maximum number of levels:

[0040] LevelMax=ceil(log2(Width0 / TileSize / R));

[0041] TileSize is the number of pixels per tile, and the ceil() function is a rounding function;

[0042] c. The file location is Level / TCol / TRow.png, and the tile geographic range is:

[0043] [Xmin,Xmax,Ymin,Ymax]=[TCol*Width+Xorigin,Xmin+Width,TRow*Width+Yorigin,Ymin+Width];

[0044] Width=Width0 / exp(2,Level);

[0045] Among them, Level is the tile level, which is equal to or less than LevelMax. The side length of the tile of LevelMax is half of the side length of the tile of the next level. Width is the side length of the tile. TCol is the tile row, TRow is the tile column, and exp is the exponential function.

[0046] Furthermore, the position determination and extraction of tiles is specifically as follows:

[0047] Determine whether the geographic range of the tile is within a single tile TIF image. If so, extract the tile and determine whether there are valid pixels in the tile.

[0048] If it exists, it will be saved in the naming format of "target folder / Level / TCol / TRow.png", where TCol is the tile row, TRow is the tile column, and Level is the tile level;

[0049] If the tile geographic range involves multiple tiled TIF images, tiles are extracted from each tiled TIF image and saved in the naming format of "temporary folder / Level_TCol_TRow_Col_Row.png".

[0050] Furthermore, the tiles with the same semantics in the temporary folder are searched, superimposed into one tile and saved to the target folder, so as to process the tiles at the boundary position of the block TIF image and obtain the vector data block tiles and the raster data block tiles, specifically:

[0051] Read the temporary folder and get the file list;

[0052] Read all the first three identical images of the file name "Level_TCol _TRow _Col_Row.png" and then combine them into one PNG image;

[0053] Stored in the path "target folder / Level / TCol / TRow.png".

[0054] According to some embodiments, the second solution of the present invention provides a GIS data TMS tile generation system suitable for highway design, which adopts the following technical solutions:

[0055] TMS tile generation system for GIS data applicable to highway design, including:

[0056] The GIS vector-raster data block module is configured to implement the GIS vector-raster data regular block based on the original GIS vector data and the original GIS raster data by using the block and encoding principles, respectively, to obtain the vector data block TIF image and the raster data block TIF image;

[0057] The TMS slicing module based on the block TIF data image is configured to check the coordinate system of the block TIF image according to the vector data block TIF image and the raster data block TIF image; obtain the tile slicing range based on the original GIS vector data and the original GIS raster data and calculate the tile level and tile geographic range, and then perform position discrimination and extraction on the tiles, complete the TMS slicing based on the block TIF data image, store the tiles at the boundary of the block TIF image in a temporary folder, and store the tiles not at the boundary of the block TIF image in a target folder;

[0058] The tile processing at the boundary of the tiled image is configured to search for tiles with the same naming semantics in the temporary folder, overlap them into a tile and save them to the target folder, realize the processing of tiles at the boundary position of the tiled TIF image, and obtain vector data tiled tiles and raster data tiled tiles.

[0059] Compared with the prior art, the present invention has the following beneficial effects:

[0060] The present invention parses the primitive information of vector data and calculates its bounding box, establishes a mapping object between the block coding and the primitive set according to the block rule, draws the primitives in the primitive set and saves them as tif pictures with geographic information, realizes vector rasterization, and then slices according to TMS to solve the problem of vector data slicing. The vector and raster data are divided into several image blocks with consistent geographical ranges, and inquired one by one according to the geographical range of the tile. After fast positioning, the tiles are taken out and stored in the tile folder, thereby solving the problem of slow processing speed or crash caused by the entire vector raster data. In the tile generation process, a tile pixel discrimination method is added to identify and store valid tiles, discard empty tiles, reduce the tile volume, and is suitable for slicing large-volume GIS data in the form of highway strips.

[0061] The present invention converts vector data into tif images supporting slicing by means of vector data primitive analysis and rasterization, thereby solving the slicing problem of vector data and alleviating the rendering pressure of large-volume vector lines in three-dimensional scenes.

[0062] The present invention utilizes a tile self-discrimination method to determine whether there are valid pixels in the tile summary, and only retains tiles containing valid pixels, thereby reducing the number of tiles at each level and improving the efficiency of tile traversal and scheduling of three-dimensional scenes.

[0063] The present invention solves the problem of low efficiency or collapse of single large-volume tif slices by organizing the original data geographic range in a block image manner, and improves the speed of generating large-volume GIS data slices.

[0064] The present invention solves the problem that tiles involve multiple block tif images by overlaying multiple tile images, thereby ensuring the correctness of boundary data. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0066] Figure 1 This is a flow chart of a method for generating TMS tiles of GIS data applicable to highway design in an embodiment of the present invention;

[0067] Figure 2 This is a flow chart of original GIS vector data segmentation in an embodiment of the present invention;

[0068] Figure 3 This is a flowchart of original GIS raster data segmentation in an embodiment of the present invention. DETAILED DESCRIPTION

[0069] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0070] It should be noted that the following detailed descriptions are all illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.

[0071] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0072] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.

[0073] Embodiment 1

[0074] The present embodiment provides a method for generating TMS tiles of GIS data suitable for highway design. The present embodiment uses the method applied to a server as an example for illustration. It is understandable that the method can also be applied to a terminal, and can also be applied to a system including a terminal, a server, and a server, and is implemented through the interaction between the terminal and the server. The server can be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network servers, cloud communications, middleware services, domain name services, security services CDN, and big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal and the server can be directly or indirectly connected via wired or wireless communication, which is not limited in this application. In the present embodiment, the method includes the following steps:

[0075] Step S1: Based on the original GIS vector data and the original GIS raster data, the GIS vector and raster data are divided into regular blocks by using the block and encoding principles respectively, and the vector data block TIF image and the raster data block TIF image are obtained;

[0076] Step S2: Check the coordinate system of the block TIF image according to the vector data block TIF image and the raster data block TIF image; obtain the tile slicing range based on the original GIS vector data and the original GIS raster data and calculate the tile level and tile geographic range, and then perform position discrimination and extraction on the tile, complete TMS slicing based on the block TIF data image, store the tiles at the boundary of the block TIF image in a temporary folder, and store the tiles not at the boundary of the block TIF image in the target folder;

[0077] Step S3: Find tiles with the same naming semantics in the temporary folder, overlap them into one tile and save them to the target folder, process the tiles at the boundary position of the block TIF image, and obtain vector data block tiles and raster data block tiles.

[0078] like Figure 1 and Figure 2 As shown, for the original GIS vector data block, step S1.1: based on the original GIS vector data, use the block and encoding principles to implement the GIS vector data rule block, and obtain the vector data block TIF image, specifically:

[0079] Determine the block size code, and determine the size L of the vector data block TIF image by multiplying the number of pixels limited by the drawing and the resolution that meets the display requirements; that is, the determination of the vector data block TIF size includes the determination of the block TIF geographic size and the block TIF pixel size;

[0080] Block TIF encoding: according to the block TIF image size, the original GIS vector data is divided into square blocks of size L*L and assigned the code "Col_Row", where Col and Row are the block row and column numbers respectively;

[0081] Parsing vector data primitives, i.e., vector primitive parsing, reads and parses primitives in the original GIS vector data and calculates the rectangular bounding box of the primitives to obtain the rectangular bounding box of the vector primitives;

[0082] Block coding and primitive set mapping, creating a mapping set of block coding and primitives according to the position discrimination relationship between block coding and primitives, that is, a primitive set of block coding mapping; a primitive may belong to multiple primitive sets of block mapping;

[0083] The primitive set is rasterized, the primitive set of the block-coded mapping is traversed, all primitives are drawn, and saved as a vector data block TIF image of "Col_Row.tif", the vector primitives are rasterized, and the vector data block TIF image is obtained.

[0084] like Figure 2 As shown, the mapping set of block codes and picture elements is created according to the position discrimination relationship between the block codes and the picture elements, specifically:

[0085] Calculate the rectangular bounding box of each block;

[0086] Boolean operations are performed to realize a primitive mapping set; Boolean operations are performed on each vector primitive rectangular bounding box and block rectangular bounding box. If they intersect, the primitive is stored in the primitive set of the block coding mapping; otherwise, the vector primitive is not in the primitive set of the block coding mapping.

[0087] like Figure 2 As shown, the primitive set of the block-coded mapping is traversed, all primitives are drawn, and the vector data block TIF image is saved as "Col_Row.tif", and the vector primitives are rasterized, specifically:

[0088] The coordinates of the graphics elements in each graphics element set mapped by block coding are converted from the engineering coordinate system to the drawing normalized coordinates, that is, [X, Y] is converted to [(X-X0-Col*L) / L, (Y-Y0-Row*L) / L], where X0 and Y0 are the coordinates of the lower left corner of the original GIS vector data;

[0089] Primitive drawing: draw all primitives in the primitive set of the block-coded mapping, generate PNG images according to the determined number of pixels, automatically crop the part outside the canvas, convert the PNG images into vector data block TIF images containing geographic range and coordinate information, and complete the rasterization of vector primitives;

[0090] The vector data block TIF image names are distinguished by block row and column numbers.

[0091] like Figure 1 and Figure 3 As shown, for the original GIS raster data block, step S1.2: based on the original GIS raster data, use the block and encoding principles to implement the GIS raster data rule block, and obtain the raster data block TIF image data, specifically:

[0092] Determine the block size and encoding. Based on the geographic scope, resolution and multi-threaded processing requirements of the original GIS raster data, determine the size of the raster data block TIF image and encode it in rows and columns, that is, encode the block TIF. It should be noted that the geographic scope and resolution of the original GIS raster data should be obtained. The block resolution should be consistent with the original data. The number of blocks should be consistent with the number of computer processors as much as possible to facilitate the later use of multi-threaded tiles. Based on this, the raster data block TIF image size can be determined and encoded in rows and columns. The determination of the block TIF size here is based on the original TIF geographic scope, original TIF resolution and multi-threaded processing requirements.

[0093] Generate a blank tiled TIF image and record its file size;

[0094] Starting from the upper left corner of the original GIS raster data geographic range, the data in the ranges of Col*L, (Row+1)*L, (Col+1)*L, and Row*L are clipped in sequence, where Col and Row are the row and column numbers of the blocks respectively;

[0095] Block TIF image pixel discrimination: perform pixel discrimination on the cropped raster data block TIF image. If the file size of the raster data block TIF image is equal to the file size of the blank block TIF image, the raster data block TIF image has no valid pixels and is discarded. Otherwise, save the raster data block TIF image and name it "Col_Row.tif" to obtain the raster data block TIF image.

[0096] like Figure 3 As shown, that is to say, raster data blocking refers to obtaining the geographic range and resolution of raster data by parsing the raster data. The blocking resolution is required to be consistent with the original raster data, and the number of blocks is as close as possible to the number of computer processors, so as to facilitate the use of multi-threading technology to calculate the geographic range of the block TIF, and then crop the original TIF raster data based on the block TIF geographic range, and judge the cropped TIF pixels. If the cropped block TIF image has no valid pixels, it is discarded and returns to the step of calculating the geographic range of the block TIF; otherwise, it is named and saved with the block row and column numbers to complete the storage of the block TIF image.

[0097] In step S2, the coordinate system check of the block TIF image is to check whether the block TIF image coordinate system is consistent with the generated tile coordinate system. If not, the block TIF image coordinate system is projected and converted to the tile coordinate system. It should be noted that the coordinate system check here is to perform this process on the vector data block TIF image and the raster data block TIF image respectively.

[0098] The method of obtaining the tile slice range and calculating the tile level and tile geographic range based on the original GIS vector data and the original GIS raster data is as follows:

[0099] Read the resolution R of the block TIF image after inspection,

[0100] Assuming the geographic range of the entire original data is X0min, Y0min, X0max, Y0max, the specification parameters of the TMS tile are set as follows:

[0101] a. Origin coordinate calculation:

[0102] [Xorigin,Yorigin]=[Xcenter-0.5×Width0,Ycenter-0.5×Width0];

[0103] Among them, the width of the entire slice range Width0=max(X0max-X0min,Y0max-Y0min);

[0104] The horizontal coordinate of the center point is Xcenter=0.5×(X0min+X0max);

[0105] The vertical coordinate of the center point is Ycenter=0.5×(Y0min+Y0max);

[0106] b. Calculation of the maximum number of levels:

[0107] LevelMax=ceil(log2(Width0 / TileSize / R));

[0108] TileSize is the number of pixels per tile, and the ceil() function is a rounding function;

[0109] c. The file location is Level / TCol / TRow.png, and the tile geographic range is:

[0110] [Xmin,Xmax,Ymin,Ymax]=[TCol*Width+Xorigin,Xmin+Width,TRow*Width+Yorigin,Ymin+Width];

[0111] Width=Width0 / exp(2,Level);

[0112] Among them, Level is the tile level, which is equal to or less than LevelMax. The side length of the tile of LevelMax is half of the side length of the tile of the next level. Width is the side length of the tile. TCol is the tile row, TRow is the tile column, and exp is the exponential function.

[0113] Similarly, for determining the tile level and tile geographic range, this process is performed on the vector data block TIF image and the raster data block TIF image respectively.

[0114] In step S2, the position determination and extraction of tiles are specifically performed as follows:

[0115] Determine whether the geographic range of the tile is within a single tile TIF image. If so, extract the tile and determine whether there are valid pixels in the tile.

[0116] If it exists, it will be saved in the naming format of "target folder / Level / TCol / TRow.png", where TCol is the tile row, TRow is the tile column, and Level is the tile level;

[0117] If the tile geographic range involves multiple tiled TIF images, tiles are extracted from each tiled TIF image and saved in the naming format of "temporary folder / Level_TCol_TRow_Col_Row.png".

[0118] Similarly, the tile identification and extraction here is performed on the vector data block TIF image and the raster data block TIF image respectively.

[0119] It can be understood that tiles at the boundary of the tiled TIF image are stored in a temporary folder, and tiles not at the boundary of the tiled TIF image are stored in a target folder.

[0120] like Figure 1 As shown, for the TMS slices based on the block images in step 2, the process is as follows:

[0121] Multithreading technology is used, and each thread is responsible for slicing a block of data. For a specific block file named "Col_Row.tif", the following process is used for processing.

[0122] Coordinate system check: 1. Determine the coordinate system for generating TMS tiles, and use the projection conversion library program to perform projection conversion on the tif file;

[0123] TMS tile parameter calculation: 2. Read the resolution R of the projected file. Assume that the geographic range of the entire original data is X0min, Y0min, X0max, Y0max. The specification parameters of the TMS tile can be set as follows:

[0124] a. Calculation of the coordinates of the origin (lower left corner):

[0125] [Xorigin,Yorigin]=[Xcenter-0.5×Width0,Ycenter-0.5×Width0],

[0126] Among them, the width of the entire slice range Width0=max(X0max-X0min,Y0max-Y0min);

[0127] The horizontal coordinate of the center point is Xcenter=0.5×(X0min+X0max);

[0128] The vertical coordinate of the center point is Ycenter=0.5×(Y0min+Y0max);

[0129] b. Calculation of the maximum number of levels:

[0130] LevelMax=ceil(log2(Width0 / TileSize / R));

[0131] TileSize is the number of pixels per tile, and the ceil() function is a rounding function;

[0132] c. The file location is Level / TCol / TRow.png, and the tile geographic range is:

[0133] [Xmin,Xmax,Ymin,Ymax]=[TCol*Width+Xorigin,Xmin+Width,TRow*Width+Yorigin,Ymin+Width];

[0134] Width=Width0 / exp(2,Level);

[0135] Where Level is the tile level, which is equal to or less than LevelMax. The side length of the tile at LevelMax is half of the side length of the tile at the next level. Width is the side length of the tile. TCol is the tile row. TRow is the tile column. exp is the exponential function.

[0136] Based on the traversal of the level and row and column numbers, the position of the tile and block TIF is judged: 3. According to the above specification parameters, the Level tile level, tile row, and tile column are traversed to judge the position of the tile and block TIF, and the block is extracted according to the overlap between the tile geographic range and the block geographic range; there are two situations for the extraction result, the tile geographic range is in the current block, or the tile geographic range is in both the current block and the adjacent block, that is, some data in the tile geographic range is outside the boundary of the block;

[0137] Among them, Level is between 0 and LevelMax, and tile rows and tile columns should make the geographical range of TMS tiles not completely outside the geographical range of the current tile file row_column.tif Col×L, (Row+1)×L, (Col+1)×L, Row×L. Use the raster processing library to extract the content in the corresponding range of the tile file and convert it into a png file of size TileSize.

[0138] Tile extraction and pixel self-identification, tile storage by position: when the extraction range is completely within the block data, the TMS tile save path is "target folder / Level / TCol / TRow.png";

[0139] When the extraction range is within the block data boundary and some data is outside the block boundary, the saving path is "temporary folder / Temp / Level_TCol_TRow_Col_Row.png". At this time, the content of the TMS tile outside the block boundary is transparent pixels.

[0140] like Figure 1 As shown, for tile processing at the boundary of the block image, in step S3, the tiles with the same naming semantics in the temporary folder are searched, superimposed into a tile and saved to the target folder, so as to realize the processing of tiles at the boundary position of the block TIF image, and obtain vector data block tiles and raster data block tiles, specifically, specifically:

[0141] Read the temporary folder and get the file list;

[0142] Read all the first three identical pictures of the file name "Level_TCol _TRow _Col_Row.png" and then superimpose them into one picture;

[0143] Stored in the path "target folder / Level / TCol / TRow.png".

[0144] It can be understood that in order to load and display tile data, a metadata file of the TMS slice is generated, which is defined in XML format and describes the access URL template, coordinate system, range, format and level information of the slice, and is placed in the same directory as the tile file.

[0145] The present invention first blocks the original GIS vector data and the original GIS raster data, determines the size and encoding of the block TIF, then, for the original GIS vector data, creates a set of vector primitives mapped by block encoding through the intersection of the vector primitive bounding box and the block TIF bounding box, draws the vector primitives of the corresponding set based on the block encoding and saves them as block TIF images; for the original GIS raster data, performs a clipping operation on the original GIS raster data based on the block size and encoding, and saves the block TIF image containing valid pixels after pixel discrimination. The geographic range of each level of tiles is calculated through tile slicing parameters, and the block TIF image is quickly located, taken out and saved in a tile folder. Finally, the boundary tile images with the same semantics in the temporary folder are traversed, superimposed into one image, and saved in the target tile folder. The present invention solves the problem that GIS vector data cannot be sliced ​​by rasterizing vector data; the idea of ​​slicing the original GIS data into blocks is adopted to solve the problems of slow efficiency and collapse of the traditional slicing method; during the slicing process, the tile pixel self-discrimination algorithm is used to identify valid tiles, reduce the tile volume, and improve the response speed of tile data. It is suitable for slicing large-volume GIS data in the form of highway strips.

[0146] Embodiment 2

[0147] This embodiment provides a GIS data TMS tile generation system suitable for highway design, including:

[0148] The GIS vector-raster data block module is configured to implement the GIS vector-raster data regular block based on the original GIS vector data and the original GIS raster data by using the block and encoding principles, respectively, to obtain the vector data block TIF image and the raster data block TIF image;

[0149] The TMS slicing module based on the block TIF data image is configured to check the coordinate system of the block TIF image according to the vector data block TIF image and the raster data block TIF image; obtain the tile slicing range based on the original GIS vector data and the original GIS raster data and calculate the tile level and tile geographic range, and then perform position discrimination and extraction on the tiles, complete the TMS slicing based on the block TIF data image, store the tiles at the boundary of the block TIF image in a temporary folder, and store the tiles not at the boundary of the block TIF image in a target folder;

[0150] The tile processing at the boundary of the tiled image is configured to search for tiles with the same naming semantics in the temporary folder, overlap them into a tile and save them to the target folder, realize the processing of tiles at the boundary position of the tiled TIF image, and obtain vector data tiled tiles and raster data tiled tiles.

[0151] The examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiment 1. It should be noted that the above modules as part of the system can be executed in a computer system such as a set of computer executable instructions.

[0152] The description of each embodiment in the above embodiments has different emphases. For parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0153] The proposed system can be implemented in other ways. For example, the system embodiment described above is only illustrative, and the division of the modules is only a logical function division. In actual implementation, there may be other division methods, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed.

[0154] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0155] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.

Claims

1. A method for generating TMS tiles from GIS data suitable for highway design, characterized in that: include: Based on the original GIS vector data and original GIS raster data, the GIS vector and raster data are divided into regular blocks using the block and encoding principles respectively, and vector data block TIF images and raster data block TIF images are obtained; According to the vector data block TIF image and the raster data block TIF image, the coordinate system of the block TIF image is checked; based on the original GIS vector data and the original GIS raster data, the tile slicing range is obtained and the tile level and tile geographic range are calculated, and then the position of the tile is determined and extracted, and the TMS slicing based on the block TIF data image is completed. The tiles at the boundary of the block TIF image are stored in a temporary folder, and the tiles that are not at the boundary of the block TIF image are stored in the target folder; The method of obtaining the tile slice range and calculating the tile level and tile geographic range based on the original GIS vector data and the original GIS raster data is as follows: Read the resolution R of the block TIF image after inspection, Assuming the geographic range of the entire original data is X0min, Y0min, X0max, Y0max, the specification parameters of the TMS tile are set as follows: a. Origin coordinate calculation: [Xorigin,Yorigin]=[Xcenter-0.5×Width0,Ycenter-0.5×Width0]; Among them, the width of the entire slice range Width0=max(X0max-X0min,Y0max-Y0min); The horizontal coordinate of the center point is Xcenter=0.5×(X0min+X0max); The vertical coordinate of the center point is Ycenter=0.5×(Y0min+Y0max); b. Calculation of the maximum number of levels: LevelMax=ceil(log2(Width0 / TileSize / R)); TileSize is the number of pixels per tile, and the ceil() function is a rounding function; c. The file location is Level / TCol / TRow.png, and the tile geographic range is: [Xmin,Xmax,Ymin,Ymax]=[TCol*Width+Xorigin,Xmin+Width,TRow*Width+Yorigin,Ymin+Width]; Width=Width0 / exp(2,Level); Where Level is the tile level, which is equal to or less than LevelMax. The side length of the tile at LevelMax is half of the side length of the tile at the next level. Width is the side length of the tile. TCol is the tile row. TRow is the tile column. exp is the exponential function. Find tiles with the same semantics in the temporary folder, overlap them into one tile and save them to the target folder, process the tiles at the boundary of the block TIF image, and obtain vector data block tiles and raster data block tiles.

2. The GIS data TMS tile generation method suitable for highway design as claimed in claim 1, characterized in that: Based on the original GIS vector data, the GIS vector data is divided into regular blocks using the block and encoding principles to obtain the vector data block TIF image, specifically: According to the number of pixels limited by the drawing and the resolution that meets the display requirements, the size L of the vector data block TIF image is determined by multiplying the two; The original GIS vector data is divided into square blocks of size L*L and assigned the code "Col_Row", where Col and Row are the row and column numbers of the block respectively; Read and parse the primitives in the original GIS vector data and calculate the rectangular bounding box of the primitives to obtain the rectangular bounding box of the vector primitives; A mapping set of block codes and image elements is created according to the position discrimination relationship between the block codes and the image elements, that is, an image element set of the block code mapping; Traverse the primitive collection of the block-coded mapping, draw all primitives, save them as the vector data block TIF image of "Col_Row.tif", and complete the rasterization of vector primitives.

3. The GIS data TMS tile generation method suitable for highway design as claimed in claim 2, characterized in that: The mapping set of block codes and picture elements is created according to the position discrimination relationship between the block codes and the picture elements, specifically: Calculate the rectangular bounding box of each block; Perform Boolean operations on each vector primitive rectangular bounding box and the block rectangular bounding box. If they intersect, store the primitive in the primitive set of the block encoding map. Otherwise, the vector graphics primitive is not in the primitive set of the block coding mapping.

4. The GIS data TMS tile generation method suitable for highway design as claimed in claim 2, characterized in that: The process of traversing the primitive set of the block-coded mapping, drawing all primitives, and saving them as the vector data block TIF image of "Col_Row.tif" to complete the rasterization of vector primitives is as follows: The coordinates of the graphics elements in each graphics element set mapped by block coding are converted from the engineering coordinate system to the drawing normalized coordinates, that is, [X, Y] is converted to [(X-X0-Col*L) / L, (Y-Y0-Row*L) / L], where X0 and Y0 are the coordinates of the lower left corner of the original GIS vector data; Draw all the primitives in the primitive set of the block-coded map, generate PNG images according to the determined number of pixels, automatically crop the parts outside the canvas, convert the PNG images into vector data block TIF images containing geographic range and coordinate information, and complete the rasterization of vector primitives; The vector data block TIF image names are distinguished by block row and column numbers.

5. The GIS data TMS tile generation method suitable for highway design as claimed in claim 1, characterized in that: Based on the original GIS raster data, the GIS raster data is divided into regular blocks using the block and encoding principles to obtain the raster data block TIF image, specifically: Based on the geographic range, resolution and multi-threaded processing requirements of the original GIS raster data, determine the size of the raster data block TIF image and encode it in rows and columns; Generate a blank tiled TIF image and record its file size; Starting from the upper left corner of the original GIS raster data geographic range, the data in the ranges of Col*L, (Row+1)*L, (Col+1)*L, and Row*L are clipped in sequence, where Col and Row are the row and column numbers of the blocks respectively; Perform pixel discrimination on the cropped grid data block TIF image. If the file size of the grid data block TIF image is equal to the file size of the blank block TIF image, the grid data block TIF image has no valid pixels and is discarded. Otherwise, save the grid data block TIF image and name it "Col_Row.tif" to obtain the grid data block TIF image.

6. The GIS data TMS tile generation method suitable for highway design as claimed in claim 1, characterized in that: The coordinate system check of the block TIF image is to check whether the coordinate system of the block TIF image is consistent with the generated tile coordinate system. If not, the coordinate system of the block TIF image is projected and converted into the tile coordinate system.

7. The method for generating TMS tiles of GIS data suitable for highway design according to claim 1, characterized in that: The position determination and extraction of tiles is specifically as follows: Determine whether the geographic range of the tile is within a single tile TIF image. If so, extract the tile and determine whether there are valid pixels in the tile. If it exists, it will be saved in the naming format of "target folder / Level / TCol / TRow.png", where TCol is the tile row, TRow is the tile column, and Level is the tile level; If the tile geographic range involves multiple tiled TIF images, extract the tiles from each tiled TIF image and save them in the naming format of "temporary folder / Level_TCol_TRow_Col_Row.png".

8. The method for generating TMS tiles of GIS data suitable for highway design according to claim 1, characterized in that: The method searches for tiles with the same semantics in the temporary folder, overlaps them into one tile and saves them to the target folder, processes the tiles at the boundary position of the block TIF image, and obtains the vector data block tiles and the raster data block tiles, specifically: Read the temporary folder and get the file list; Read all the first three identical images of the file name "Level_TCol _TRow _Col_Row.png" and then combine them into one PNG image; Stored in the path "target folder / Level / TCol / TRow.png".

9. GIS data TMS tile generation system suitable for highway design, characterized by: include: The GIS vector-raster data block module is configured to implement the GIS vector-raster data regular block based on the original GIS vector data and the original GIS raster data by using the block and encoding principles, respectively, to obtain the vector data block TIF image and the raster data block TIF image; The TMS slicing module based on the block TIF data image is configured to check the coordinate system of the block TIF image according to the vector data block TIF image and the raster data block TIF image; obtain the tile slicing range based on the original GIS vector data and the original GIS raster data and calculate the tile level and tile geographic range, and then perform position discrimination and extraction on the tiles, complete the TMS slicing based on the block TIF data image, store the tiles at the boundary of the block TIF image in a temporary folder, and store the tiles not at the boundary of the block TIF image in a target folder; The method of obtaining the tile slice range and calculating the tile level and tile geographic range based on the original GIS vector data and the original GIS raster data is as follows: Read the resolution R of the block TIF image after inspection, Assuming the geographic range of the entire original data is X0min, Y0min, X0max, Y0max, the specification parameters of the TMS tile are set as follows: a. Origin coordinate calculation: [Xorigin,Yorigin]=[Xcenter-0.5×Width0,Ycenter-0.5×Width0]; Among them, the width of the entire slice range Width0=max(X0max-X0min,Y0max-Y0min); The horizontal coordinate of the center point is Xcenter=0.5×(X0min+X0max); The vertical coordinate of the center point is Ycenter=0.5×(Y0min+Y0max); b. Calculation of the maximum number of levels: LevelMax=ceil(log2(Width0 / TileSize / R)); TileSize is the number of pixels per tile, and the ceil() function is a rounding function; c. The file location is Level / TCol / TRow.png, and the tile geographic range is: [Xmin,Xmax,Ymin,Ymax]=[TCol*Width+Xorigin,Xmin+Width,TRow*Width+Yorigin,Ymin+Width]; Width=Width0 / exp(2,Level); Where Level is the tile level, which is equal to or less than LevelMax. The side length of the tile at LevelMax is half of the side length of the tile at the next level. Width is the side length of the tile. TCol is the tile row. TRow is the tile column. exp is the exponential function. The tile processing at the boundary of the tiled image is configured to search for tiles with the same naming semantics in the temporary folder, overlap them into a tile and save them to the target folder, realize the processing of tiles at the boundary position of the tiled TIF image, and obtain vector data tiled tiles and raster data tiled tiles.