A method, system, electronic device, and storage medium for generating river flow direction maps.

By extracting and processing the central axis from river vector images, calculating the water flow vector, and generating a flow direction map, the efficiency and accuracy issues of river flow direction map generation in long-distance water areas are solved, achieving efficient and accurate flow direction map generation.

CN121074166BActive Publication Date: 2026-11-10BEIJING ZHIHUI YUNZHOU TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511003194.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-21
Publication Date
2026-11-10
Estimated Expiration
2045-07-21

AI Technical Summary

Technical Problem

Existing technologies are time-consuming and labor-intensive for creating river flow maps in long-distance real water areas. Manual operation is difficult to meet the needs of complex, large-scale, and high-precision geographic information modeling, and it also suffers from human error and inefficiency.

Method used

By extracting the river's central axis from the river vector image and performing noise reduction, the main river line and flow direction guide line are determined. The flow vector is calculated using a traversal method to generate a flow direction map. Combined with convolutional smoothing, the generation efficiency and accuracy are improved.

Benefits of technology

It effectively solves the problem of time-consuming and labor-intensive manual production in real waters over long distances, improves production efficiency and quality, enhances adaptability to complex waters and the accuracy of flow maps, and reduces human error.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121074166B_ABST
    Figure CN121074166B_ABST
Patent Text Reader

Abstract

This invention relates to the field of river flow map generation technology, and discloses a method, system, electronic device, and storage medium for generating river flow maps. The method includes: extracting the river's central axis from a first river vector image of the target river and performing noise reduction processing to obtain the river's main line; generating a river flow direction guideline based on the elevation information corresponding to the two endpoints of the river main line and adding it to the first river vector image to obtain a second river vector image; using any endpoint of the river flow direction guideline as a starting point, determining multiple traversal points in the second river vector image according to a preset traversal method, calculating the flow vector of each traversal point and adding it to the second river vector image to obtain the target river vector image, and performing convolution smoothing processing to generate the flow map of the target river. This invention solves the problems of time-consuming and labor-intensive manual production of flow maps over long distances of real water bodies, and the difficulty of multi-level slicing, improving the efficiency and quality of flow map production, and enhancing adaptability to complex water bodies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of flow direction map generation technology, and in particular to a method, system, electronic device, and storage medium for generating river flow direction maps. Background Technology

[0002] Currently, flow maps are typically created using software tools such as FlowMap Painter, Houdini, and Adobe Substance 3D Painter. While suitable for small bodies of water or game creation, current flow map creation methods face numerous challenges when applied to long-distance real-world waterways. On one hand, creating flow maps for long watersheds requires tile-based and multi-level processing, which is difficult to complete accurately and efficiently by hand, making it hard to meet the needs of creating complex and large-scale real-world waterway flow maps. On the other hand, manual creation in long-distance waterway scenarios presents significant time and labor costs, with a cumbersome and inefficient process that cannot meet the timeliness requirements of large-scale, high-precision geographic information modeling. Furthermore, manual operation is prone to introducing human error, making it difficult to guarantee the consistency and accuracy of flow maps in terms of multi-level detail.

[0003] Therefore, there is an urgent need to provide a technical solution to address the above problems. Summary of the Invention

[0004] To address the aforementioned technical problems, this invention provides a method, system, electronic device, and storage medium for generating river flow direction maps.

[0005] Firstly, the present invention provides a method for generating river flow direction maps, the technical solution of which is as follows: The river's central axis is extracted from the first river vector image of the target river and then denoised to obtain the main river line. Based on the elevation information corresponding to the two endpoints of the main river line, the river flow direction of the main river line is determined, a river flow direction guide line is generated and added to the first river vector image to obtain the second river vector image; Starting from any endpoint of the river flow direction guide line, multiple traversal points in the second river vector image are determined according to a preset traversal method, and the water flow vector corresponding to each traversal point is calculated respectively. The water flow vector corresponding to each traversal point is added to the second river vector image to obtain the target river vector image, and then convolution smoothing is performed to generate the flow direction map of the target river.

[0006] The beneficial effects of the river flow direction map generation method of the present invention are as follows: The method of this invention can effectively solve the problems of time-consuming and labor-intensive manual production in long-distance real waters and the difficulty of multi-level slicing, thereby improving production efficiency and quality and enhancing adaptability to complex waters.

[0007] Based on the above scheme, the river flow direction map generation method of the present invention can be further improved as follows.

[0008] In one alternative approach, it also includes: Determine the target boundary point corresponding to each endpoint of the main river line, and determine the elevation information of each target boundary point as the elevation information corresponding to the corresponding endpoint; the target boundary point is: the boundary point on the polygon boundary of the river vector image with the main river line added, which is closest to the corresponding endpoint.

[0009] The advantages of adopting the above-mentioned optional methods are: it can obtain the endpoint elevation more accurately, provide a reliable basis for determining the river flow direction, further improve the accuracy of the flow direction map generation, make the consistency and accuracy of the flow direction map in multi-level detail representation more guaranteed, and reduce the impact of human error.

[0010] In one alternative approach, the preset traversal method is as follows: starting from the starting point, traversing in multiple preset directions with a fixed step size until all traversed points in the second river vector image are obtained.

