A vector data rasterization method based on binary recursion

By using a binary recursive vector data rasterization method, the inconsistency and complexity of vector data rasterization in existing technologies are solved, a unified rasterization framework is achieved, and the stability and simplicity of the algorithm are improved.

CN122173583APending Publication Date: 2026-06-09NANTONG UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANTONG UNIV
Filing Date
2026-03-11
Publication Date
2026-06-09

Smart Images

  • Figure CN122173583A_ABST
    Figure CN122173583A_ABST
Patent Text Reader

Abstract

This invention relates to the field of spatial data processing technology in geographic information systems, and particularly to a vector data rasterization method based on binary recursion, comprising: Step 1: creating a blank raster; Step 2: rasterizing vector points; Step 3: rasterizing vector lines; Step 4: rasterizing vector regions, including rasterizing triangular regions and rasterizing polygonal regions. This invention fundamentally eliminates directional asymmetry caused by the processing order through a midpoint-based binary recursive strategy, and can adaptively process line segments with arbitrary slopes, achieving efficient rasterization of vector lines without needing to write branch code for different slope ranges. Furthermore, by triangulating polygons and recursively processing each triangle, this invention effectively avoids the complex and special judgments required when processing vertices and horizontal edges in the scan-line algorithm, achieving efficient rasterization of arbitrary polygons.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of spatial data processing technology in geographic information systems, and in particular to a vector data rasterization method based on binary recursion. Background Technology

[0002] In Geographic Information Systems (GIS), the conversion of vector data to raster data (i.e., rasterization) is a fundamental and crucial technology. Currently, various rasterization algorithms exist for different types of vector features.

[0003] For vector line segments, the Bresenham algorithm is widely used. Its basic principle is to start from one end of the line segment and advance one grid cell at a time along the horizontal direction. By maintaining and iterating an error judgment quantity, it determines whether the next filled grid cell should move axially or diagonally, thereby generating a visually continuous straight line grid.

[0004] For vector polygon regions, the mainstream method is the scanline fill algorithm. This algorithm uses a series of horizontal scanlines to traverse the polygon from top to bottom. By calculating the intersection points of each scanline with each edge of the polygon, and sorting and pairing these intersection points, it determines and fills the grid cells located inside the polygon. This algorithm manages the edges of the polygon by constructing an edge table (ET) and an active edge table (AET), and uses the continuity of the edges to efficiently obtain the intersection points through incremental calculation.

[0005] However, existing technologies have significant limitations and drawbacks. The Bresenham algorithm exhibits directional asymmetry, and the accumulation of its error judgments is a unidirectional process. This can lead to inconsistent rasterization results for the same line segment if the order of the two input endpoints is different. Furthermore, the algorithm has slope limitations; the basic version can only directly process line segments with slopes between 0 and 1. For line segments with slopes in other ranges, additional branch code must be written to adjust the step direction and error judgment logic, increasing implementation complexity and maintenance costs.

[0006] The scanline algorithm has shortcomings at the geometric processing level. When the scanline happens to pass through a vertex of a polygon, it is necessary to determine whether the point should be counted as one or two intersection points based on the direction of the two adjacent sides of the vertex (such as judging whether it is a local maximum, minimum or general vertex). The judgment logic is complex and prone to errors. In addition, for horizontal sides, since the reciprocal of their slope is infinite, they cannot be included in the unified iterative framework based on incremental calculation. They usually require additional special processing (such as ignoring, merging or separately marking), which breaks the logical consistency of the algorithm and introduces additional branch judgments.

[0007] To address the aforementioned issues, this application proposes a vector data rasterization method based on binary recursion. Summary of the Invention

[0008] The purpose of this invention is to address the shortcomings of existing technologies by proposing a vector data rasterization method based on binary recursion. Through a unified rasterization framework applicable to points, lines, and complex polygons without requiring a large number of conditional branches, the robustness, code simplicity, and reliability of the algorithm are significantly improved.

