A method and device for efficiently rendering vector slice maps

By stitching and indexing style information of LineString type geometric element data in MVT vector tile map, the problem of long rendering time and excessive memory usage of vector tile map is solved, and efficient rendering effect is achieved.

CN118260370BActive Publication Date: 2025-02-14浪潮智慧城市科技有限公司 +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410385166.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-01
Publication Date
2025-02-14
Estimated Expiration
2044-04-01

AI Technical Summary

Technical Problem

The existing vector slicing map rendering technology has a long rendering time and excessive browser memory usage due to the large amount of slice data and a large number of geometric elements, which affects the user experience.

Method used

By obtaining and parsing the LineString type geometric feature data in MVT vector slices, splicing and indexing are optimized according to the style information, reducing the number of WebGL drawings and improving rendering efficiency.

Benefits of technology

It reduces the loss of browser memory space, reduces the risk of memory overflow, and improves the rendering efficiency of map images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118260370B_ABST
    Figure CN118260370B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of GIS and digital twins, and specifically provides a method and device for efficient rendering of vector slice maps, which has the following steps: S1, obtaining the MVT vector slice required for rendering the current map, parsing the LineString type geometric element data that needs to be rendered in the MVT vector tile; S2, splicing all the LineString geometric element data required for this rendering into a LineString type geometric element data in a "line segment connected end to end" manner according to different style information, and recording the splicing index position and element style information of the LineString type geometric element data during the splicing process; S3, using the splicing index position information during map rendering to complete the rendering of the spliced ​​LineString type geometric element data of different style information. Compared with the prior art, the present invention can reduce the loss of browser memory space and reduce the risk of browser memory overflow.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of GIS and digital twins, and specifically provides a method and device for efficiently rendering a vector slice map. Background Art

[0002] Vector tile maps are a web map rendering method based on vector tiles of geographic data. Different from traditional raster tile maps, the feature data in vector tiles is stored in vector form. Therefore, vector tile maps have the characteristics of lossless scaling of map features and flexible map style configuration. MVT (Mapbox Vector Tiles) is a more common vector tile data specification and one of the vector tile standard specifications of the Open Geospatial Information Alliance.

[0003] In the actual application of MVT vector slices, factors such as excessive slice data volume and too many geometric elements often lead to problems such as long vector slice map rendering time and excessive browser memory usage during the rendering process, which seriously affects the user experience of vector slice maps. Summary of the invention

[0004] The present invention aims to overcome the deficiencies of the above-mentioned prior art and provides a highly practical and efficient rendering method for vector slice maps.

[0005] A further technical task of the present invention is to provide a vector slice map efficient rendering device with a reasonable design, safety and applicability.

[0006] The technical solution adopted by the present invention to solve its technical problem is:

[0007] A method for efficiently rendering a vector tile map comprises the following steps:

[0008] S1. Obtain the MVT vector slice required for rendering the current map, and parse the LineString type geometric element data that needs to be rendered in the MVT vector tile;

[0009] S2. All LineString geometric element data required for this rendering are spliced ​​into a LineString type geometric element data in a "line segment end to end connected" manner according to different style information, and the splicing index position and element style information of the LineString type geometric element data are recorded during the splicing process;

[0010] S3. During the map rendering process, the splicing index position information is used to render the spliced ​​LineString type geometric feature data with different style information.

[0011] Furthermore, in step S1, it includes:

[0012] S101, obtaining a request address for an MVT vector slice;

[0013] S102, obtaining LineString type geometric elements in each slice;

[0014] S103: Analyze the real latitude and longitude position or the projection coordinate position of the LineString geometric element.

[0015] Furthermore, in step S101, according to the current map viewing angle, the slice row and column numbers (x, y) and the level zoom information required for map rendering are obtained, and the request address of the MVT vector slice is generated.

[0016] Furthermore, in step S102, the request address of the MVT vector slice is stored in a request queue, and when all the MVT vector slices in the request queue complete the request, the LineString type geometric elements in each slice are obtained.

[0017] Furthermore, in step S103, the real latitude and longitude positions or projection coordinate positions of the LineString geometric elements are parsed according to the row and column numbers, levels and slice element projection information of each slice.