[0011] The advantages of adopting the above-mentioned optional method are: it can obtain each traversal point in the second river vector image in an orderly and efficient manner, ensuring that the subsequent water flow vector calculation fully covers the image area, improving the efficiency of flow direction map generation, so as to meet the needs of large-scale water flow direction map production; at the same time, different step sizes can be set by parameters to generate flow direction maps of corresponding levels, thereby ensuring consistency and accuracy in multi-level detail representation.

[0012] In one alternative approach, the flow vector includes: flow direction and flow velocity; the step of calculating the flow vector corresponding to any traversal point includes: Determine the nearest target intersection point on the polygon boundary of the second river vector image from each of the multiple preset directions, and determine the first target distance between each of the traversal points and each target intersection point, as well as the polygon tangent direction at each target intersection point; Determine each perpendicular from any given traversal point to the river flow direction guideline, and determine the second target distance from each given traversal point to each perpendicular from the river flow direction guideline, as well as the tangent direction of the perpendicular at each perpendicular; wherein, if there is a perpendicular not on the river flow direction guideline, then replace it with the point on the river flow direction guideline closest to that perpendicular; Based on the first target distance, polygon tangent direction, second target distance, and perpendicular tangent direction corresponding to any traversal point, calculate the water flow direction corresponding to any traversal point, and based on the flow velocity value, river half-width, minimum first target distance, and maximum flow velocity value at the center of the target river corresponding to any traversal point, calculate the water flow velocity corresponding to any traversal point.

[0013] The advantages of using the above-mentioned optional methods are: the direction and velocity of water flow at each traversal point can be accurately calculated, making the generated flow direction map more consistent with the actual river flow characteristics, enhancing the ability of the flow direction map to simulate real river flow conditions, and improving the accuracy of geographic information modeling.

[0014] In one alternative approach, it also includes: Obtain a first river vector image in shp format of the target river.

[0015] The advantages of using the above-mentioned optional methods are: ensuring data format compatibility, guaranteeing the smooth progress of the flow diagram generation process, and improving the compatibility and reliability of data processing.

[0016] In one alternative approach, the step of extracting the river's central axis from a first river vector image of the target river and performing denoising processing to obtain the river's main trunk line includes: The Medial Axis algorithm is used to extract the river's central axis from the first river vector image of the target river; The river's central axis is denoised to obtain the river's main trunk line.

[0017] The advantages of adopting the above-mentioned optional method are as follows: by refining the steps of extracting the river's central axis and removing noise to obtain the main line, a better initial data foundation is provided for subsequent operations such as flow direction determination, traversal, and water flow vector calculation, thereby improving the accuracy and stability of the entire flow direction map generation.

[0018] Secondly, this invention provides a river flow direction map generation system, the technical solution of which is as follows: It includes: a first processing module, a second processing module, a calculation module, and a generation module; The first processing module is used to: extract the river's central axis from the first river vector image of the target river and perform noise reduction processing to obtain the river's main line; The second processing module is used to: determine the river flow direction of the main river line based on the elevation information corresponding to the two endpoints of the main river line, generate a river flow direction guide line and add it to the first river vector image to obtain a second river vector image; The calculation module is used to: take any endpoint of the river flow direction guide line as the starting point, determine multiple traversal points in the second river vector image according to a preset traversal method, and calculate the water flow vector corresponding to each traversal point respectively; The generation module is used to: add the water flow vector corresponding to each traversal point to the second river vector image to obtain the target river vector image and perform convolution smoothing processing to generate the flow direction map of the target river.

[0019] The beneficial effects of the river flow direction map generation system of the present invention are as follows: The system of this invention can effectively solve the problems of time-consuming and labor-intensive manual production in long-distance real waters and the difficulty of multi-level slicing, thereby improving production efficiency and quality and enhancing adaptability to complex waters.

[0020] Based on the above scheme, the river flow direction map generation system of the present invention can be further improved as follows.

[0021] In an alternative embodiment, the method further includes: a determining module; the determining module is used to: Determine the target boundary point corresponding to each endpoint of the main river line, and determine the elevation information of each target boundary point as the elevation information corresponding to the corresponding endpoint; the target boundary point is: the boundary point on the polygon boundary of the river vector image with the main river line added, which is closest to the corresponding endpoint.

[0022] The advantages of adopting the above-mentioned optional methods are: it can obtain the endpoint elevation more accurately, provide a reliable basis for determining the river flow direction, further improve the accuracy of the flow direction map generation, make the consistency and accuracy of the flow direction map in multi-level detail representation more guaranteed, and reduce the impact of human error.

[0023] Thirdly, the technical solution of an electronic device according to the present invention is as follows: The system includes a memory, a processor, and a program stored in the memory and running on the processor, wherein the processor executes the program to implement the steps of the river flow direction map generation method of the present invention.

[0024] Fourthly, the technical solution of a computer-readable storage medium provided by the present invention is as follows: The computer-readable storage medium stores instructions that, when read, cause the computer-readable storage medium to perform the steps of the river flow direction map generation method of the present invention.

