Fast vectorization method for super large grid based on transverse slicing

By combining remote sensing image block processing and contour tracking, the problem of excessive memory consumption during remote sensing image vectorization is solved, achieving efficient ultra-large raster to vectorization and ensuring processing speed and result integrity.

CN116452681BActive Publication Date: 2026-04-24GUANGXI ZHUANG AUTONOMOUS REGION NATURAL RESOURCES REMOTE SENSING INST
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGXI ZHUANG AUTONOMOUS REGION NATURAL RESOURCES REMOTE SENSING INST
Filing Date
2023-03-13
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

In existing remote sensing image classification tasks, directly loading the entire raster image into memory for vectorization consumes a large amount of memory, resulting in low processing efficiency, especially when the machine's physical memory is insufficient and it cannot work properly.

Method used

A horizontal slicing method is adopted to divide the raster image into multiple strip-shaped blocks, and contour tracking and merging are performed block by block. The Suzuki1985 contour tracking algorithm and segmented surface data structure are used to merge the outer contour lines of adjacent surfaces, reducing memory usage and improving processing efficiency.

Benefits of technology

It achieves fast and efficient conversion of ultra-large raster images into vector layers without increasing memory consumption, ensuring processing speed and result integrity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116452681B_ABST
    Figure CN116452681B_ABST
Patent Text Reader

Abstract

Based on the transverse block of super large grid fast vectorization method, through the block, in turn, each block contour tracking; and based on the contour node counterclockwise trend characteristics, using the contour line turn boundary line method contour point sequence into the contour surface; for not contact with the interface line contour surface directly output to the vector file, and the remaining other with the block boundary contact face will be with the last block with the interface line contact face merging. Mainly through a kind of end point sorting after pairing, link segment line, again merging the idea of surface, to realize the adjacent face merging between blocks; after merging two blocks, still in the block lower boundary face, save to the face cache, will be used for the next block face merging operation; through the loop iteration, repeatedly on each block contour tracking-merge adjacent face operation, ultimately realize the whole grid vectorization effect, solve the problem of direct large grid vectorization consume a lot of memory.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This invention relates to the field of computer image processing, and more specifically to a fast vectorization method for ultra-large grids based on horizontal slicing. [Background Technology]

[0002] In remote sensing image classification tasks, it is often necessary to vectorize the classified raster images to extract the classification vector results. Most existing raster-to-vector conversion methods require loading the entire raster image into memory and then using contour tracing methods to track the raster contours. While these methods are simple and fast, they consume a significant amount of memory to load the entire image, which is crucial for remote sensing image classification. Figure 1 The data is generally very large, and if the entire raster image is loaded, these methods will not work properly when the machine's physical memory is insufficient. To solve this problem, current remote sensing image processing generally involves reading raster data in small amounts multiple times and then merging adjacent faces using ordinary methods. However, this method requires a significant amount of time to determine face intersections and face merging, resulting in low processing efficiency. [Summary of the Invention]

[0003] To address the issues of excessive memory consumption or slow speed in loading rasters using the aforementioned methods, this invention provides a fast vectorization method for ultra-large rasters based on horizontal slicing, which solves the problem of excessive memory consumption when converting ultra-large rasters to vectors, while ensuring extremely fast processing speed.

[0004] This invention is achieved through the following technical solution, providing a method for fast vectorization of ultra-large grids based on horizontal slicing, comprising the following steps:

[0005] S1 inputs a binary raster image, wherein the binary raster image is a single-band binary raster image;

[0006] S2 divides the input raster image horizontally into multiple strip-shaped raster blocks according to a fixed number of rows. Starting from the top left corner of the raster, each block is formed by spacing R rows apart. The width of the raster is W and the height is H. Each block is a strip-shaped raster of size R×W. The total number of blocks is Nb=[(H+R-1) / R];

[0007] S3 reads a block of raster data from a raster file into computer memory;