[0009] To achieve the above objectives, the present invention adopts the following technical solution: a vector data rasterization method based on binary recursion, comprising the following steps:

[0010] Step 1: Create a blank grid. First, determine the five basic parameters of the blank grid: the horizontal coordinate of the lower left corner. , lower left ordinate Global grid cell side length d, number of rows n, number of columns m;

[0011] Step 2: Rasterize vector points;

[0012] Step 3: Rasterize the vector lines;

[0013] Step 4: Rasterize the vector region, including rasterizing the triangular region and the polygonal region.

[0014] Preferably, in step 1, after determining the above five basic parameters, the lower left corner vertex of the grid cell located in the i-th row and j-th column (i = 0, 1, …, n-1; j = 0, 1, …, m-1) is determined using the formula (1) shown below. Location tracking:

[0015] In the formula: i is the row index of the current raster cell, j is the column index; x ij The x-coordinate of the bottom left corner of the current grid is y. ij x0 is the ordinate of the bottom left corner; x0 is the abscissa of the bottom left corner of the grid area; y0 is the ordinate of the bottom left corner; d is the side length of the global grid cell.

[0016] based on The raster cell is generated by d and its initial attribute value of 0 is assigned to it to complete the initialization.

[0017] The above steps are iteratively executed based on variables i and j until all raster cells are initialized. The initialized raster is denoted as . , This represents the grid cell in the i-th row and j-th column.

[0018] Preferably, in step 2, for those located within the grid range Vector points within The row and column indices i and j of the corresponding grid cell are calculated using the formula (2) shown below, thus realizing the vector point P to the grid cell. The mapping is then used to achieve the rasterization of vector points;

[0019] In the formula: i is the row index of the current raster cell, j is the column index; x0 is the horizontal coordinate of the lower left corner of the raster region, y0 is the vertical coordinate of the lower left corner; x is the horizontal coordinate of the current vector point, y is the vertical coordinate of the current vector point; d is the side length of the global raster cell; This indicates the floor function.

[0020] Preferably, in step 3, for the vector line segment (referred to as "line segment", denoted as its two endpoints as...),... and Execute the following process:

[0021] Use formula (2) to obtain and Corresponding grid unit and Jump to .

[0022] Calculate line segments midpoint Use formula (2) to obtain its corresponding grid cell. And update The attribute value is 1, jump to .

[0023] :judge Whether or not or If they overlap, then further investigation is needed. Whether or not or If they do not overlap, and If they do not overlap, then... The attribute value is updated to 1, if and If they do not overlap, then... The attribute value is updated to 1, then redirect to... If not, with As the dividing point Divided into sub-segments and And redirect to respectively .

[0024] End process.

[0025] When all processes are completed, all lines in the grid will be connected. The attribute values ​​of all intersecting raster cells are updated to 1, thus completing the rasterization of them;

[0026] Furthermore, the vector polyline can be easily divided into several line segments. The above-mentioned rasterization process is then performed on each line segment to complete the rasterization of the vector polyline.

[0027] Preferably, in step 4, the following process is performed on the input vector triangle:

[0028] : Obtain its benchmark point and reference edge Let the two endpoints of the reference side be . and Jump to .

[0029] Use formula (2) to obtain and Corresponding grid unit and Jump to .

[0030] Calculate the reference edge midpoint Use formula (2) to obtain its corresponding grid cell. Jump to .

[0031] : Call the vector line segment rasterization algorithm in step 3 to rasterize the line segments. Perform rasterization and jump to... .

[0032] :judge Whether or not or If they overlap, then further investigation is needed. Whether or not or If they do not overlap, and If they do not overlap, then the line segments... Rasterization, if and If they do not overlap, then the line segments... Rasterize, jump to If not, then use the center line. Divide the triangle with a dividing line Divided into sub-triangles and And redirect to respectively .

[0033] End process.