[0025] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0026] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 This is a schematic flowchart illustrating an embodiment of a river flow direction map generation method according to the present invention; Figure 2 This is a schematic diagram of the vector image of the first river; Figure 3 This is a schematic diagram of the river's central axis; Figure 4 A schematic diagram of the main river channel; Figure 5 A schematic diagram of the river's central axis after removing the outermost capillary lines; Figure 6 A comparative diagram showing the process of removing the outermost capillary lines from the central axis of a river before and after its formation. Figure 7 A schematic diagram for calculating the longest line segment; Figure 8 A schematic diagram for calculating the width of a river; Figure 9 A diagram illustrating the removal of the smaller lines at both ends of the longest line segment; Figure 10 A schematic diagram of the longest line of the main trunk; Figure 11 A diagram illustrating the process of removing small lines while retaining branches; Figure 12 This is a schematic diagram of the vector image of the second river; Figure 13 This is a schematic diagram of the traversal points in the vector image of the second river. Figure 14 A schematic diagram for a preset direction; Figure 15 A schematic diagram of the intersection of the target points; Figure 16 This is a diagram showing the foot of the perpendicular corresponding to the traversed point; Figure 17 One of the flow direction diagrams for the target river; Figure 18 This is a schematic diagram illustrating the principle of convolution smoothing. Figure 19 A rendered image of the target river; Figure 20A hand-drawn illustration of the vector image of the second river; Figure 21 The second diagram showing the flow direction of the target river; Figure 22 This is a schematic diagram of an embodiment of a river flow direction map generation system according to the present invention; Figure 23 This is a schematic diagram of an embodiment of an electronic device according to the present invention. Detailed Implementation

[0027] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein.

[0028] Figure 1 This diagram illustrates a flowchart of an embodiment of a river flow direction map generation method provided by the present invention. This method can be executed by an electronic device such as a terminal device or a server. The terminal device can be any fixed or mobile terminal, such as a user equipment (UE), mobile device, user terminal, terminal, cellular phone, cordless phone, personal digital assistant (PDA), handheld device, computing device, vehicle-mounted device, or wearable device. The server can be a single server or a server cluster consisting of multiple servers. Any electronic device can implement the river flow direction map generation method by having its processor call computer-readable instructions stored in its memory. Figure 1 As shown, it includes the following steps: S1. Extract the river's central axis from the first river vector image of the target river and perform noise reduction processing to obtain the river's main line.

[0029] The target river in this embodiment is any river selected, primarily focusing on long-watershed rivers. For example... Figure 2 As shown, the first river vector image is a directly acquired river vector image, containing a polygonal region of the target river. Figure 3 As shown, the river's central axis refers to the line connecting the center of the river on a plane, representing the main course of the river. The river's central axis is commonly used to describe the river's morphology, analyze its evolution, and for related hydraulic engineering design and planning. For example... Figure 4 As shown, the main channel of a river refers to the portion of the river with the largest flow, strongest continuity, and most significant impact on the watershed's geomorphology and ecosystem. The main channel represents the river's primary flow direction and water transport path, and is a core component of the river network. The main channel typically begins at the river's source, extends along the lowest point of the terrain, and eventually flows into a lake, ocean, or other large body of water.

[0030] S1 also includes: acquiring a first river vector image of the target river in shp format.

[0031] Among them, the river vector image in shp format is used to describe the location and shape of the river in geospatial space.

[0032] In one alternative approach, S1 includes: The Medial Axis algorithm is used to extract the river's central axis from the first river vector image of the target river.

[0033] Among them, the Medial Axis algorithm is the central axis algorithm. In the river vector image, this algorithm extracts the river's central axis by calculating a skeleton composed of a series of points inside the river, and the circles (spheres) obtained with these points as centers are tangent to the river boundary, and there are at least two tangent points.

[0034] The river's central axis is denoised to obtain the river's main trunk line. Specifically: ① For the river's central axis, all discontinuous endpoints are selected and designated as the first endpoint; common points where any first endpoint intersects with other line segments are obtained, and line segments between the first endpoint and its corresponding common points are removed. This process is repeated for each endpoint until the steps of obtaining common points where any first endpoint intersects with other line segments and removing line segments between the first endpoint and its corresponding common points are performed. This yields the river's central axis after removing the outermost capillary lines (e.g., ...). Figure 5 (As shown); It should be noted that the comparison before and after removing the outermost capillary lines along the river's central axis is as follows: Figure 6 As shown.

[0035] ② Using any discontinuity point on the river's central axis (excluding closed loops) after removing the outermost capillary lines as the starting point, calculate the longest and second longest line segments; for example... Figure 7 As shown, with Figure 7 Taking point A as the starting point, determine the longest line segment AB and the second longest line segment AC; then calculate and find the bifurcation point D of the two line segments, compare the length of line segment AD with the length of the remaining part CD after subtracting AD from the second longest line segment AC. If line segment AD is longer than line segment CD, then the longest line segment is AB; otherwise, the longest line segment is BC.

[0036] ③ For example Figure 8 As shown, perpendicular lines are drawn at preset intervals to the longest line segment. The intersection point of each perpendicular line with the polygon boundary of the target river is determined, and then the river width corresponding to each perpendicular line is determined. The average of all river widths is used to obtain the river width of the target river.