[0008] S4 is based on the grid blocks obtained in S3. The Suzuki1985 contour tracing algorithm is used to trace the contours of these blocks to obtain a series of contours.

[0009] S5 converts all the contours obtained in S4 into contour surfaces. Since the contour is only a set of continuous pixel coordinates of the edge of the connected region of the raster data, it is not a polygonal surface. Therefore, it needs to be converted into a contour surface so that adjacent surfaces between blocks can be merged.

[0010] S6, based on S5, writes all contour faces of face type 4 into the output vector layer file;

[0011] S7 is based on S5 and uses all contour faces that are not of face type 4 to construct segmented faces. The segmented face is a data structure that includes segment lines, endpoints and holes. Through this structure, the outer contours of adjacent faces between blocks can be easily connected, thereby achieving the merging effect.

[0012] S8 merges the segmented surfaces obtained in S7 with the segmented surfaces in the global segmented surface cache;

[0013] S9, based on S8, identifies all face types as either type 2 or type 3 segmented faces, performs segmented face attribute update operations, and stores the updated attributes in the global segmented face cache.

[0014] S10, based on S8, obtains all segmented surfaces of type 1 and converts them into contour surfaces;

[0015] S11, based on S10, constructs the obtained contour surface into surface features and writes the surface features into a vector layer file.

[0016] Specifically, the contour in S4 includes the following attributes:

[0017] The outer contour line is the outer contour line formed by connecting the contour points counterclockwise. Each contour has only one outer contour line.

[0018] An inner contour line is an internal contour line formed by connecting contour points counterclockwise. Each contour may have multiple inner contour lines or no inner contour lines at all.

[0019] Specifically, the contour in S5 includes the following attributes: outer boundary point list, outer boundary hole list, and outer boundary surface type. S5 is implemented according to the following scheme:

[0020] S51 uses the contour-to-boundary-line method to convert the outer contour line into the outer boundary of the contour surface, and the inner contour line into the hole boundary of the contour surface.

[0021] S52 determines the surface type of the contour surface based on the relationship between the outer contour and the block boundary line.

[0022] Specifically, the method for converting contour lines to boundary lines in S51 is implemented according to the following scheme:

[0023] The input contour line has n nodes V = {v0, v1, ..., v...}n-1}, where v0 represents the starting point, v n-1 Denotes the endpoint, where v0 ≠ v n-1 Iterate through each node of the contour line in turn, and calculate the current node v according to the following formula. i Node type k:

[0024]

[0025] In formula (1), (x i ,y i ) represents the current node v i The coordinates of the point, (x i-1 ,y i-1 ) is the previous node v i-1 The coordinates of the point, (x i+1 ,y i+1 ) is the next node v i+1 The coordinates of the points are given by the function location as shown in formula (2), where K is a type matrix as shown in formula (3):

[0026]

[0027]

[0028] Specifically, in S51, the following selection is made based on the node type k value:

[0029] Case 1: When k = 0, no operation is performed;

[0030] Case 2, when k=1, connect (x) sequentially. i +1,y i ) and (x i ,y i Two points;

[0031] Case 3, when k=2, connect (x) sequentially. i ,y i +1) and (x i +1,y i +1) Two points;

[0032] Case 4, when k=3, connect (x) sequentially. i +1,y i ), (x i ,y i ), (x i +1,y i ) and (x i +1,y i +1) Four points;