[0018] Furthermore, in step S2, it includes:

[0019] S201, regroup all LineString geometric element parsing results according to element style information. Assuming that the number of style types of LineString geometric elements in all MVT vector slices is n, the LineString geometric elements with the same style are stored in the corresponding style queues Q respectively. n among;

[0020] S202, from the style queue Q n From the LineString geometric feature i, the position points p are taken out one by one and stored in the position queue P n In the process, each time the geometric element i is stored, the position queue P is recorded. n The length is lm; if i is a style queue Q n The last LineString geometry in the index queue D n Deposit m -1, otherwise add to index queue D n Deposit m -1, l m ;

[0021] S203: According to the operation flow of step S202, all n style queues Q are processed in sequence. n , and obtain the corresponding position queue Pn , Index Queue D n ;

[0022] Further, in step S3, it includes:

[0023] S301, Pass the position queue P n into the vertex shader of the rendering style queue Q n , Index Queue D n ;

[0024] S302, Pop the first two indices at the head of the index queue D n , and define them as d0 and d1 respectively. Obtain the position point p n of the position queue P j , where j is the index of the position point p j in the position queue P n ;

[0025] S303, When j = 0, define the previous position point of p j as p j + (p j – p j+1 ), and the next position point of p j as p j+1 ; When j = l m - 1, define the previous position point of p j as p j-1 , and the next position point of p j as p j ;

[0026] S304, When j > d0 and j < d1, skip the position point p j ;

[0027] When j < d0 or j > d1, set the previous position point of p j as p j-1 , and the next position point of p j as p j+1 ;

[0028] When j = d1, set the next position point of p j as p j+1 , and set the previous position point of p j as p j + (p j – p j+1 );

[0029] When j = d0, set the previous position point of p j as p j-1 , and set the next position point of p j as p j itself;

[0030] S305, when j>d1, again select from index queue D n The squadron first pops up the first two indexes, defined as d0 and d1 respectively, and obtains the position p j , execute step S303 again until the index queue D n When empty, set the remaining settings j The previous position point is p j-1 , p j The next position point is p j+1 ;

[0031] S306: Use the unskipped position point p j and p j Draw a LineString based on the previous and next points of the .

[0032] When p j The next position point is equal to p j WebGL does not generate the vertex indices of the rectangle required to draw the LineString. Otherwise, WebGL uses the vertex indices of the rectangle drawn by p j 、p j+1 The rectangle formed by the style queue Q n Drawing of LineString type geometric features;

[0033] S307 , repeat step S301 to step S302 until all n style queues are drawn.

[0034] A vector tile map efficient rendering device, comprising: at least one memory and at least one processor;

[0035] The at least one memory is used to store a machine-readable program;

[0036] The at least one processor is used to call the machine-readable program to execute a method for efficient rendering of vector tile maps.

[0037] Compared with the prior art, the vector slice map efficient rendering method and device of the present invention has the following outstanding beneficial effects:

[0038] Compared with the traditional method of drawing vector slice maps, the present invention reduces the loss of browser memory space and the risk of browser memory overflow in the process of drawing more than one million level line feature data at one time.

[0039] Through index optimization, the complex line feature types of MVT vector slices can be spliced ​​and merged, reducing the overall drawing times of WebGL and improving the rendering efficiency of the map screen. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0041] Figure 1 It is a flowchart of an efficient rendering method for vector tile maps;

[0042] Figure 2 It is a vector tile map efficient rendering method that reassembles LineString diagrams by style;

[0043] Figure 3 It is a schematic diagram of splicing LineStrings of the same style and generating indexes in an efficient rendering method of vector tile maps;

[0044] Figure 4 It is a schematic diagram of the before and after position information of the generated location points in the efficient rendering method of vector tile maps;

[0045] Figure 5 It is a vector tile map efficient rendering method that draws a LineString diagram based on the front and back position information and index information. DETAILED DESCRIPTION

[0046] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0047] A best embodiment is given below:

[0048] like Figure 1 As shown, a vector tile map efficient rendering method in this embodiment has the following steps:

[0049] S1. Obtain the MVT vector slice required for rendering the current map, and parse the LineString type geometric element data that needs to be rendered in the MVT vector tile;