[0037] ④ Perform closed-loop optimization on the longest line segment and remove the two ends of the longest line segment; it should be noted that the two ends of the line segment may be small lines, and if they are not removed, the water flow direction at that point will be incorrect; calculate the nearest distance from the endpoint to the polygon boundary. If the nearest distance is less than the set threshold for small line determination (e.g., 1 / 3 of the river width), then the line segment is considered a small line. Find the intersection point of the next line segment along the line until the nearest distance from that point to the polygon boundary is greater than the threshold, then delete the line segment from the endpoint to that point. Figure 9 As shown, the distance from endpoint A to the polygon boundary is less than a threshold. Point B is found along the line. Similarly, point B also does not meet the threshold. Point C is found; the distance from point C to the polygon boundary is greater than the threshold. The line segment AC is deleted. After deleting the smaller lines at both ends and filling in the closed loop, the longest main line is generated (e.g., ...). Figure 10 (As shown).

[0038] ⑤ Based on the river's central axis after removing the outermost capillary lines in ①, continue searching from the outermost endpoints until the longest line segment is reached. Then, using the intersection point with the longest line segment, search in reverse to find the longest line segment on that branch. If the longest line segment of that branch is greater than the branch length threshold (e.g., twice the river width), it is determined to be a branch line; otherwise, it is a small line and is deleted. Figure 11 As shown, taking point A as an example, find point B on the longest line segment, and then find the farthest point C of the branch. The length of line segment BC is less than the threshold, so it is judged as a small line and the branch is deleted. Similarly, for lines judged as branches, it is also necessary to further calculate the longest line of the branch, the river width, and remove small lines and retain lower-level branches. That is, the data of the branches are repeated in steps ③-⑤. The difference is that the branches only need to process one endpoint, and finally the main river line is obtained.

[0039] S2. Based on the elevation information corresponding to the two endpoints of the main river line, determine the river flow direction of the main river line, generate a river flow direction guide line and add it to the first river vector image to obtain the second river vector image.

[0040] Elevation information refers to the vertical distance of a point relative to a reference surface. River flow direction is defined as the flow from the endpoint corresponding to higher elevation information to the endpoint corresponding to lower elevation information. River flow direction guidance lines are the main river lines with added flow direction information. For example... Figure 12 As shown, the second river vector image is a river vector image with river flow direction guide lines added on top of the second river vector image.

[0041] It should be noted that each point on the first river vector image and each point on the river flow direction guide line have a coordinate value equivalent to a coordinate value in the same coordinate system. According to the absolute coordinate value corresponding to the river flow direction guide line, the river flow direction guide line is mapped onto the first river vector image to obtain the second river vector image.

[0042] S2 also includes: Identify the target boundary points corresponding to each endpoint of the main river channel, and determine the elevation information of each target boundary point as the elevation information corresponding to the corresponding endpoint.

[0043] Each endpoint corresponds to a target boundary point, and each target boundary point corresponds to an elevation information point. The correspondence is: endpoint → target boundary point → elevation information. A target boundary point is the boundary point on the polygonal boundary of the river vector image with the main river line added, that is closest to its corresponding endpoint. For example, for endpoint B on the main river line A, there exists a boundary point C that is closest to endpoint B. This boundary point C is located on the polygonal boundary of the river vector image with the main river line A added. It should be noted that the polygonal boundary is the outline of the river vector image.

[0044] S3. Taking any endpoint of the river flow direction guide line as the starting point, determine multiple traversal points in the second river vector image according to the preset traversal method, and calculate the water flow vector corresponding to each traversal point.

[0045] The preset traversal method is as follows: starting from the starting point, traverse in multiple preset directions according to a fixed step size until all traversal points in the second river vector image are obtained (e.g., ...). Figure 13 As shown). Figure 14 As shown, multiple preset directions include due east, due south, due west, due north, southeast, southwest, northwest, and northeast by default. These can be added or removed as needed; no restrictions are set here. Each traversal point corresponds to a water flow vector, which includes the water flow direction and velocity. The fixed step size is 1m by default, but can be adjusted as needed; no restrictions are set here.

[0046] It should be noted that during the traversal process, the starting point is used as the first traversal point. The first traversal is performed in eight directions with a fixed step size, resulting in eight traversal points, for a total of nine traversal points. The traversal is then performed in a loop with a fixed step size. During the traversal, if a traversal point is located outside the polygon boundary corresponding to the second river vector image, the traversal point is excluded. The traversal continues until all traversal points generated in a certain traversal process are located outside the polygon boundary corresponding to the second river vector image. At this point, the traversal stops, and all traversal points in the second river vector image are obtained.

[0047] In S3, the steps for calculating the flow vector corresponding to any traversal point include: Determine the nearest target intersection point on the polygon boundary of the second river vector image from each of the multiple preset directions, and determine the first target distance between each of the traversal points and each target intersection point, as well as the polygon tangent direction at each target intersection point.