[0033] Case 5, when k=4, connect (x) sequentially.i +1,y i ), (x i +1,y i +1), (x i +1,y i ) and (x i ,y i Four points.

[0034] Specifically, S52 is implemented according to the following scheme:

[0035] S521 Iterates through the y-coordinates of all nodes of the outer contour. If there exists a y=0, then the contour intersects with the first row.

[0036] S522 iterates through the y-coordinates of all nodes of the outer contour. If there exists a y = R, where R is the height of the block grid, then the contour intersects with the last row.

[0037] S523 determines the type of the profile surface based on the following conditions:

[0038] Case 1: If the outer contour intersects the first row but not the last row, then the face type is 1;

[0039] Case 2: If the outer contour does not intersect the first row but intersects the last row, then the face type is 2;

[0040] Case 3: If the outer contour intersects both the first and last rows, then the face type is 3;

[0041] Case 4: If the outer contour does not intersect with the first row and does not intersect with the last row, then the face type is 4;

[0042] Specifically, the segmented surface in S7 includes the following attributes: segment line list, segmented surface hole list, segmented surface type, upper endpoint list, and lower endpoint list. The segment line includes the following attributes: the segmented surface to which it belongs, the following segment line, and the node list. The upper and lower endpoints include the following attributes: the segment line to which they belong, the X coordinate, and the endpoint type.

[0043] S7 is implemented according to the following scheme:

[0044] S71 constructs segmented lines by using the intersection of the outer boundary line of the input contour surface and the upper boundary line of the grid block to break the outer contour line into multiple line segments, which are then saved in the segmented line properties of the segmented surface.

[0045] S72 uses the list of holes in the input contour surface as the list of holes in the output segmented surface;

[0046] S73 uses the surface type of the input contour surface as the surface type of the output segmented surface;

[0047] S74 constructs endpoints, traverses and outputs the endpoints of all segment lines of the segmented surface, i.e., the start and end points. For each endpoint, it is processed as follows: if the endpoint is on the upper boundary line of the block, it is added to the upper endpoint list; if the endpoint is on the lower boundary line of the block, it is added to the lower endpoint list.

[0048] Specifically, S8 is implemented according to the following scheme:

[0049] S81 retrieves all the upper endpoints of all segmented surfaces and stores them in a list of endpoints;

[0050] S82 sorts all endpoints in the endpoint list in ascending order based on their x-coordinates.

[0051] S83 retrieves two endpoints from the endpoint list each time. Of these two endpoints, one must be the endpoint and the other the starting point.

[0052] S84 connects the segment lines to which the endpoint and the starting point belong in the order of endpoint-starting point, that is, it modifies the segment line following the endpoint to the segment line to which the starting point belongs;

[0053] S85: When the segment faces to which the two endpoints belong are not the same, merge the two segment faces; otherwise, no merging operation is required. S85 is implemented according to the following scheme:

[0054] S851 inputs segmented surface 1 and segmented surface 2;

[0055] S852 first identifies the segment face to which the segment line in segment face 2 belongs as segment face 1, and then appends it to the segment line list of segment face 1;

[0056] S853 adds the holes in the hole list of segmented surface 2 to the hole list of segmented surface 1;

[0057] S854 updates the face type attribute of segment face 1 to the maximum value of the face types of the two segment faces;

[0058] S855 adds the upper endpoint of segment 2 to the upper endpoint of segment 1.

[0059] Specifically, S9 is implemented according to the following scheme:

[0060] S91 clears the list of upper endpoints of the input segmented surface;

[0061] S92 moves all endpoints from the lower endpoint list of the segmented surface to the upper endpoint list;

[0062] S93 changes the face type to type 1.

[0063] Specifically, S10 is implemented according to the following scheme:

[0064] S101 constructs the outer boundary, and traces the outer boundary of the contour surface based on the first segment line and its subsequent segment lines.

[0065] S102 is based on S101, and traces out all the holes from the remaining untraversed segment lines;

[0066] S103: Based on S102, add the holes obtained from tracking and the holes of the input segmented surface to the same list as the holes of the contour surface.

[0067] This invention provides a method for rapid vectorization of ultra-large graticles based on horizontal slicing. It involves dividing the graticle into blocks and then sequentially tracing the contour of each block. Based on the counter-clockwise trend of contour nodes, a contour-to-boundary-line method is used to convert the contour point sequence into a contour surface that closely adheres to the outer edge of the contour pixels. Furthermore, according to the positional relationship between the contour and the block boundaries, the contour surfaces are divided into those touching the upper boundary line, those touching the lower boundary line, and those touching both the upper and lower boundary lines but not touching the boundary lines. Contour surfaces that do not touch the boundary lines are directly output to a vector file, while the remaining contour surfaces that touch the block boundaries are... The method merges the faces that are in contact with the boundary line in the previous block. It primarily uses a process of sorting and pairing endpoints, linking segment lines, and then merging faces to achieve the merging of adjacent faces between blocks. After merging two blocks, faces that are still at the lower boundary of the block are saved in the face cache for use in the merging operation of the next block. Through iterative looping, the "contour tracing - merging adjacent faces" operation is repeatedly performed on each block, ultimately achieving the overall raster to vector conversion effect, solving the problem of excessive memory consumption when directly vectorizing large rasters. The method provided by this invention saves memory by processing only a small block at a time, while using special data structures such as endpoints and segment lines based on the characteristics of the contour itself to merge adjacent faces, thus ensuring the integrity of the output faces and achieving extremely high processing efficiency. [Attached Image Description]

[0068] Figure 1 This is a flowchart of the fast vectorization method for ultra-large grids based on horizontal slicing according to the present invention;

[0069] Figure 2 This is a binary raster image used in the embodiments of the present invention;

[0070] Figure 3 This is a block diagram of the grid map according to an embodiment of the present invention;

[0071] Figure 4 This is a strip-shaped grid block diagram according to an embodiment of the present invention;

[0072] Figure 5 This is a diagram showing the results of grid block contour tracking in the implementation of this invention;

[0073] Figure 6 This is a distribution diagram of the contours of adjacent blocks before merging in an embodiment of the present invention;

[0074] Figure 7 This is a schematic diagram showing the node sequence and endpoints of two adjacent faces in an embodiment of the present invention;

[0075] Figure 8 This is a diagram showing the result of merging two adjacent faces in an embodiment of the present invention.

[0076] Figure 9 This is a diagram showing the final result of the raster-to-vector conversion implemented in this invention.

Detailed Implementation Methods

[0077] It should be noted that the Guangxi Key Research and Development Program project "Key Technologies and Application Demonstration of Intelligent Remote Sensing Monitoring of Natural Resources Satellite in Guangxi" (Guike AB22080080) and the High Resolution Earth Observation System Major Special Project Government Comprehensive Governance Application Large-Scale Industrialization Demonstration Project "Construction and Application of Remote Sensing Monitoring System for Southern Ecological Barrier in Guangxi" (84-Y50G25-9001-22 / 23) both mention intelligent remote sensing monitoring. Rapid vectorization of ultra-large grids is one of the key links in the application of intelligent remote sensing monitoring results. Therefore, this invention provides a rapid vectorization method for ultra-large grids based on horizontal slicing.

[0078] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. The single-band binary raster file used in this embodiment is named after_label.tif, with a width of 32507 and a height of 15354, and was downloaded from a university's open building dataset website, specifically the Building Change Detection Dataset.

[0079] Please see Figure 1 This invention provides a method for fast vectorization of ultra-large grids based on horizontal slicing, comprising the following steps:

[0080] S1 inputs a binary raster image, which is a single-band unsigned integer binary raster image, as shown below. Figure 2 As shown.

[0081] S2 processes the input raster image into rows with a fixed number of rows. Figure 2 The grid is divided horizontally into multiple strip-shaped grid blocks. The height of each block is R = 512, the grid width is W = 32507, and the height is H = 15354. Therefore, the size of each block is R × W = 512 × 32507, and the total number of blocks is Nb = [(H + R - 1) / R] = [(15354 + 512 - 1) / 512] = 30. The resulting grid is shown below. Figure 3 As shown.

[0082] S3 reads a raster data block of 512 pixels high and 32507 pixels wide from the raster file into the computer memory, such as... Figure 4 As shown.

[0083] S4, based on the grid blocks obtained in S3, uses the Suzuki 1985 contour tracing algorithm to trace the contours of these blocks, resulting in a series of contours, such as... Figure 5 As shown. The contour includes the following attributes:

[0084] (1) Outer contour line: the outer contour line formed by connecting the contour points counterclockwise. Each contour has only one outer contour line.

[0085] (2) Inner contour line: the inner contour line formed by connecting the contour points counterclockwise. Each contour may have multiple inner contour lines or no inner contour lines.

[0086] S5 converts all the contours obtained in S4 into contour surfaces. Since a contour is merely a set of continuous pixel coordinates along the edges of connected regions of raster data and is not yet a polygonal surface, it needs to be converted into a contour surface to facilitate the merging of adjacent surfaces between blocks. In this step, the properties of the contour surface are shown in Table 1 below:

[0087] Table 1

[0088]

[0089] The process of converting a contour into a contour surface specifically includes the following steps:

[0090] S51 uses the contour-to-boundary-line method to convert the outer contour line into the outer boundary of the contour surface, and the inner contour line into the hole boundary of the contour surface. In this step, the contour-to-boundary-line method specifically involves the following steps:

[0091] The input contour line has n nodes V = {v0, v1, ..., v...} n-1}, v0 represents the starting point, v n-1 Denotes the endpoint, where v0 ≠ v n-1 ; Iterate through each node of the contour line in sequence, v i This represents the current node, whose coordinates are (x, y, y). i ,y i ),v i-1 This represents the previous node, whose coordinates are (x, y, y). i-1 ,y i-1 );v i+1 Indicates the next node, whose coordinates are (x, y, y). i+1 ,y i+1 ).

