A geographic information processing method for converting wind farm vector data into raster data
By using quadtree partitioning and ray tracing, the problems of high computational cost and insufficient accuracy when converting vector data into raster data are solved, achieving efficient and accurate raster data generation.
Patent Information
- Application Number
- CN202310251022.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-15
- Publication Date
- 2026-11-06
- Estimated Expiration
- 2043-03-15
AI Technical Summary
In existing technologies, converting vector data into raster data involves a large amount of computation and insufficient accuracy, especially when it comes to filling raster attributes between irregular shapes and multiple line segments. There is a lack of mature algorithm software in China.
The quadtree is used to partition and manage vector data. The horizontal and vertical ray methods are combined for traversal, and raster data is generated through linear interpolation and smoothing.
It improves computational efficiency and accuracy, quickly identifies the inner and outer sides of irregularly shaped vector data, accurately fills the raster attributes between multiple line segments, and reduces computational load and filling error.
Smart Images

Figure CN116342805B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of wind farm terrain information processing, specifically involving a geographic information processing method for converting wind farm vector data to raster data. Background Technology
[0002] Vector format data is used to represent a collection of tables and symbolic geographic layers, aggregating terrain information, including latitude and longitude, elevation, and other important data. In wind farm calculations, terrain elevation and latitude / longitude are crucial parameters, but they cannot be directly obtained from vector data. Instead, they are obtained from raster data types. Each raster cell records the terrain's elevation and latitude / longitude, representing its position within that raster resolution range. Higher resolution results in a more accurate representation of the terrain. Therefore, accurately obtaining this information is essential for precise parameter calculations in wind resource software, particularly in wind farm applications.
[0003] Developing a terrain processing method for converting wind farm vector data to raster data is an important task. When the spatial location information of a target point is known, acquiring variable information about that point using raster data is typically much faster than using vector data. This advantage of raster data becomes even more pronounced as the amount of data increases. In data applications, especially in wind resource simulation modeling, the terrain data used is primarily in raster format.
[0004] Due to the unstructured nature of vector data, converting it into structured raster data is complex, often resulting in high computational costs and insufficient accuracy. This is especially true when the vector data presents irregular shapes, making it difficult to define the inner and outer edges of the data. Furthermore, when raster cells are located between multiple line segments, the required fill values are not easily determined. Therefore, accurately converting vector data into raster data is crucial. Currently, readily available foreign software is primarily used for this conversion, while mature domestic algorithms are lacking. Summary of the Invention
[0005] This invention provides a geographic information processing method for converting wind farm vector data to raster data, solving the problems of high computational cost and insufficient accuracy often encountered when converting unstructured vector data into structured raster data. It can quickly identify the inner and outer sides of irregularly shaped vector data and accurately fill the raster attributes between multiple line segments, reducing the computational cost of traversing vector data endpoint by endpoint and the error in filling raster attributes, thus improving computational efficiency and accuracy.
[0006] This invention provides a geographic information processing method for converting wind farm vector data to raster data. The method comprises the following steps: Step 1: By parsing the terrain map data, obtain the coordinate information (x, y) of all line segments in the terrain map data, forming a coordinate set; based on the combination of the four extreme values (x, y) in the line segment coordinate set... min y max ), (x max y max ), (x max y min ), determine the four vertices of the maximum range of the raster; set the raster resolution (△x, △y), create raster data based on the raster range and resolution, and define the attributes of each raster cell as invalid values; Step 2: Create a quadtree based on the resolution of the raster from Step 1, determine the length and width of the leaves, and set the minimum leaf height L of the quadtree. min The length and width; using the dividing line between two adjacent leaves. x i coordinates or y i The coordinates are divided into Map vector segments. When a vector segment intersects with the leaf boundary line, an endpoint is added. The divided vector segments are then inserted into a quadtree according to the coordinate range for management. Step 3: Using the horizontal ray method, traverse the vector segments managed by each leaf of the quadtree in Step 2 row by row and cell by cell, calculate the terrain height attribute value of the vector segments and fill it into the grid cell of the first target; using the vertical ray method, traverse the vector segments managed by each leaf of the quadtree in Step 2 column by cell, calculate the terrain height attribute value of the vector segments and fill it into the grid cell of the second target. Step 4: For the grid cells of the first target and the grid cells of the second target in Step 3, calculate the grid cells whose attribute values are still invalid using linear interpolation; calculate the interpolated grid cell data of the first target using the horizontal ray method and the linear interpolation method, calculate the interpolated grid cell data of the second target using the vertical ray method and the linear interpolation method, and then merge the arithmetic mean of the grid cell data of the first target and the grid cell data of the second target to create the grid cell data of the third target. Step 5: Smooth the data of the third target raster unit described in Step 4. Use the attribute value of the third target raster unit data and the attribute values of the eight adjacent units to perform a weighted average as the final data value of the third target raster unit. Create a TIFF file according to the coordinate range and resolution of the final data value of the third target raster, and fill the final data value information of the third target raster into the TIFF container to generate a raster-formatted topographic map.
[0007] Preferably, in step 1, the grid resolution (△x, △y) is set, and grid data is created according to the grid range and resolution. The attribute of each grid cell is defined as an invalid value, which is defined as △x meters × △y meters according to the user-defined grid resolution. In step 2, set the minimum leaf node L of the quadtree. min The length and width are n times the grid cell length Δx and width Δy, respectively. The smallest leaf L on a quadtree... min Manage n×n grid cells, where n is a natural number.
[0008] Preferably, step 2 utilizes the boundary line between two adjacent leaves. x i coordinates or y i Map vector segmentation refers to the process where the terrain elevation attribute of the same vector segment remains unchanged during the segmentation process; if the coordinates of two adjacent endpoints of the vector segment are respectively ( x 1 ,y 1) ( x 2 ,y 2), then the coordinates of the endpoints of the dividing point are: (1) In formula (1) x i 、y i The x-coordinate and y-coordinate of the boundary line between any two adjacent leaves ,i It is a natural number.
[0009] Preferably, in step 3, the horizontal ray method is used to traverse the vector line segments managed by each leaf of the quadtree described in step 2, row by row and cell by cell, calculate the terrain height attribute value of the line segments, and fill them into the grid cells of the first target; the center point rcenter of the first target grid cell is queried from the quadtree based on the center point coordinates of each grid cell. x 0 ,y The location of 0), the extent of the leaf containing the first target, and the set of all vector segments in the leaf, grip; the starting point of the horizontal ray is the left boundary line of the leaf of the first target grid cell, and it passes through the center point rcenter of the first target grid cell, obtaining the intersection points of the horizontal ray and the vector segments in the quadtree leaf, which are denoted as follows: P 1 、P 2 、……、P n 、P n+1 、……、P end Each intersection point P n The coordinates are ( x n,y n ); Determine and calculate the intersection point P n The positional relationship between the center point rcenter of the first target grid cell and the center point of the first target grid cell is determined; based on the positional relationship between the center of the first target grid cell and the intersection point, the variable of the center of the first target grid cell is calculated using linear interpolation. : (2) In equation (2) V(P) n ) Represented as the first horizontal ray and line segment P n The terrain height attribute value of each intersection point; (3) Among them, equation (3) This indicates the center point rcenter of the grid cell and its adjacent cells. P n , P n+1 The horizontal distance weighting coefficient of the intersection points.
[0010] Preferably, in step 3, the vertical ray method is used to traverse the vector line segments managed by each leaf of the quadtree in step 2, column by column and cell by cell, calculate the terrain height attribute value of the line segments, and fill them into the grid cell of the second target location; the center point rcenter of the second target grid cell is queried from the quadtree based on the center point coordinates of each grid cell. x 0 ,y The location of 0), the range of the leaf containing the second target grid cell, and the set of all vector segments in the leaf, grip; the starting point of the vertical ray is the upper boundary line of the leaf of the second target grid cell, and it passes through the center point rcenter of the second target grid cell, obtaining the intersection point of the vertical ray with the vector segments in the leaf of the quadtree, and recording them sequentially. P 1 、P 2 、……、P n 、P n+1 、……、P end Determine and calculate each intersection point P n The coordinates are ( x n ,y n The positional relationship between the center point rcenter of the second target grid cell and the center point rcenter; based on the intersection of the center point rcenter of the second target grid cell and each intersection point rcenter. P n The positional relationship between them was used to calculate the center variable of the second target raster cell using linear interpolation. : (4) In equation (4) V(P) n ) Represented as the perpendicular ray and line segment's first... P n The terrain height attribute value of each intersection point; (5) Among them, equation (5) This indicates the center point rcenter of the grid cell and its adjacent cells. P n , P n+1 The weighted coefficient of the perpendicular distance between the intersection points.
[0011] Preferably, in step 4, for the grid cells of the first target and the grid cells of the second target in step 3, the grid cells with invalid attribute values are calculated using linear interpolation. This involves traversing the grid row by row. If an invalid attribute value is detected in column C of row R: the grid value in column C-1 is recorded as fw; starting from column C+1, the first non-invalid value is found, denoted as column C+k, where k≥1, and the grid value in column C+k is recorded as bw; the grid cell attribute value in column C of row R is... The calculation formula is: (6) In formula (6) fw This represents the raster attribute value in row R and column C-1. bw This represents the raster attribute value in row R, column C+k. Similarly, iterate through and calculate the raster cell attribute values of all rows in the first target raster cell; then iterate through and calculate the raster cell attribute values of all columns in the second target raster cell.
[0012] Preferably, in step 5, the data of the third target raster cell in step 4 is smoothed, and the final data value of the third target raster cell is obtained by weighted averaging of a certain attribute value of the third target raster cell and the attribute values of its eight adjacent raster cells; the formula for calculating the final data value of the third target raster cell is as follows:
[0013] In equation (7) Represents the first raster around the smoothing calculation grid. i line, number j The raster attribute value of the column. i, j These are all temporary variables used for counting; This represents the weight of each grid cell. The original attribute value weight of the target grid cell is 0.5~1.0, and the weight of adjacent grid cells is 0~0.5.
[0014] Preferably, based on the final data value of the third target grid cell Determine the coordinate range of the third target raster cell, and fill the final data value, resolution, and projection information of the third target raster cell coordinate range into the tif container to generate a raster-formatted topographic map.
[0015] TIFF is an abbreviation for Tag Image File Format. TIFF image files are a commonly used format in graphics and image processing, serving as a container. The TIFF file used to generate a topographic map is essentially a Geotif file. The difference between this and a regular TIFF file is that it contains additional information, typically including projected coordinates, latitude and longitude, geographic information, and grid resolution. Adding variable names and their contents to the TIFF file fills in the data, similar to a JSON structure. Once the geographic information and data values are filled in, the TIFF file is generated, which is also the generation of a raster-format topographic map.
[0016] This invention provides a geographic information processing method for converting wind farm terrain vector data to raster data. It solves the problems of high computational cost and insufficient accuracy often encountered when converting unstructured vector data to structured raster data. The technical solution of this invention uses a higher-resolution quadtree for segmenting and managing map vector data, then employs horizontal and vertical ray methods to traverse vector line segments and perform weighted calculations of terrain height. Smoothing processing further improves the accuracy of the calculated terrain raster data, finally generating a terrain raster file. This method can quickly identify the inner and outer sides of irregularly shaped vector data and accurately fill the raster attributes between multiple line segments, reducing the computational cost of traversing vector data endpoint by endpoint and the error in filling raster attributes, thus improving computational efficiency and accuracy. Attached Figure Description
[0017] Figure 1 This is a schematic diagram of a geographic information processing method for converting wind farm vector data to raster data. Figure 2 A schematic diagram of map segmentation, a geographic information processing method for converting wind farm vector data to raster data; Figure 3 A schematic diagram of a ray-mapping algorithm, a geographic information processing method for converting wind farm vector data to raster data; Figure 4 This is an overall flowchart of an embodiment of a geographic information processing method for converting wind farm vector data to raster data; Figure 5 A geographic information processing method for converting wind farm vector data to raster data: map vector line segment map; Figure 6 This is a geographic information processing method for converting wind farm vector data to raster data. The result of converting the data to raster TIFF format is shown in the image. Detailed Implementation
[0018] Example 1 This invention provides a geographic information processing method for converting wind farm vector data to raster data, such as... Figure 1 As shown, the steps of this method are as follows: Step 1: By parsing the terrain map data, obtain the coordinate information (x, y) and projection information of all line segments in the terrain map data to form a coordinate set. The projection information includes the projection method and geographic coordinate information. Based on the combination of the four extreme values (x, y) in the line segment coordinate set... min y max ), (x max y max ), (x max y min ), (x min y min ), determine the four vertices of the maximum range of the raster; set the raster resolution (△x, △y), create raster data based on the raster range and resolution, and temporarily define the attribute of each raster cell as an invalid value; Step 2: Create a quadtree based on the resolution of the raster from Step 1, determine the length and width of the leaves, and set the minimum leaf height L of the quadtree. min The length and width; using the dividing line between two adjacent leaves. x i coordinates or y i The coordinates are divided into Map vector segments. When a vector segment intersects with the leaf boundary line, an endpoint is added. The divided vector segments are then inserted into a quadtree according to the coordinate range for management. Step 3: Using the horizontal ray method, traverse the vector segments managed by each leaf of the quadtree in Step 2 row by row and cell by cell, calculate the terrain height attribute value of the vector segments and fill it into the grid cell of the first target; using the vertical ray method, traverse the vector segments managed by each leaf of the quadtree in Step 2 column by cell, calculate the terrain height attribute value of the vector segments and fill it into the grid cell of the second target. Step 4: For the grid cells of the first target and the grid cells of the second target in Step 3, calculate the grid cells whose attribute values are still invalid using linear interpolation; calculate the interpolated grid cell data of the first target using the horizontal ray method and the linear interpolation method, calculate the interpolated grid cell data of the second target using the vertical ray method and the linear interpolation method, and then merge the arithmetic mean of the grid cell data of the first target and the grid cell data of the second target to create the grid cell data of the third target. Step 5: Smooth the data of the third target raster unit described in Step 4. Use the attribute value of the third target raster unit data and the attribute values of the eight adjacent units to perform a weighted average as the final data value of the third target raster unit. Create a TIFF file according to the coordinate range and resolution of the final data value of the third target raster, and fill the final data value information of the third target raster into the TIFF container to generate a raster-formatted topographic map.
[0019] In one embodiment, step 1 sets the grid resolution (Δx, Δy), creates grid data based on the grid range and resolution, and defines the attribute of each grid cell as an invalid value, which is defined as Δx meters × Δy meters based on the user-defined grid resolution. In step 2, set the minimum leaf node L of the quadtree. min The length and width are n times the grid cell length Δx and width Δy, respectively. The smallest leaf L on a quadtree... min Manage n×n grid cells, where n is a natural number.
[0020] In one embodiment, step 2 utilizes the boundary line between two adjacent leaves. x i coordinates or y i Map vector segmentation refers to the process where the terrain elevation attribute of the same vector segment remains unchanged during the segmentation process; if the coordinates of two adjacent endpoints of the vector segment are respectively ( x 1 ,y 1) ( x 2 ,y 2), then the coordinates of the endpoints of the dividing point are: (1) In formula (1) x i 、y i The x-coordinate and y-coordinate of the boundary line between any two adjacent leaves ,i It is a natural number.
[0021] In one embodiment, step 3 employs a horizontal ray method, traversing each leaf of the quadtree described in step 2 row by row and cell by cell, managing the vector line segments, calculating the terrain height attribute value of the line segments, and filling them into the grid cells of the first target; this is done by querying the center point rcenter of the first target grid cell from the quadtree based on the center point coordinates of each grid cell. x 0 ,y The location of 0), the extent of the leaf containing the first target, and the set of all vector segments in the leaf, grip; the starting point of the horizontal ray is the left boundary line of the leaf of the first target grid cell, and it passes through the center point rcenter of the first target grid cell, obtaining the intersection points of the horizontal ray and the vector segments in the quadtree leaf, which are denoted as follows: P 1 、P 2 、……、P n 、 P n+1 、……、P end Each intersection point P n The coordinates are ( x n ,y n ); Determine and calculate the intersection point P n The positional relationship between the center point rcenter of the first target grid cell and the center point of the first target grid cell is determined; based on the positional relationship between the center of the first target grid cell and the intersection point, the variable of the center of the first target grid cell is calculated using linear interpolation. : (2) In equation (2) V(P) n ) Represented as the first horizontal ray and line segment P n The terrain height attribute value of each intersection point; (3) Among them, equation (3) This indicates the center point rcenter of the grid cell and its adjacent cells. P n , P n+1 The horizontal distance weighting coefficient of the intersection points.
[0022] In one embodiment, step 3 uses the vertical ray method, traversing the vector line segments managed by each leaf of the quadtree in step 2 column by column and cell by cell, calculating the terrain height attribute value of the line segments and filling them into the grid cell of the second target location; it also queries the center point rcenter of the second target grid cell from the quadtree based on the center point coordinates of each grid cell.x 0 ,y The location of 0), the range of the leaf containing the second target grid cell, and the set of all vector segments in the leaf, grip; the starting point of the vertical ray is the upper boundary line of the leaf of the second target grid cell, and it passes through the center point rcenter of the second target grid cell, obtaining the intersection point of the vertical ray with the vector segments in the leaf of the quadtree, and recording them sequentially. P 1 、P 2 、……、P n 、P n+1 、……、P end Determine and calculate each intersection point P n The coordinates are ( x n ,y n The positional relationship between the center point rcenter of the second target grid cell and the center point rcenter; based on the intersection of the center point rcenter of the second target grid cell and each intersection point rcenter. P n The positional relationship between them was used to calculate the center variable of the second target raster cell using linear interpolation. : (4) In equation (4) V(P) n ) Represented as the perpendicular ray and line segment's first... P n The terrain height attribute value of each intersection point; (5) Among them, equation (5) This indicates the center point rcenter of the grid cell and its adjacent cells. P n , P n+1 The weighted coefficient of the perpendicular distance between the intersection points.
[0023] In one embodiment, in step 4, for the grid cells of the first target and the grid cells of the second target in step 3, the grid cells with invalid attribute values are calculated using linear interpolation. This involves traversing the grid row by row. If an invalid attribute value is detected in column C of row R: the grid value in column C-1 is recorded as fw; starting from column C+1, the first non-invalid value is found, denoted as column C+k, where k≥1, and the grid value in column C+k is recorded as bw; the grid cell attribute value in column C of row R is... The calculation formula is: (6) In formula (6) fw This represents the raster attribute value in row R and column C-1. bw This represents the raster attribute value in row R, column C+k. Similarly, iterate through and calculate the raster cell attribute values of all rows in the first target raster cell; then iterate through and calculate the raster cell attribute values of all columns in the second target raster cell.
[0024] In one embodiment, step 5 smooths the data of the third target raster cell from step 4, and uses a weighted average of a certain attribute value of the third target raster cell and the attribute values of its eight adjacent raster cells to obtain the final data value of the third target raster cell; the formula for calculating the final data value of the third target raster cell is as follows:
[0025] In equation (7) Represents the first raster around the smoothing calculation grid. i line, number j The raster attribute value of the column. i, j These are all temporary variables used for counting; This represents the weight of each grid cell. The original attribute value weight of the target grid cell is 0.5~1.0, and the weight of adjacent grid cells is 0~0.5.
[0026] In one embodiment, based on the final data value of the third target raster unit Determine the coordinate range of the third target raster cell, and fill the final data value, resolution, and projection information of the third target raster cell coordinate range into the tif container to generate a raster-formatted topographic map.
[0027] This invention provides a geographic information processing method for converting wind farm terrain vector data to raster data. It solves the problems of high computational cost and insufficient accuracy often encountered when converting unstructured vector data to structured raster data. The technical solution of this invention uses a higher-resolution quadtree for segmenting and managing map vector data, then employs horizontal and vertical ray methods to traverse vector line segments and perform weighted calculations of terrain height. Smoothing processing further improves the accuracy of the calculated terrain raster data, finally generating a terrain raster file. This method can quickly identify the inner and outer sides of irregularly shaped vector data and accurately fill the raster attributes between multiple line segments, reducing the computational cost of traversing vector data endpoint by endpoint and the error in filling raster attributes, thus improving computational efficiency and accuracy.
[0028] Example 2 In one embodiment, this invention provides a geographic information processing method for converting wind farm vector data to raster data. Taking a terrain map (map map) data of Henan Province as an example, there are many types of map data, and map data is one of them; map data refers to map data with the file extension .map. The terrain lines in the map data are as follows: Figure 5 As shown. The specific conversion flowchart is as follows. Figure 4 As shown, the steps are as follows: The steps are as follows: Step 1, Map parsing, involves parsing the terrain map data. This process obtains the coordinates (x, y) and projection information of all line segments within the terrain map data, forming a coordinate set. The projection information includes the projection method and geographic coordinates. Then, based on the four extreme values (x, y) in the line segment coordinate set... max ,x min ,y max ,y min ), determine the four vertices of the grid's maximum extent; Step 2: Grid creation. Set the grid resolution (Δx, Δy). The minimum resolution is typically 5m x 5m, and the maximum is 30m x 30m. Users can also customize other grid resolutions; this example defaults to 5m x 5m. Create grid data based on the grid range and resolution. The attributes of each grid cell are temporarily set to invalid values.
[0029] Step 3: Quadtree Creation. Based on the grid resolution described in Step 1, create a quadtree and determine the length and width of each leaf. Set the minimum leaf height L in the quadtree. min The length and width are 5 times the grid cell length Δx and width Δy, respectively, that is, an L min The leaf manages 25 grid cells.
[0030] Step 4: Line segment division, using the dividing line x between two adjacent leaves. i coordinates or y i The coordinates are used to divide the vector into segments, ensuring that each sub-vector segment appears in only one leaf, such as... Figure 2 As shown. When a vector line segment intersects with the leaf boundary line, an endpoint is added, thus splitting the vector line segment. The split vector line segments are then inserted into a quadtree according to their coordinate ranges for management. During this splitting process, the terrain elevation attribute of the same vector line segment remains unchanged. If the coordinates of two adjacent endpoints of a vector line segment are (x1, y1) and (x2, y2) respectively, then the endpoint coordinates of the split point are: (1) In formula (1) x i 、y iThe x-coordinate and y-coordinate of the boundary line between any two adjacent leaves ,i It is a natural number.
[0031] Step 5: Raycasting Algorithm 1. Using the horizontal ray traversal method, traverse the vector line segments managed by each leaf of the quadtree described in step 3, row by row and cell by cell, calculate the attributes of the line segments, and fill them into the corresponding grid cells; for example... Figure 3 As shown.
[0032] Based on the center point coordinates of each grid cell, query the current grid cell center point rcenter from the quadtree. x 0 ,y The location of 0), the range of the leaf containing the target location, and the set of all vector segments in the leaf, grip; the starting point of the horizontal ray is the left boundary of the current leaf, and it passes through the center point rcenter, obtaining the intersection points of the ray with the vector segments in the target quadtree leaf, which are denoted as follows: P 1 、P 2 、、、P n 、P n+1 、、、P end Each intersection point P n The coordinates are ( x n ,y n Determine and calculate the positional relationship between the intersection point and rcenter; based on the positional relationship between the grid center and the intersection point, calculate the grid center variable using linear interpolation. (2) (3) In equation (2) V(P) n ) Represented as the first horizontal ray and line segment P n The terrain height attribute value of each intersection point; Equation (3) This indicates the center point rcenter of the grid cell and its adjacent cells. P n , P n+1 The horizontal distance weighting coefficient value of the intersection point.
[0033] 2. Using the vertical ray method, traverse the vector line segments managed by each leaf of the quadtree described in step 3, column by column and cell by cell, calculate the terrain height value, and fill it into the corresponding grid cell. The traversal rules and calculation methods are similar to those in step 4.
[0034] Based on the center point coordinates of each grid cell, query the current grid cell center point rcenter from the quadtree. x 0 ,y The location of 0), the range of the leaf containing the target location, and the set of all vector segments in the leaf, grip; the starting point of the vertical ray is the upper boundary of the current leaf, and it passes through the center point rcenter, obtaining the intersection point of the ray with the vector segments in the target quadtree leaf, and recording them sequentially. P 1 、P 2 、、、P n 、P n+1 、、、P end Each intersection point P n The coordinates are ( x n ,y n Determine and calculate the positional relationship between the intersection point and rcenter; based on the positional relationship between the grid center and the intersection point, calculate the grid center variable using linear interpolation. (4) (5) In equation (4) V(P) n ) Represented as the perpendicular ray and line segment's first... P n The terrain height attribute value of each intersection point; Equation (5) This indicates the center point rcenter of the grid cell and its adjacent cells. P n , P n+1 The weighted coefficient of the perpendicular distance between the intersection points.
[0035] Step 6: Grid Fill For step 4, calculate the raster cells whose attribute values are still invalid using linear interpolation; traverse the raster row by row, and if an invalid attribute value is detected in the raster cell in column C of row R: 1) Record the raster value of column C-1 as fw; 2) Starting from column C+1, find the first non-invalid cell, denoted as column C+k, where k>=1. Record the cell value of column C+k as bw.
[0036] Grid cell attribute values in row R and column C The calculation formula is: (6) In formula (6) fw This represents the raster attribute value in row R and column C-1. bw This represents the raster attribute value in row R, column C+k. Similarly, iterate through and calculate the raster cell attribute values for all rows.
[0037] For step 6, the raster with invalid attribute values is calculated using linear interpolation, similar to step 5. The raster cells of all rows are traversed and the attribute values of all raster cells in the first target raster are calculated. Similarly, the raster cells of all columns are traversed column by column and the attribute values of all raster cells in the second target raster are calculated. The arithmetic mean of the two raster data is then taken and merged into one raster data.
[0038] Step 7 Smoothing Algorithm The raster data created in step 6 is smoothed. This is done by taking a weighted average of the attribute value of the current raster and the values of its eight surrounding raster cells to obtain the final value for the current raster. The calculation formula is as follows:
[0039] In equation (7) Represents the first raster cell around the target raster for smoothing calculation. i line, number j The raster attribute value of the column. i, j These are all temporary variables used for counting; This represents the weight of each grid cell. The original attribute value weight of the target grid cell is 0.5~1.0, and the weight of adjacent grid cells is 0~0.5. In this embodiment, the original attribute value weight of the target grid cell is 0.5, and the weight of adjacent grid cells is 0.5.
[0040] Step 8, TIF generation Create a TIFF file based on the raster data coordinate range, resolution, and projection information. Fill the TIFF container with the raster data information from step 7 to generate a raster-formatted topographic map, such as... Figure 6 As shown.
[0041] This invention provides a geographic information processing method for converting wind farm terrain vector data to raster data. It solves the problems of high computational cost and insufficient accuracy often encountered when converting unstructured vector data to structured raster data. The technical solution of this invention uses a higher-resolution quadtree for segmenting and managing map vector data, then employs horizontal and vertical ray methods to traverse vector line segments and perform weighted calculations of terrain height. Smoothing processing further improves the accuracy of the calculated terrain raster data, finally generating a terrain raster file. This method can quickly identify the inner and outer sides of irregularly shaped vector data and accurately fill the raster attributes between multiple line segments, reducing the computational cost of traversing vector data endpoint by endpoint and the error in filling raster attributes, thus improving computational efficiency and accuracy.
Claims
1. A geographic information processing method for converting wind farm vector data to raster data, characterized in that, The method steps are as follows: Step 1: By parsing the terrain map data, obtain the coordinate information (x, y) and projection information of all line segments in the terrain map data to form a coordinate set. The projection information includes the projection method and geographic coordinate information. Based on the combination of the four extreme values (x, y) in the line segment coordinate set... min y max ), (x max y max ), (x max y min ), (x min y min ), determine the four vertices of the maximum range of the raster; set the raster resolution (△x, △y), create raster data based on the raster range and resolution, and temporarily define the attribute of each raster cell as an invalid value; Step 2: Create a quadtree based on the grid resolution described in Step 1, determine the length and width of the leaves, and set the minimum leaf size L of the quadtree. min The length and width; using the dividing line between two adjacent leaves. x i coordinates or y i The coordinates are divided into Map vector segments. When a vector segment intersects with the leaf boundary line, an endpoint is added. The divided vector segments are then inserted into a quadtree according to the coordinate range for management. Step 3: Using the horizontal ray method, traverse the vector segments managed by each leaf of the quadtree described in Step 2 row by row and cell by cell, calculate the terrain height attribute value of the vector segments and fill them into the grid cells of the first target; using the vertical ray method, traverse the vector segments managed by each leaf of the quadtree described in Step 2 column by cell, calculate the terrain height attribute value of the vector segments and fill them into the grid cells of the second target. Step 4: For the grid cells of the first target and the grid cells of the second target in Step 3, calculate the grid cells whose attribute values are still invalid using linear interpolation; calculate the interpolated grid cell data of the first target using the horizontal ray method and the linear interpolation method, calculate the interpolated grid cell data of the second target using the vertical ray method and the linear interpolation method, and then merge the arithmetic mean of the grid cell data of the first target and the grid cell data of the second target to create the grid cell data of the third target. Step 5: Smooth the data of the third target raster unit described in Step 4. Use the attribute value of the third target raster unit data and the attribute values of the eight adjacent units to perform a weighted average as the final data value of the third target raster unit. Create a TIFF file according to the coordinate range, resolution and projection information of the final data value of the third target raster, and fill the final data value information of the third target raster into the TIFF container to generate a raster-formatted topographic map.
2. The geographic information processing method for converting wind farm vector data to raster data according to claim 1, characterized in that, In step 1, the grid resolution (Δx, Δy) is set, and grid data is created based on the grid range and resolution. The attribute of each grid cell is defined as an invalid value, which is based on the user-defined grid resolution and is defined as Δx meters × Δy meters. Step 2 describes setting the minimum leaf node L of the quadtree. min The length and width are n times the grid cell length Δx and width Δy, respectively. The smallest leaf L on a quadtree... min Manage n×n grid cells, where n is a natural number.
3. A geographic information processing method for converting wind farm vector data to raster data according to claim 1, characterized in that, Step 2 describes using the boundary line between two adjacent leaves. x i coordinates or y i Map vector segmentation refers to the process where the terrain elevation attribute of the same vector segment remains unchanged during the segmentation process; if the coordinates of two adjacent endpoints of the vector segment are respectively ( x 1 ,y 1), ( x 2 ,y 2), then the coordinates of the endpoints of the dividing point are: (1) In formula (1) x i 、y i The x-coordinate and y-coordinate of the boundary line between any two adjacent leaves ,i It is a natural number.
4. A geographic information processing method for converting wind farm vector data to raster data according to claim 1, characterized in that, Step 3 employs a horizontal ray traversal method, iterating row by row and cell by cell through the vector segments managed by each leaf of the quadtree described in Step 2, calculating the terrain height attribute value of the segments, and filling them into the first target's grid cell; this involves querying the center point rcenter of the first target grid cell from the quadtree based on the center point coordinates of each grid cell. x 0 , y The location of 0), the range of the leaf containing the first target location, and the set of all vector segments in the leaf, grip; the starting point of the horizontal ray is the left boundary line of the leaf of the first target grid cell, and it passes through the center point rcenter of the first target grid cell, obtaining the intersection points of the horizontal ray with the vector segments in the quadtree leaf, which are denoted as follows: P 1 、P 2 、……、P n 、P n+1 、……、P end Each intersection point P n The coordinates are ( x n ,y n ); Determine and calculate the intersection point P n The positional relationship between the center point rcenter of the first target grid cell and the center point rcenter is determined; based on the positional relationship between the center of the first target grid cell and the intersection point, the variable of the center of the first target grid cell is calculated using linear interpolation. : (2) In equation (2) V(P) n ) Represented as the first horizontal ray and line segment P n The terrain height attribute value of each intersection point; (3) Among them, equation (3) This indicates the center point rcenter of the grid cell and its adjacent cells. P n , P n+1 The horizontal distance weighting coefficient of the intersection point.
5. A geographic information processing method for converting wind farm vector data to raster data according to claim 1, characterized in that, Step 3 employs the vertical ray traversal method, sequentially traversing the vector segments managed by each leaf of the quadtree described in Step 2, calculating the terrain height attribute value of each segment, and filling it into the grid cell at the second target location; this involves querying the center point rcenter of the second target grid cell from the quadtree based on the center point coordinates of each grid cell. x 0 ,y The location of 0), the range of the leaf containing the second target grid cell, and the set of all vector segments in the leaf, grip; the starting point of the vertical ray is the upper boundary line of the leaf of the second target grid cell, and it passes through the center point rcenter of the second target grid cell to obtain the intersection point of the vertical ray with the vector segments in the leaf of the quadtree, and these points are recorded sequentially. P 1 、P 2 、……、P n 、 P n+1 、……、P end Determine and calculate each intersection point P n The coordinates are ( x n ,y n The positional relationship between the center point rcenter of the second target grid cell and the center point rcenter; based on the intersection of the center of the second target grid cell and each intersection point. P n The positional relationship between them was used to calculate the center variable of the second target raster cell using linear interpolation. : (4) In equation (4) V(P) n ) Represented as the perpendicular ray and line segment's first... P n The terrain height attribute value of each intersection point; (5) Among them, equation (5) This indicates the center point rcenter of the grid cell and its adjacent cells. P n , P n+1 The weighted coefficient of the perpendicular distance between the intersection points.
6. The geographic information processing method for converting wind farm vector data to raster data according to claim 1, characterized in that, In step 4, for the raster cells of the first target and the second target in step 3, the raster cells with invalid attribute values are calculated using linear interpolation. The raster is traversed row by row. If an invalid attribute value is detected in column C of row R: the raster value in column C-1 is recorded as fw; starting from column C+1, the first non-invalid value is found, denoted as column C+k, where k≥1, and the raster value in column C+k is recorded as bw; the raster cell attribute value in column C of row R is... The calculation formula is: (6) In formula (6) fw This represents the raster attribute value in row R and column C-1. bw This represents the raster attribute value in row R, column C+k. Similarly, iterate through and calculate the raster cell attribute values of all rows in the first target raster cell; then iterate through and calculate the raster cell attribute values of all columns in the second target raster cell.
7. A geographic information processing method for converting wind farm vector data to raster data according to claim 1, characterized in that, In step 5, the data of the third target raster cell described in step 4 is smoothed. The final data value of the third target raster cell is obtained by weighted averaging of a cell attribute value and the attribute values of its eight adjacent raster cells. The formula for calculating the final data value of the third target raster cell is as follows: In equation (7) Represents the first raster around the smoothing calculation grid. i line, number j The raster attribute value of the column. i, j These are all temporary variables used for counting; This represents the weight of each grid cell. The original attribute value weight of the target grid cell is 0.5~1.0, and the weight of adjacent grid cells is 0~0.
5.
8. A geographic information processing method for converting wind farm vector data to raster data according to claim 7, characterized in that, Based on the final data value of the third target grid unit Determine the coordinate range of the third target raster cell, and fill the final data value, resolution, and projection information of the third target raster cell coordinate range into the tif container to generate a raster-formatted topographic map.
Citation Information
Patent Citations
Method and system of three-dimensional geographic information system (GIS) terrain rendering
CN103035023A
Geographic vector line data visualization method and device and computer equipment
CN115794938A