[0048] In this system, the number of target intersection points corresponding to each traversal point is the same as and corresponds one-to-one with the number of preset directions. When the number of preset directions is eight, the number of target intersection points corresponding to each traversal point is eight. It should be noted that any traversal point may have multiple intersection points with the polygon boundary of the second river vector image in a certain preset direction. Since the lines connecting the traversal point to the other intersection points, except for the closest intersection point, will not all be within the polygon boundary, only the "closest intersection point on the polygon boundary of the second river vector image from each preset direction" is selected as the target intersection point. For example... Figure 15 As shown, there are 4 target intersection points between traversal point A and the polygon boundary. Among them, the closest intersection point 3 and the second closest intersection point 4 are due east. Intersection point 4 is separated from traversal point A by an island, which cannot affect the direction and speed of the water flow at traversal point A, so it needs to be excluded.

[0049] In this system, the number of first target distances corresponding to each traversal point is the same as and corresponds one-to-one with the number of preset directions. When the number of preset directions is eight, the number of first target distances corresponding to each traversal point is eight.

[0050] It should be noted that the polygon tangent direction refers to the tangent direction at the location of the target intersection point on the polygon boundary. The polygon tangent direction is in the same direction as the river flow guide line. When the distance to the first target exceeds a first distance threshold (e.g., 1 / 2 of the river width), the weight of the intersection point parameter beyond this threshold is reduced to 0, meaning that intersection points in that direction are no longer calculated. Unlike calculating the perpendicular, the weight of all target intersection points in the eight directions can be all 0; in this case, only the perpendicular parameter is considered.

[0051] Determine each perpendicular from any given traversal point to the river flow direction guideline, and determine the second target distance from each given traversal point to each perpendicular from the river flow direction guideline, as well as the tangent direction of the perpendicular at each perpendicular.

[0052] Each perpendicular foot corresponds to a second target distance and the tangent direction of the first perpendicular foot. If a perpendicular foot exists outside the river flow direction guideline, the point on the river flow direction guideline closest to that perpendicular foot is used as the replacement. It should be noted that the perpendicular foot tangent direction refers to the tangent direction at the location of the perpendicular foot point on the river flow direction guideline. For example... Figure 16As shown, there are three perpendiculars between traversal point A and the river flow direction guideline. Perpendicular point 3 is not on the river flow direction guideline, so the point on the river flow direction guideline closest to this perpendicular is used instead. Furthermore, when calculating the perpendicular from the traversal point to the river flow direction guideline, it is necessary to ensure that the second target distance of the perpendicular is within a second distance threshold (e.g., 1 / 2 of the river width). Perpendiculars exceeding the second distance threshold have their parameter weight reduced to 0, meaning the second target distance for perpendiculars exceeding the second distance threshold is no longer calculated. If no perpendicular exists within the second distance threshold range, the nearest perpendicular is used.

[0053] Based on the first target distance, polygon tangent direction, second target distance, and perpendicular tangent direction corresponding to any traversal point, calculate the water flow direction corresponding to any traversal point, and based on the flow velocity value, river half-width, minimum first target distance, and maximum flow velocity value at the center of the target river corresponding to any traversal point, calculate the water flow velocity corresponding to any traversal point.

[0054] Specifically, the water flow direction corresponding to any given traversal point is calculated based on the first preset formula and in combination with the first target distance, polygon tangent direction, second target distance, and perpendicular tangent direction corresponding to the given traversal point.

[0055] The first preset formula is: ; This indicates the direction of water flow corresponding to the traversed point. Indicates the first The direction of the perpendicular tangent. This represents the number of valid perpendiculars corresponding to the traversed points. Indicates the first The distance to the second target corresponding to each perpendicular foot. This represents the second distance threshold. Indicates the effective number of target intersection points. Indicates the first The tangent direction of the polygon at the intersection of the target points Indicates the traversal point and the first The distance to the first target at the intersection of the target points. This represents the first distance threshold.

[0056] Specifically, the water flow velocity corresponding to any traversal point is calculated based on the second preset formula and in combination with the flow velocity value, river half-width, minimum first target distance, and the maximum flow velocity value at the center of the target river.

[0057] The second preset formula is: ; This indicates the water flow velocity corresponding to the traversed point. Indicates the maximum flow velocity at the center; This represents the minimum first target distance, i.e., the minimum value among the effective first target distances; This indicates half the width of the river, or half the width of the river.

[0058] Specifically, the water flow direction corresponding to any traversal point is normalized, and the water flow vector corresponding to any traversal point is obtained by multiplying the normalized water flow direction with the water flow velocity.

[0059] in, ; This represents the water flow vector corresponding to the traversed point. This indicates the normalized direction of water flow.

[0060] S4. Add the water flow vector corresponding to each traversal point to the second river vector image to obtain the target river vector image and perform convolution smoothing to generate the flow direction map of the target river.

[0061] Specifically, based on the relative positions of the traversal points in the second river vector image, the water flow vector corresponding to each traversal point is added to the second river vector image to obtain the target river vector image. Then, the target river vector image is subjected to convolution smoothing processing to generate... Figure 17 The diagram shows the flow direction of the target river.

[0062] It should be noted that, as Figure 18 As shown, the convolutional smoothing process is as follows: It iterates through the water flow vectors corresponding to all traversal points, recalculating the water flow vector for each traversal point. That is, the water flow vector for any traversal point is the average of the sums of the water flow vectors of that traversal point and its eight adjacent traversal points. By taking the average of these nine values ​​to replace the intermediate pixel value, a smoothing effect is achieved, generating the flow direction map of the target river. The specific calculation formula is: ;in, This represents the water flow vector corresponding to the traversed points after smoothing. This represents the water flow vector corresponding to the kth traversal point.