[0092] Calculate the current node v using the following formula. i Node type k:

[0093]

[0094] The function `location` is defined as follows:

[0095]

[0096] Where K is the type matrix, defined as follows:

[0097]

[0098] Based on the node type k value, perform the following operations:

[0099] (1) Case 1: When k = 0, no operation is performed;

[0100] (2) Case 2, when k = 1, connect (x) in sequence i +1,y i ) and (x i ,y i Two points;

[0101] (3) Case 3, when k = 2, connect (x) sequentially. i ,y i +1) and (x i +1,y i +1) Two points;

[0102] (4) Case 4, when k = 3, connect (x) sequentially. i +1,y i ), (x i ,y i ), (x i +1,y i ) and (x i +1,y i +1) Four points;

[0103] (5) Case 5, when k = 4, connect (x) sequentially. i +1,y i ), (x i +1,y i +1), (x i +1,y i ) and (x i ,y i Four points.

[0104] S52 determines the surface type of the contour surface based on the relationship between the outer contour and the block boundary line. The specific operation steps are as follows:

[0105] S521 iterates through the y-coordinates of all nodes of the outer contour. If there exists a y=0, then the contour intersects with the first row.

[0106] S522 iterates through the y-coordinates of all nodes of the outer contour. If there exists a y = R, where R is the height of the block grid, then the contour intersects with the last row.

[0107] S523 determines the type of the profile surface based on the following conditions:

[0108] Case 1: If the outer contour intersects the first row but not the last row, then the face type is 1;

[0109] Case 2: If the outer contour does not intersect the first row but intersects the last row, then the face type is 2;

[0110] Case 3: If the outer contour intersects both the first and last rows, then the face type is 3;

[0111] Case 4: If the outer contour does not intersect with the first row and does not intersect with the last row, then the face type is 4.

[0112] S6, based on S5, writes all contour faces of type 4 into the output vector layer file.

[0113] S7, based on S5, uses all contour faces that are not of face type 4 to construct segmented faces. A segmented face is a data structure containing segment lines, endpoints, and holes. This structure facilitates the connection of the outer contours of adjacent faces between segments, thereby achieving a merging effect. In this step, the attributes of the segmented face are shown in Table 2 below:

[0114] Table 2

[0115]

[0116] The attributes of the segment line are shown in Table 3 below:

[0117] Table 3

[0118]

[0119] The attributes included in the endpoints are shown in Table 4 below:

[0120] Table 4

[0121]

[0122]

[0123] In S7, the specific steps for constructing the segmented surface are as follows:

[0124] S71 constructs segmented lines by using the intersection of the outer boundary line of the input contour surface and the upper boundary line of the grid block to break the outer contour line into multiple line segments, which are then saved in the segmented line properties of the segmented surface.

[0125] S72 uses the list of holes in the input contour surface as the list of holes in the output segmented surface.

[0126] S73 uses the surface type of the input contour surface as the surface type of the output segmented surface.

[0127] S74 constructs endpoints, iterates through and outputs the endpoints (start and end points) of all segment lines on the segmented surface, and processes each endpoint as follows: if the endpoint is on the upper boundary line of the block, it is added to the upper endpoint list; if the endpoint is on the lower boundary line of the block, it is added to the lower endpoint list.

[0128] S8 merges the segmented surfaces obtained in S7 with the segmented surfaces in the global segmented surface cache. Step S71 is specifically implemented as follows:

[0129] S81 retrieves all the upper endpoints of all segmented surfaces and stores them in a list of endpoints.

[0130] S82 sorts all endpoints in the endpoint list in ascending order based on their x-coordinates.

[0131] S83 retrieves two endpoints from the endpoint list each time. Of these two endpoints, there must be one endpoint and one starting endpoint.

[0132] S84 connects the segment lines to which the endpoint and the starting point belong in the order of "endpoint-startpoint", that is, it modifies the segment line following the endpoint to the segment line to which the starting point belongs.

[0133] Figure 6 This shows the distribution of adjacent contours between two blocks before they were merged. Figure 7 This diagram shows two adjacent segmented planes, where endpoint A is the starting point of the lower segmented plane, endpoint B is the ending point of the lower segmented plane, endpoint D is the starting point of the upper segmented plane, and endpoint C is the ending point of the upper segmented plane. According to S82, sorting the endpoint x-coordinates in ascending order yields the sequence ACBD. According to S83, points A and C are considered a pair, and points B and D are considered a pair. According to S84, connecting endpoint C to starting point A, and endpoint B to starting point D, we can finally obtain the following... Figure 8 The image shows a closed, complete surface.

[0134] It should be noted that in this invention, when the segment faces to which the two endpoints belong are not the same, the two segment faces are merged; otherwise, no merging operation is required. In this step, the merging of the two segment faces is specifically performed as follows:

[0135] S851 inputs segmented surface 1 and segmented surface 2.

[0136] S852 first identifies the segmented surface to which the segment line in segmented surface 2 belongs as segmented surface 1, and then appends it to the segment line list of segmented surface 1.

[0137] S853 adds the holes from the hole list in segment 2 to the hole list in segment 1.

[0138] S854 updates the face type attribute of segment face 1 to the maximum value of the face types of the two segment faces.

[0139] S855 adds the upper endpoint of segment 2 to the upper endpoint of segment 1.

[0140] S856 adds the lower endpoint of segment 2 to the lower endpoint of segment 1.

[0141] S857 segment 1 is used as the final merge result, and segment 2 is deleted.

[0142] S9, based on the results from S8, identifies all face types as either type 2 or type 3 segmented faces. It then performs a segmented face attribute update operation and stores the updated attributes in the global segmented face cache. Specifically, the segmented face attribute update operation in this step is implemented as follows:

[0143] S91 clears the list of upper endpoints of the input segmented surface.

[0144] S92 moves all endpoints from the lower endpoint list of the segmented surface to the upper endpoint list.

[0145] S93 changes the face type to type 1.

[0146] S10, based on S8, obtains all segmented surfaces of type 1 and converts them into contour surfaces. Specifically, the conversion of segmented surfaces into contour surfaces is implemented as follows:

[0147] S101 constructs the outer boundary, and traces the outer boundary of the contour surface based on the first segment line and its subsequent segment lines.

[0148] S102 is based on S101, and traces all the holes from the remaining untraversed segment lines.

[0149] S103, based on S102, adds the holes obtained from tracking and the holes of the input segmented surface to the same list as the holes of the contour surface.

[0150] S11, based on S10, constructs the obtained contour surfaces into surface features, writes the surface features into a vector layer file, and finally obtains... Figure 9 , Figure 9 This is the final result of converting raster to vector.

[0151] In summary, the fast vectorization method for ultra-large grids based on horizontal slicing provided by this invention saves memory by processing only a small block at a time. At the same time, based on the characteristics of the contour itself, it uses special data structures such as endpoints and segment lines to merge adjacent faces, thus ensuring the integrity of the output face and having extremely high processing efficiency.

Claims

1. A fast vectorization method for ultra-large grids based on horizontal slicing, characterized in that, Includes the following steps: S1 inputs a binary raster image, wherein the binary raster image is a single-band binary raster image; S2 divides the input raster image horizontally into multiple strip-shaped raster blocks according to a fixed number of rows. Starting from the top left corner of the raster, each block is formed by spacing R rows apart. The width of the raster is W and the height is H. Each block is a strip-shaped raster of size R×W. The total number of blocks is Nb = [(H + R - 1) / R]. S3 reads a block of raster data from a raster file into computer memory; S4 is based on the grid blocks obtained in S3. The Suzuki1985 contour tracing algorithm is used to trace the contours of these blocks to obtain a series of contours. S5 converts all contours obtained in S4 into contour surfaces. The contours in S5 include the following attributes: outer boundary point list, outer boundary hole list, and outer boundary surface type. S5 is specifically implemented according to the following scheme: S51 uses the contour-to-boundary-line method to convert the outer contour line into the outer boundary of the contour surface, and the inner contour line into the hole boundary of the contour surface; the contour-to-boundary-line method in S51 is implemented according to the following scheme: The input contour line has n nodes. ,in Indicates the starting point. Indicates the endpoint, where Iterate through each node of the contour line in turn, and calculate the current node according to the following formula. Node type : (1), In formula (1), For the current node The coordinates of the point, For the previous node The coordinates of the point, For the next node The coordinates of the points are given by the function location as shown in formula (2), and K is the type matrix as shown in formula (3): (2), (3); S52 determines the surface type of the contour surface based on the relationship between the outer contour and the block boundary line; S52 is specifically implemented according to the following scheme: S521 Iterate through the y-coordinates of all nodes of the outer contour. If there is a y=0, then the contour intersects with the first row. S522 Traverse the y-coordinates of all nodes of the outer contour. If there exists a y=R, where R is the height of the block grid, then the contour intersects with the last row. S523 determines the type of the profile surface based on the following conditions: Case 1: If the outer contour intersects the first row but not the last row, then the face type is 1; Case 2: If the outer contour does not intersect the first row but intersects the last row, then the face type is 2; Case 3: If the outer contour intersects both the first and last rows, then the face type is 3; Case 4: If the outer contour does not intersect with the first row and does not intersect with the last row, then the face type is 4; S6, based on S5, writes all contour faces of face type 4 into the output vector layer file; S7 is based on S5 and uses all contour faces that are not of face type 4 to construct segmented faces. The segmented face is a data structure that includes segment lines, endpoints and holes. Through this structure, the outer contours of adjacent faces between blocks can be easily connected to achieve the merging effect. S8 merges the segmented surfaces obtained in S7 with the segmented surfaces in the global segmented surface cache; S9, based on S8, identifies all face types as either type 2 or type 3 segmented faces, performs segmented face attribute update operations, and stores the updated attributes in the global segmented face cache. S10, based on S8, obtains all segmented surfaces of type 1 and converts them into contour surfaces; S11, based on S10, constructs the obtained contour surface into surface features and writes the surface features into a vector layer file.

2. The method for fast vectorization of ultra-large grids based on horizontal slicing according to claim 1, characterized in that, The contour in S4 includes the following attributes: The outer contour line is the outer contour line formed by connecting the contour points counterclockwise. Each contour has only one outer contour line. An inner contour line is an internal contour line formed by connecting contour points counterclockwise. Each contour may have multiple inner contour lines or no inner contour lines at all.

3. The method for fast vectorization of ultra-large grids based on horizontal slicing according to claim 1, characterized in that, In step S51, the following selection is made based on the node type k value: Case 1: When k=0, no operation is performed; Case 2, when k=1, connect sequentially and Two points; Case 3, when k=2, connect sequentially and Two points; Case 4, when k=3, connect sequentially , , and Four points; Case 5, when k=4, connect sequentially , , and Four points.

4. The method for fast vectorization of ultra-large grids based on horizontal slicing according to claim 1, characterized in that, The segmented surface in S7 includes the following attributes: segment line list, segmented surface hole list, segmented surface type, upper endpoint list, and lower endpoint list. The segment line includes the following attributes: the segmented surface to which it belongs, the following segment line, and the node list. The upper and lower endpoints include the following attributes: the segment line to which they belong, the X coordinate, and the endpoint type. S7 is implemented according to the following scheme: S71 constructs segmented lines by using the intersection of the outer boundary line of the input contour surface and the upper boundary line of the grid block to break the outer contour line into multiple line segments, which are then saved in the segmented line properties of the segmented surface. S72 uses the list of holes in the input profile surface as the list of holes in the output segmented surface; S73 uses the surface type of the input contour surface as the surface type of the output segmented surface; S74 constructs endpoints, iterates through and outputs the endpoints of all segment lines of the segmented surface, i.e. the start and end points. For each endpoint, it is processed as follows: if the endpoint is on the upper boundary line of the block, it is added to the upper endpoint list; if the endpoint is on the lower boundary line of the block, it is added to the lower endpoint list.

5. The method for fast vectorization of ultra-large grids based on horizontal slicing according to claim 1, characterized in that, S8 is implemented according to the following scheme: S81 retrieves all the upper endpoints of all segmented surfaces and stores them in a list of endpoints; S82 Sort all endpoints in the endpoint list in ascending order based on their x-coordinates; S83 takes two endpoints from the endpoint list each time, and one of these two endpoints must be an end point and a start point. S84 Connects the segments to which the endpoint and the starting point belong in the order of endpoint-starting point, that is, modifying the segment following the endpoint to the segment to which the starting point belongs; S85 When the segment faces to which the two endpoints belong are not the same, merge the two segment faces; otherwise, no merging operation is required. S85 is implemented according to the following scheme: S851 Input segmented surface 1 and segmented surface 2; S852 First, the segmented surface to which the segment line in segmented surface 2 belongs is segmented surface 1, and then it is added to the segment line list of segmented surface 1; S853 Add the holes in the hole list of segmented surface 2 to the hole list of segmented surface 1; S854 updates the face type attribute of segment face 1 to the maximum value of the face types of the two segment faces; S855 adds the upper endpoint of segment 2 to the upper endpoint of segment 1.

6. The method for fast vectorization of ultra-large grids based on horizontal slicing according to claim 1, characterized in that, S9 is implemented according to the following scheme: S91 Clears the list of upper endpoints of the input segmented surface; S92 moves all endpoints from the lower endpoint list of the segmented surface to the upper endpoint list; S93 Change the face type to type 1.

7. The method for fast vectorization of ultra-large grids based on horizontal slicing according to claim 1, characterized in that, S10 is implemented according to the following scheme: S101 Constructs the outer boundary by tracing the outer boundary of the contour surface based on the first segment line and its subsequent segment lines. S102, based on S101, traces out all the holes from the remaining untraversed segment lines; S103, based on S102, adds the holes obtained from tracking and the holes of the input segmented surface to the same list as the holes of the contour surface.

Citation Information

Patent Citations

  • Grid map vectorization method and device

    CN108573510A

  • Fast grid-to-vector method based on contour tracking and image blocking

    CN111598769A