[0050] include:

[0051] S101. According to the current map viewing angle, the slice row and column number (x, y) and level (zoom) information required for map rendering are obtained, and the request address of the MVT vector slice is generated;

[0052] S102, storing the request address of the MVT vector slice in the request queue, and when all the MVT vector slices in the request queue complete the request, obtaining the LineString type geometric elements in each slice;

[0053] S103, parsing the real latitude and longitude position or projection coordinate position of the LineString geometric element according to the row and column number, level and slice element projection information of each slice.

[0054] S2. All LineString geometric element data required for this rendering are spliced ​​into a LineString type geometric element data in a "line segment end to end connected" manner according to different style information, and the splicing index position and element style information of the LineString type geometric element data are recorded during the splicing process;

[0055] include:

[0056] S201, such as Figure 2 As shown in the figure, all the LineString geometric feature parsing results are reassembled according to the feature style information. Assuming that the number of style types of LineString geometric features in all MVT vector slices is n, the LineString geometric features with the same style are stored in the corresponding style queues Q respectively. n among;

[0057] S202, such as Figure 3 As shown, from the style queue Q n From the LineString geometric feature i, the position points p are taken out one by one and stored in the position queue P n In the process, each time the geometric element i is stored, the position queue P is recorded. n The length is l m ; If i is the style queue Q n The last LineString geometry in the index queue D n Deposit m -1, otherwise add to index queue D n Deposit m -1, l m ;

[0058] S203, according to the operation flow of step S202, all n style queues Qn are processed in sequence to obtain corresponding position queues Pn and index queues Dn respectively;

[0059] S3, during the map rendering process, the spliced ​​index position information is used to render the spliced ​​LineString type geometric element data with different style information respectively;

[0060] S301. Pass the position queue P into the vertex shader of the rendering style queue Q n and the index queue D n ; n

[0061] S302. Pop the first two indices at the head of the index queue D n and define them as d0 and d1 respectively, and obtain the position point p n of the position queue P j , where j is the index of the position point p j in the position queue P n ;

[0062] S303. When j = 0, define the previous position point of p j as p j +(p j –p j+1 ), and the next position point of p j as p j+1 ; when j = l m -1, define the previous position point of p j as p j-1 , and the next position point of p j as p j ;

[0063] S304. As shown in Figure 4 , when j > d0 and j < d1, skip the position point p j ;

[0064] When j < d0 or j > d1, set the previous position point of p j as p j-1 , and the next position point of p j as p j+1 ;

[0065] When j = d1, set the next position point of p j as p j+1 , and set the previous position point of p j as p j +(p j –p j+1 );

[0066] When j = d0, set the previous position point of p j as p j-1 , and set the next position point of p j as p j itself;

[0067] S305. When j > d1, pop the index queue D n ​The squadron first pops up the first two indexes, defined as d0 and d1 respectively, and obtains the position p j , execute step S303 again until the index queue D n When empty, set the remaining settings j The previous position point is p j-1 , p j The next position point is p j+1 ;

[0068] S306: Use the unskipped position point p j and p j Draw a LineString based on the previous and next points of the .

[0069] like Figure 5 As shown, when p j The next position point is equal to p j WebGL does not generate the vertex indices of the rectangle required to draw the LineString. Otherwise, WebGL uses the vertex indices of the rectangle drawn by p j 、p j+1 The rectangle formed by the style queue Q n Drawing of LineString type geometric features;

[0070] S307 , repeat step S301 to step S302 until all n style queues are drawn.

[0071] Based on the above method, a vector tile map efficient rendering device in this embodiment includes: at least one memory and at least one processor;

[0072] The at least one memory is used to store a machine-readable program;

[0073] The at least one processor is used to call the machine-readable program to execute a method for efficient rendering of vector tile maps.

[0074] The above-mentioned specific implementations are only specific cases of the present invention. The patent protection scope of the present invention includes but is not limited to the above-mentioned specific implementations. Any technical solutions that comply with the claims of the present invention and any appropriate changes or substitutions made by ordinary technicians in the relevant technical field shall fall within the patent protection scope of the present invention.