[0063] In a river flow direction map generation method of this embodiment, the method further includes the following step after S4: S5. Render the flow direction map of the target river to generate a rendered image of the target river, such as... Figure 19 As shown.

[0064] In the flow map, each pixel can be regarded as a vector. For example, the R channel represents the east direction and the G channel represents the north direction. The two channels R and G can determine a direction vector, which represents the direction of water flow at that location. During rendering, the shader samples from the texture of the image and then changes it periodically at a certain frequency to achieve the water flow effect.

[0065] It should be noted that, as Figure 20 As shown, in this embodiment, a river flow direction guideline can also be constructed by hand and added to the first river vector image to obtain a second river vector image, and steps S3-S4 are used to generate the second river vector image. Figure 21 The diagram shows the flow direction of the target river.

[0066] The technical solution of this embodiment can effectively solve the problems of time-consuming and labor-intensive manual production in long-distance real waters and the difficulty of multi-level slicing, thereby improving production efficiency and quality and enhancing adaptability to complex waters.

[0067] Figure 22 A schematic diagram of an embodiment of a river flow direction map generation system 200 provided by the present invention is shown. Figure 22 As shown, the system 200 includes: a first processing module 210, a second processing module 220, a calculation module 230, and a generation module 240; The first processing module 210 is used to: extract the river's central axis from the first river vector image of the target river and perform noise reduction processing to obtain the river's main line; The second processing module 220 is used to: determine the river flow direction of the main river line based on the elevation information corresponding to the two endpoints of the main river line, generate a river flow direction guide line and add it to the first river vector image to obtain a second river vector image; The calculation module 230 is used to: take any endpoint of the river flow direction guide line as the starting point, determine multiple traversal points in the second river vector image according to a preset traversal method, and calculate the water flow vector corresponding to each traversal point respectively; The generation module 240 is used to: add the water flow vector corresponding to each traversal point to the second river vector image to obtain the target river vector image and perform convolution smoothing processing to generate the flow direction map of the target river.

[0068] In an alternative embodiment, the method further includes: a determining module; the determining module is used to: Determine the target boundary point corresponding to each endpoint of the main river line, and determine the elevation information of each target boundary point as the elevation information corresponding to the corresponding endpoint; the target boundary point is: the boundary point on the polygon boundary of the river vector image with the main river line added, which is closest to the corresponding endpoint.

[0069] In one alternative approach, the preset traversal method is as follows: starting from the starting point, traversing in multiple preset directions with a fixed step size until all traversed points in the second river vector image are obtained.

[0070] In one alternative approach, the water flow vector includes: water flow direction and water flow velocity; the calculation module 230 is specifically used for: Determine the nearest target intersection point on the polygon boundary of the second river vector image from each of the multiple preset directions, and determine the first target distance between each of the traversal points and each target intersection point, as well as the polygon tangent direction at each target intersection point; Determine each perpendicular from any given traversal point to the river flow direction guideline, and determine the second target distance from each given traversal point to each perpendicular from the river flow direction guideline, as well as the tangent direction of the perpendicular at each perpendicular; wherein, if there is a perpendicular not on the river flow direction guideline, then replace it with the point on the river flow direction guideline closest to that perpendicular; Based on the first target distance, polygon tangent direction, second target distance, and perpendicular tangent direction corresponding to any traversal point, calculate the water flow direction corresponding to any traversal point, and based on the flow velocity value, river half-width, minimum first target distance, and maximum flow velocity value at the center of the target river corresponding to any traversal point, calculate the water flow velocity corresponding to any traversal point.

[0071] In one alternative approach, it also includes: obtaining the module; The acquisition module is used to: acquire a first river vector image in shapefile format of the target river.

[0072] In one alternative embodiment, the first processing module 210 is specifically configured to: The Medial Axis algorithm is used to extract the river's central axis from the first river vector image of the target river; The river's central axis is denoised to obtain the river's main trunk line.

[0073] It should be noted that the beneficial effects of the river flow direction map generation system 200 provided in the above embodiments are the same as those of the river flow direction map generation method described above, and will not be repeated here. Furthermore, the system provided in the above embodiments is only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the system can be divided into different functional modules according to the actual situation to complete all or part of the functions described above. In addition, the system and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process is detailed in the method embodiments, and will not be repeated here.

[0074] The river flow direction map generation system 200 of the present invention can be a computer program (including program code) running on a computer device. For example, the river flow direction map generation system of the present invention is an application software that can be used to execute the corresponding steps in the river flow direction map generation method of the present invention.

[0075] In some embodiments, the river flow direction map generation system of the present invention can be implemented using a combination of hardware and software. For example, the river flow direction map generation system of the present invention can be a processor in the form of a hardware decoding processor, programmed to execute the river flow direction map generation method of the present invention. For instance, the hardware decoding processor can employ one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components. The modules described in the embodiments of the present invention can be implemented in software or hardware. The names of the modules do not necessarily constitute a limitation on the module itself.