[0034] When all processes are completed, all triangles in the grid... The attribute values ​​of grid cells that intersect at the edges or are located within them are all updated to 1, thus completing their rasterization.

[0035] Preferably, in step 4, the rasterization of the polygonal region includes the following methods:

[0036] A vector polygon region (referred to as "polygon") can be divided into several triangles. The above rasterization process is performed on each triangle to complete the rasterization of the polygon.

[0037] The polygon can be triangulated using the following process:

[0038] Count the number of vertices; if it equals 3, jump to... If the value is greater than 3, jump to .

[0039] : Returns this polygon directly.

[0040] Divide this polygon into two sub-polygons with as close vertex numbers as possible and jump to each sub-polygon. .

[0041] The detailed process of the polygon segmentation operation described in operation ③ above is as follows:

[0042] Let the number of vertices of the input polygon be N, and they be numbered sequentially as follows: Set the index interval variable gap, and initialize it to 0. Traverse the vertices in order, for the current vertex Starting from this point, move backward by gap vertices according to the polygon's vertex order, and denote this current vertex as... ,in, Determine the diagonal of a polygon If the vertex is completely inside the polygon, then end the traversal of the vertex, let min(i,j) = id1, max(i,j) = id2, and set the vertex... Extract the vertices and construct a sub-polygon, denoted as "sub-polygon 1". Arrange the remaining vertices according to... The two polygons are joined together in a manner that creates another sub-polygon, denoted as "sub-polygon 2". If no matching diagonal is found after traversing all vertices... If the gap is decremented by 1, then the diagonal that meets the requirements will be retrieved based on the new gap.

[0043] When gap decreases to 2, the problem degenerates into "ear triangle clipping". An "ear triangle" is defined as follows: for three consecutive vertices A, B, and C on a polygon, if line segment AC is completely inside the polygon and B is not on line segment AC, then triangle ABC is an "ear triangle" of the polygon.

[0044] According to the "two-ear theorem" of polygons (this "two-ear theorem" is an existing patent, and this invention will not provide a detailed derivation and proof of this theorem), every simple polygon with more than 3 vertices has at least two "ear triangles". Therefore, an ear triangle can be found and removed from the polygon, thereby ensuring that the above process does not have the risk of recursive stack overflow.

[0045] After all the above steps, the present invention can realize a vector object rasterization method with a unified and self-consistent logical architecture and high adaptability and stability.

[0046] By adopting the above technical solutions: (1) For rasterization of vector line segments, this invention solves the problem of directional asymmetry caused by the unidirectional accumulation of error judgment in the Bresenham algorithm, that is, different input order of endpoints may lead to inconsistent rasterization results. At the same time, it solves the problem that the algorithm needs to write additional branch code for line segments with different slope ranges due to slope limitation, which leads to complex implementation and inconsistent logic.

[0047] (2) Regarding the rasterization of vector polygon regions, this invention addresses the problem that the scan line algorithm, when processing the scan line passing through polygon vertices, needs to make complex judgments based on the direction of adjacent edges to determine the number of intersections, which is logically complex and prone to errors. At the same time, it solves the problem that when the algorithm processes horizontal edges, because the inverse of the slope is infinite, it cannot be incorporated into the unified incremental calculation framework, requiring additional special processing and disrupting the consistency of the algorithm's logic.

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

[0049] 1. For vector line segments, this invention fundamentally eliminates the directional asymmetry caused by the processing order through a midpoint-based binary recursive strategy, and can adaptively process line segments with arbitrary slopes (including degenerate cases) without needing to write branch code for different slope ranges.

[0050] 2. For vector polygon regions, this invention effectively avoids the complex and special judgments required when processing vertices and horizontal edges in the scan line algorithm by triangulating the region and recursively processing each triangle, thus achieving efficient rasterization of arbitrary polygons (including those with horizontal edges and complex vertices).

[0051] 3. This invention provides a unified rasterization framework applicable to points, lines, and complex polygons without requiring a large number of conditional branches, which significantly improves the robustness of the algorithm, the simplicity of the code, and the reliability of the results. Attached Figure Description