[0075] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for efficiently rendering a vector tile map, characterized in that: The steps are as follows: S1. Obtain the MVT vector slice required for rendering the current map, and parse the LineString type geometric element data that needs to be rendered in the MVT vector tile; S2. All LineString geometric element data required for this rendering are spliced ​​into a LineString type geometric element data in a "line segment end to end" manner according to different style information, and the splicing index position and element style information of the LineString type geometric element data are recorded during the splicing process; include: S201, regroup all LineString geometric element parsing results according to element style information. Assuming that the number of style types of LineString geometric elements in all MVT vector slices is n, the LineString geometric elements with the same style are stored in the corresponding style queues Q respectively. n among; S202, from the style queue Q n From the LineString geometric feature i, the position points p are taken out one by one and stored in the position queue P n In the process, each time the geometric element i is stored, the position queue P is recorded. n The length is l m ; If i is the style queue Q n The last LineString geometry in the index queue D n Deposit m - 1, otherwise add to index queue D n Deposit m - 1. l m ; S203: According to the operation flow of step S202, all n style queues Q are processed in sequence. n , and obtain the corresponding position queue P n , Index queue D n ; S3, during the map rendering process, the spliced ​​index position information is used to render the spliced ​​LineString type geometric element data with different style information respectively; include: S301, to the rendering style queue Q n The position queue P is passed into the vertex shader n , Index queue D n ; S302: Pop up index queue D n The first two indexes of the squadron head are defined as d0 and d1 respectively, and the position queue P is obtained. n The position point p j , where j is the position point p j In position queue P n The index in ; S303, when j = 0, define p j The previous position point is p j + (p j – p j+1 ), p j The next position point is p j+1 ; When j = l m - 1, define p j The previous position point is p j-1 , p j The next position point is p j ; S304, when j > d0 and j < d1, skip position p j ; When j < d0 or j > d1, let p j The previous position point is p j-1 , p j The next position point is p j+1 ; When j = d1, let p j The next position point is p j+1 , let p j The previous position point is p j + (p j – p j+1 ); When j = d0, let p j The previous position point is p j-1 , let p j The next position point is p j itself; S305, when j>d1, again select the index queue D n The squadron first pops up the first two indexes, defined as d0 and d1 respectively, and obtains the position p j , execute step S303 again until the index queue D n When empty, set the remaining settings j The previous position point is p j-1 , p j The next position point is p j+1 ; S306: Use the unskipped position point p j and p j Draw a LineString based on the previous and next points of the . When p j The next position point is equal to p j WebGL does not generate the vertex indices of the rectangle required to draw the LineString. Otherwise, WebGL uses the vertex indices of the rectangle drawn by p j 、p j+1 The rectangle formed realizes the drawing of LineString type geometric elements in the style queue Qn; S307 , repeat step S301 to step S302 until all n style queues are drawn.

2. The efficient rendering method of a vector tile map according to claim 1, characterized in that: In step S1, it includes: S101, obtaining a request address for an MVT vector slice; S102, obtaining LineString type geometric elements in each slice; S103: Analyze the real latitude and longitude position or the projection coordinate position of the LineString geometric element.

3. The efficient rendering method of a vector tile map according to claim 2 is characterized in that: In step S101, according to the current map viewing angle, the slice row and column numbers (x, y) and level zoom information required for map rendering are obtained, and the request address of the MVT vector slice is generated.

4. The efficient rendering method of a vector tile map according to claim 3 is characterized in that: In step S102, the request address of the MVT vector slice is stored in a request queue. When all the MVT vector slices in the request queue complete the request, the LineString type geometric elements in each slice are obtained.

5. The efficient rendering method of a vector tile map according to claim 4 is characterized in that: In step S103, the real latitude and longitude positions or projection coordinate positions of the LineString geometric elements are parsed according to the row and column numbers, levels and slice element projection information of each slice.

6. A vector slice map efficient rendering device, characterized in that: include: at least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is configured to call the machine-readable program to execute the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Electronic map visualization method and device in large scene, terminal and medium

    CN116541477A

  • Spatial data front-end visualization style dynamic configuration method based on vector slicing

    CN116561394A