[0076] An electronic device according to an embodiment of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements any of the above-mentioned river flow direction map generation methods. That is, an electronic device according to an embodiment of the present invention may include, but is not limited to: a processor and a memory; the memory is used to store the computer program; the processor is used to execute the river flow direction map generation method shown in any embodiment of the present invention by calling the computer program.

[0077] In one alternative embodiment, an electronic device is provided, such as Figure 23 As shown, Figure 23 The illustrated electronic device 4000 includes a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, for example, via a bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, which can be used for data interaction between the electronic device and other electronic devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 4004 is not limited to one type, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present invention.

[0078] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this invention. Processor 4001 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.

[0079] Bus 4002 may include a path for transmitting information between the aforementioned components. Bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 4002 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 23 The bus 4002 is represented by only one thick line, but this does not mean that there is only one bus or one type of bus.

[0080] The memory 4003 may be ROM (Read Only Memory) or other types of static storage devices capable of storing static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices capable of storing information and instructions, or EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.

[0081] The memory 4003 stores application code (computer program) for executing the present invention, and its execution is controlled by the processor 4001. The processor 4001 executes the application code stored in the memory 4003 to implement the content shown in the foregoing method embodiments.

[0082] Among them, electronic devices can also be terminal devices. A terminal device can be any terminal device that can install applications and access web pages through applications, including at least one of smartphones, tablets, laptops, desktop computers, smart speakers, smartwatches, smart TVs, and smart in-vehicle devices.

[0083] It should be noted that, Figure 23 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.

[0084] An embodiment of the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the above-described methods for generating river flow direction maps.

[0085] Alternatively, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, a floppy disk, and an optical data storage device, etc.

[0086] In an exemplary embodiment, a computer program product or computer program is also provided, which includes computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the aforementioned river flow direction map generation method.

[0087] Computer program code for performing the operations of this invention can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0088] It should be understood that the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of methods and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0089] The computer-readable storage medium provided in this invention can be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0090] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the method shown in the above embodiments.

[0091] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this invention is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-disclosed concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this invention.

[0092] It should be noted that the terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and represent a limitation on a specific order or sequence. Where appropriate, the order of use for similar objects can be interchanged so that the embodiments of this application described herein can be implemented in an order other than that shown or described.

[0093] Those skilled in the art will recognize that this invention can be implemented as a system, method, or computer program product. Therefore, this invention can be specifically implemented in the following forms: it can be entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software, generally referred to herein as a "circuit," "module," or "system." Furthermore, in some embodiments, this invention can also be implemented as a computer program product contained in one or more computer-readable media, which includes computer-readable program code.

[0094] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A method for generating a river flow direction map, characterized in that, include: The river's central axis is extracted from the first river vector image of the target river and then denoised to obtain the main river line. Based on the elevation information corresponding to the two endpoints of the main river line, the river flow direction of the main river line is determined, a river flow direction guide line is generated and added to the first river vector image to obtain the second river vector image; Starting from any endpoint of the river flow direction guide line, multiple traversal points in the second river vector image are determined according to a preset traversal method, and the water flow vector corresponding to each traversal point is calculated respectively. The water flow vector corresponding to each traversal point is added to the second river vector image to obtain the target river vector image, and then convolution smoothing is performed to generate the flow direction map of the target river. The preset traversal method is as follows: starting from the starting point, traversing in multiple preset directions according to a fixed step size until all traversal points in the second river vector image are obtained; The water flow vector includes: water flow direction and water flow velocity; the steps for calculating the water flow vector corresponding to any traversal point include: Determine the nearest target intersection point on the polygon boundary of the second river vector image from each of the multiple preset directions, and determine the first target distance between each of the traversal points and each target intersection point, as well as the polygon tangent direction at each target intersection point; Determine each perpendicular from any given traversal point to the river flow direction guideline, and determine the second target distance from each given traversal point to each perpendicular from the river flow direction guideline, as well as the tangent direction of the perpendicular at each perpendicular; wherein, if there is a perpendicular not on the river flow direction guideline, then replace it with the point on the river flow direction guideline closest to that perpendicular; Based on the first target distance, polygon tangent direction, second target distance, and perpendicular tangent direction corresponding to any traversal point, calculate the water flow direction corresponding to any traversal point; and based on the flow velocity value, river half-width, minimum first target distance, and maximum flow velocity value at the center of the target river corresponding to any traversal point, calculate the water flow velocity corresponding to any traversal point. Specifically, the water flow direction corresponding to any given traversal point is calculated based on a first preset formula and in combination with the first target distance, polygon tangent direction, second target distance, and perpendicular tangent direction corresponding to that traversal point; the first preset formula is: ; This indicates the direction of water flow corresponding to the traversed point. Indicates the first The direction of the perpendicular foot tangent This represents the number of valid perpendiculars corresponding to the traversed points. Indicates the first The distance to the second target corresponding to each perpendicular foot. This represents the second distance threshold. Indicates the effective number of target intersection points. Indicates the first The tangent direction of the polygon at the intersection of the target points Indicates the traversal point and the first The distance to the first target at the intersection of the target points. Indicates the first distance threshold; The water flow velocity corresponding to any traversal point is calculated based on the second preset formula and in combination with the flow velocity value, river half width, minimum first target distance, and the maximum flow velocity value at the center of the target river. The water flow direction corresponding to any traversal point is normalized, and the water flow vector corresponding to any traversal point is obtained by multiplying the normalized water flow direction with the water flow velocity. ; This represents the water flow vector corresponding to the traversed point. This indicates the water flow velocity corresponding to the traversed point. This indicates the normalized direction of water flow.