[0052] Figure 1 This is a flowchart of the present invention;

[0053] Figure 2 This is a schematic diagram of a blank grid in an embodiment of the present invention;

[0054] Figure 3 This is a flowchart illustrating the creation process of a blank grid in an embodiment of the present invention.

[0055] Figure 4 This is an example diagram of vector scatter set rasterization according to an embodiment of the present invention;

[0056] Figure 5 This is a flowchart illustrating the vector line segment rasterization process according to an embodiment of the present invention;

[0057] Figure 6 This is a schematic diagram of vector line segment rasterization according to an embodiment of the present invention;

[0058] Figure 7 This is a schematic diagram of vector line segment rasterization according to an embodiment of the present invention;

[0059] Figure 8 This is a schematic diagram of vector polyline rasterization according to an embodiment of the present invention;

[0060] Figure 9 This is a schematic diagram of the triangular reference point and reference side in an embodiment of the present invention;

[0061] Figure 10 This is a flowchart illustrating the rasterization process for a vector triangular region according to an embodiment of the present invention.

[0062] Figure 11 This is a schematic diagram of the rasterization of a vector triangular region according to an embodiment of the present invention;

[0063] Figure 12 This is an example diagram of rasterization of a vector triangular region according to an embodiment of the present invention;

[0064] Figure 13 This is a schematic diagram of a polygonal ear triangle according to an embodiment of the present invention;

[0065] Figure 14 This is a flowchart of the vector polygon region triangulation process according to an embodiment of the present invention;

[0066] Figure 15 This is a schematic diagram of the vector polygon region triangulation process according to an embodiment of the present invention;

[0067] Figure 16This is an example diagram of vector polygon region triangulation and rasterization in an embodiment of the present invention. Detailed Implementation

[0068] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings, so that those skilled in the art can better understand the advantages and features of the present invention, thereby making a clearer definition of the scope of protection of the present invention. The embodiments described in this invention are only some embodiments of the present invention, not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0069] Example:

[0070] A vector data rasterization method based on binary recursion, the process of which is as follows: Figure 1 As shown, the methods include the following:

[0071] Step 1: Create a blank grid

[0072] First, determine the five basic parameters of the blank raster: the horizontal coordinate of the lower left corner. , lower left ordinate The global grid cell has the following parameters: side length d, number of rows n, and number of columns m. After determining these parameters, the lower left corner vertex of the grid cell located in the i-th row and j-th column (i = 0, 1, …, n-1; j = 0, 1, …, m-1) can be determined using the following formula (1). Location tracking:

[0073] In the formula: i is the row index of the current raster cell, j is the column index; x ij The x-coordinate of the bottom left corner of the current grid is y. ij x0 is the ordinate of the bottom left corner; x0 is the abscissa of the bottom left corner of the grid area; y0 is the ordinate of the bottom left corner; d is the side length of the global grid cell.

[0074] based on The grid cell can be generated by d, and its initial attribute value of 0 can be assigned to it to complete the initialization.

[0075] Figure 2 This intuitively demonstrates the actual meaning of the above parameters.

[0076] The above steps are iteratively executed based on variables i and j until all raster cells are initialized. The initialized raster is denoted as . , This represents the grid cell in the i-th row and j-th column.

[0077] The above blank raster construction process is shown in Figure 3 .

[0078] Step 2: Vector Point Rasterization

[0079] For those within the grid range Vector points within The row and column indices i and j of the corresponding grid cell can be calculated using the formula (2) shown below, thus realizing the vector point P to the grid cell. The mapping is then used to achieve the rasterization of vector points. Figure 4 This demonstrates a rasterized instance of a vector scatter set.

[0080] In the formula: i is the row index of the current raster cell, j is the column index; x0 is the horizontal coordinate of the lower left corner of the raster region, y0 is the vertical coordinate of the lower left corner; x is the horizontal coordinate of the current vector point, y is the vertical coordinate of the current vector point; d is the side length of the global raster cell; This indicates the floor function.