2. The method for generating river flow direction maps according to claim 1, characterized in that, Also includes: Determine the target boundary point corresponding to each endpoint of the main river line, and determine the elevation information of each target boundary point as the elevation information corresponding to the corresponding endpoint; The target boundary point is the boundary point on the polygonal boundary of the river vector image with the main river line added, which is closest to the corresponding endpoint.

3. The method for generating river flow direction maps according to claim 1, characterized in that, Also includes: Obtain a first river vector image in shp format of the target river.

4. The method for generating river flow direction maps according to claim 1, characterized in that, The steps for extracting the river's central axis from the first river vector image of the target river and performing noise reduction to obtain the river's main line include: The Medial Axis algorithm is used to extract the river's central axis from the first river vector image of the target river; The river's central axis is denoised to obtain the river's main trunk line.

5. A river flow direction map generation system, characterized in that, include: The system comprises a first processing module, a second processing module, a calculation module, and a generation module. The first processing module is used to: extract the river's central axis from the first river vector image of the target river and perform noise reduction processing to obtain the river's main line; The second processing module is used to: determine the river flow direction of the main river line based on the elevation information corresponding to the two endpoints of the main river line, generate a river flow direction guide line and add it to the first river vector image to obtain a second river vector image; The calculation module is used to: take any endpoint of the river flow direction guide line as the starting point, determine multiple traversal points in the second river vector image according to a preset traversal method, and calculate the water flow vector corresponding to each traversal point respectively; The generation module is used to: add the water flow vector corresponding to each traversal point to the second river vector image to obtain the target river vector image and perform convolution smoothing processing to generate the flow direction map of the target river; The preset traversal method is as follows: starting from the starting point, traversing in multiple preset directions according to a fixed step size until all traversal points in the second river vector image are obtained; The water flow vector includes: water flow direction and water flow velocity; the calculation module is specifically used for: Determine the nearest target intersection point on the polygon boundary of the second river vector image from any traversal point from the plurality of preset directions, and determine the first target distance between any traversal point and each target intersection point, as well as the polygon tangent direction at each target intersection point; Determine each perpendicular from any given traversal point to the river flow direction guideline, and determine the second target distance from each given traversal point to each perpendicular from the river flow direction guideline, as well as the tangent direction of the perpendicular at each perpendicular; wherein, if there is a perpendicular not on the river flow direction guideline, then replace it with the point on the river flow direction guideline closest to that perpendicular; Based on the first target distance, polygon tangent direction, second target distance, and perpendicular tangent direction corresponding to any traversal point, calculate the water flow direction corresponding to any traversal point; and based on the flow velocity value, river half-width, minimum first target distance, and maximum flow velocity value at the center of the target river corresponding to any traversal point, calculate the water flow velocity corresponding to any traversal point. Specifically, the water flow direction corresponding to any given traversal point is calculated based on a first preset formula and in combination with the first target distance, polygon tangent direction, second target distance, and perpendicular tangent direction corresponding to that traversal point; the first preset formula is: ; This indicates the direction of water flow corresponding to the traversed point. Indicates the first The direction of the perpendicular tangent. This represents the number of valid perpendiculars to the traversed points. Indicates the first The distance to the second target corresponding to each perpendicular foot. This represents the second distance threshold. Indicates the effective number of target intersection points. Indicates the first The tangent direction of the polygon at the intersection of the target points Indicates the traversal point and the first The distance to the first target at the intersection of the target points. Indicates the first distance threshold; The water flow velocity corresponding to any traversal point is calculated based on the second preset formula and in combination with the flow velocity value, river half width, minimum first target distance, and the maximum flow velocity value at the center of the target river. The water flow direction corresponding to any traversal point is normalized, and the water flow vector corresponding to any traversal point is obtained by multiplying the normalized water flow direction with the water flow velocity. ; This represents the water flow vector corresponding to the traversed point. This indicates the water flow velocity corresponding to the traversed point. This indicates the normalized direction of water flow.

6. The river flow direction map generation system according to claim 5, characterized in that, Also includes: The determining module is used for: Determine the target boundary point corresponding to each endpoint of the main river line, and determine the elevation information of each target boundary point as the elevation information corresponding to the corresponding endpoint; the target boundary point is: the boundary point on the polygon boundary of the river vector image with the main river line added, which is closest to the corresponding endpoint.

7. An electronic device, characterized in that, The electronic device includes a processor coupled to a memory storing at least one computer program, which is loaded and executed by the processor to enable the electronic device to implement the river flow direction map generation method as described in any one of claims 1 to 4.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one computer program, which is loaded and executed by a processor to enable the computer-readable storage medium to implement the river flow direction map generation method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • GPU-based large-scale natural river channel water body rendering method, device and equipment

    CN113674437A

  • River streamline generation method, terminal equipment and program product

    CN118262006A