[0081] Step 3: Vector Line Rasterization

[0082] First, let's describe the rasterization process for vector line segments (referred to as "line segments"):

[0083] For the input line segment, perform the following process (denoted as its two endpoints as...). and ):

[0084] Use formula (2) to obtain and Corresponding grid unit and Jump to .

[0085] Calculate line segments midpoint Use formula (2) to obtain its corresponding grid cell. And update The attribute value is 1, jump to .

[0086] :judge Whether or not or If they overlap, then further investigation is needed. Whether or not or If they do not overlap, and If they do not overlap, then... The attribute value is updated to 1, if and If they do not overlap, then... The attribute value is updated to 1, then redirect to... If not, with As the dividing point Divided into sub-segments and And redirect to respectively .

[0087] End process.

[0088] When all processes are completed, all lines in the grid will be connected. The attribute values ​​of all intersecting raster cells are updated to 1, thus completing the rasterization of them.

[0089] The above vector line segment rasterization process is shown in Figure 5 , Figure 6 This is a visual example of the process described above. Figure 7 This demonstrates an example of rasterizing a vector line segment.

[0090] Furthermore, the vector polyline can be easily divided into several line segments. The above-mentioned rasterization process is then performed on each line segment to complete the rasterization of the vector polyline.

[0091] Figure 8 This demonstrates a vector polyline rasterization example.

[0092] Step 4: Rasterize the vector region

[0093] This invention defines the vertex containing the largest interior angle of a triangle as its "reference point," and the side opposite the reference point as the reference side of the triangle. The above definition is intuitively illustrated in... Figure 9 .

[0094] First, the rasterization process for the vector triangular region (referred to as "triangle") is described. For the input triangle, the following process is executed:

[0095] : Obtain its benchmark point and reference edge Let the two endpoints of the reference side be . and Jump to .

[0096] Use formula (2) to obtain and Corresponding grid unit and Jump to .

[0097] Calculate the reference edge midpoint Use formula (2) to obtain its corresponding grid cell. Jump to .

[0098] : Call the vector line segment rasterization algorithm in step 3 to rasterize the line segments. Perform rasterization and jump to... .

[0099] :judge Whether or not or If they overlap, then further investigation is needed. Whether or not or If they do not overlap, and If they do not overlap, then the line segments... Rasterization, if and If they do not overlap, then the line segments... Rasterize, jump to If not, then use the center line. Divide the triangle with a dividing line Divided into sub-triangles and And redirect to respectively .

[0100] ⑥: End the process.

[0101] When all processes are completed, all triangles in the grid... The attribute values ​​of grid cells that intersect at the edges or are located within them are all updated to 1, thus completing their rasterization.

[0102] The above vector triangle region rasterization process is shown in Figure 10 , Figure 11 This is a visual example of the process described above. Figure 12 This demonstrates an example of rasterizing a vector triangular region.

[0103] Furthermore, the vector polygon region (referred to as "polygon") can be divided into several triangles, and the rasterization process described above is performed on each triangle to complete the rasterization of the polygon.

[0104] This invention performs polygon triangulation according to the following process: For an input polygon, the following process is executed:

[0105] Count the number of vertices; if it equals 3, jump to... If the value is greater than 3, jump to .

[0106] : Returns this polygon directly.

[0107] Divide this polygon into two sub-polygons with as close vertex numbers as possible and jump to each sub-polygon. .

[0108] The detailed process of the polygon segmentation operation described in operation ③ above is as follows:

[0109] Let the number of vertices of the input polygon be N, and they be numbered sequentially as follows: Set the index interval variable gap, and initialize it to 0. Traverse the vertices in order, for the current vertex Starting from this point, move backward by gap vertices according to the polygon's vertex order, and denote this current vertex as... ,in, Determine the diagonal of a polygon If the vertex is completely inside the polygon, then end the traversal of the vertex, let min(i,j) = id1, max(i,j) = id2, and set the vertex... Extract the vertices and construct a sub-polygon, denoted as "sub-polygon 1". Arrange the remaining vertices according to... The two polygons are joined together in a manner that creates another sub-polygon, denoted as "sub-polygon 2". If no matching diagonal is found after traversing all vertices... If the gap is decremented by 1, then the diagonal that meets the requirements will be retrieved based on the new gap.

[0110] When gap decreases to 2, the problem degenerates into "ear triangle clipping." An "ear triangle" is defined as follows: for three consecutive vertices A, B, and C on a polygon, if line segment AC is completely inside the polygon and line segment B is not on line segment AC, then triangle ABC is an "ear triangle" of the polygon. The above definition is intuitively illustrated in... Figure 13 .

[0111] According to the polygon "two-ear theorem" (this theorem is existing technology, and this invention will not provide a detailed derivation and proof of this theorem), every simple polygon with more than 3 vertices has at least two "ear triangles". Therefore, an ear triangle can be found and removed from the polygon, thereby ensuring that the above process does not have the risk of recursive stack overflow.

[0112] The above polygon triangulation process is shown in Figure 14 , Figure 15 This is a visual example of the process described above. Figure 16 This demonstrates an example of triangulation and rasterization of a vector polygon region.

[0113] Based on the above steps, this invention creates a unified rasterization framework that is applicable to points, lines, and complex polygons and does not require a large number of conditional branches. This effectively balances the robustness of the algorithm and the simplicity of the code, and achieves efficient conversion of vector data to raster data.

[0114] The descriptions and practices disclosed in this invention are readily apparent and understandable to those skilled in the art, and various modifications and refinements can be made without departing from the principles of this invention. Therefore, any modifications or improvements made without departing from the spirit of this invention should also be considered within the scope of protection of this invention.

Claims

1. A vector data rasterization method based on binary recursion, characterized in that, Includes the following steps: Step 1: Create a blank grid. First, determine the five basic parameters of the blank grid: the horizontal coordinate of the lower left corner. , lower left ordinate Global grid cell side length d, number of rows n, number of columns m; Step 2: Rasterize vector points; Step 3: Rasterize the vector lines; Step 4: Rasterize the vector region, including rasterizing the triangular region and the polygonal region.

2. The vector data rasterization method based on binary recursion according to claim 1, characterized in that, In step 1, after determining the above five basic parameters, the parameters located in the i-th row and j-th column are calculated using the formula (1) shown below. The bottom left corner vertex of the grid cell Location tracking: In the formula: i is the row index of the current raster cell, j is the column index; x ij The x-coordinate of the bottom left corner of the current grid is y. ij x0 is the ordinate of the bottom left corner; x0 is the abscissa of the bottom left corner of the grid area; y0 is the ordinate of the bottom left corner; d is the side length of the global grid cell. based on The raster cell is generated by d and its initial attribute value of 0 is assigned to it to complete the initialization. The above steps are iteratively executed based on variables i and j until all raster cells are initialized. The initialized raster is denoted as . , This represents the grid cell in the i-th row and j-th column.

3. The vector data rasterization method based on binary recursion according to claim 2, characterized in that, In step 2, for those located within the grid range Vector points within The row and column indices i and j of the corresponding grid cell are calculated using the formula (2) shown below, thus realizing the vector point P to the grid cell. The mapping is then used to achieve the rasterization of vector points; In the formula: i is the row index of the current raster cell, j is the column index; x0 is the horizontal coordinate of the lower left corner of the raster region, y0 is the vertical coordinate of the lower left corner; x is the horizontal coordinate of the current vector point, y is the vertical coordinate of the current vector point; d is the side length of the global raster cell; This indicates the floor function.

4. The vector data rasterization method based on binary recursion according to claim 3, characterized in that, In step 3, the rasterization of vector line segments includes the following method, where a vector line segment is simply referred to as a line segment. The following process is performed on the input line segment, and its two endpoints are denoted as... and : ①: Use formula (2) to obtain and Corresponding grid unit and Jump to ②; ②: Calculate line segments midpoint Use formula (2) to obtain its corresponding grid cell. And update If the attribute value is 1, jump to ③; ③: Judgment Whether or not or If they overlap, then further investigation is needed. Whether or not or If they do not overlap, and If they do not overlap, then... The attribute value is updated to 1, if and If they do not overlap, then... Update the attribute value to 1 and jump to ④; otherwise, use As the dividing point Divided into sub-segments and And jump to ① respectively; ④: End the process; When all processes are completed, all lines in the grid will be connected. The attribute values ​​of all intersecting raster cells are updated to 1, thus completing the rasterization of them; The vector polyline is divided into several line segments, and the above rasterization process is performed on each line segment to complete the rasterization of the vector polyline.

5. A vector data rasterization method based on binary recursion according to claim 4, characterized in that, In step 4, the following process is executed for the input triangle: ①: Obtain its reference point and reference edge Let the two endpoints of the reference side be . and Jump to ②; ②: Use formula (2) to obtain and Corresponding grid unit and Jump to ③; ③: Calculate the reference edge midpoint Use formula (2) to obtain its corresponding grid cell. Jump to ④; ④: Call the vector line segment rasterization algorithm from step 3 to rasterize the line segments. Perform rasterization and jump to step ⑤; ⑤: Judgment Whether or not or If they overlap, then further investigation is needed. Whether or not or If they do not overlap, and If they do not overlap, then the line segments... Rasterization, if and If they do not overlap, then the line segments... Rasterize and jump to step 6; otherwise, use the center line. Divide the triangle with a dividing line Divided into sub-triangles and And jump to ① respectively; ⑥: End the process; When all processes are completed, all triangles in the grid... The attribute values ​​of grid cells that intersect at the edges or are located within them are all updated to 1, thus completing their rasterization.

6. The vector data rasterization method based on binary recursion according to claim 5, characterized in that, In step 4, the rasterization of the polygonal region includes the following methods: A vector polygon region, or simply a polygon, is divided into several triangles. The above rasterization process is performed on each triangle to complete the rasterization of the polygon. The triangulation of the polygon is performed according to the following process: ①: Count the number of vertices. If it is equal to 3, jump to ②; if it is greater than 3, jump to ③. ②: Directly return this polygon; ③: Divide this polygon into two sub-polygons with similar number of vertices and jump to ① for each; The detailed process of the polygon segmentation operation described in operation ③ above is as follows: Let the number of vertices of the input polygon be N, and they be numbered sequentially as follows: Set the index interval variable gap, and initialize it to 0. Traverse the vertices in order, for the current vertex Starting from this point, move backward by gap vertices according to the polygon's vertex order, and denote this current vertex as... ,in, Determine the diagonal of a polygon If the vertex is completely inside the polygon, then end the traversal of the vertex, let min(i,j) = id1, max(i,j) = id2, and set the vertex... Extract the vertices and construct a sub-polygon, denoted as "sub-polygon 1". Then, arrange the remaining vertices according to... The two polygons are joined together in a manner that creates another sub-polygon, denoted as "sub-polygon 2". If no matching diagonal is found after traversing all vertices... If the gap is decremented by 1, then the diagonal that meets the requirements will be retrieved based on the new gap. When gap decreases to 2, the problem degenerates into ear triangle clipping. An ear triangle is defined as follows: for three consecutive vertices A, B, and C on a polygon, if line segment AC is completely inside the polygon and B is not on line segment AC, then triangle ABC is an ear triangle of the polygon. According to the two-ear theorem for polygons, every simple polygon with more than 3 vertices has at least two ear triangles. Therefore, we can find an ear triangle and remove it from the polygon to ensure that the above process does not have the risk of recursive stack overflow.