A method and system for automatically extracting a pollution diffusion path of a river
By constructing a directed network graph and a weighted shortest path algorithm, the diffusion paths of pollutants in rivers are automatically extracted, solving the problems of low efficiency and poor accuracy of manual drawing in existing technologies, and realizing fast and accurate path calculation and emergency response support.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SICHUAN INST OF GEOLOGICAL ENG INVESTIGATION
- Filing Date
- 2026-05-22
- Publication Date
- 2026-06-19
Smart Images

Figure CN122240739A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of watershed water environment safety technology, and in particular to an automatic method and system for extracting river pollution diffusion paths. Background Technology
[0002] Rivers serve as vital water resources and ecological corridors, often accompanied by various cross-river infrastructure (such as pipelines and bridges) and riverside industrial enterprises. In the event of emergencies such as hazardous chemical transportation accidents, engineering leaks, or illegal discharge of pollutants, pollutants can be rapidly carried downstream by the water flow, easily triggering cross-regional watershed-wide environmental pollution incidents and posing a serious threat to sensitive receptors such as downstream drinking water sources.
[0003] In responding to such emergencies, "time" is a core element of emergency response. To scientifically formulate a response plan, the command center must immediately determine the actual river distance the pollutant travels from the leak source to various potential downstream control points (such as monitoring stations, water intakes, and bridge interception points). Only by accurately obtaining this distance parameter, combined with real-time hydrological flow velocity, can the estimated arrival time of the pollutants be calculated, thereby determining which control points are feasible for deployment and accurately allocating emergency supplies and rescue personnel.
[0004] Currently, significant technical bottlenecks remain in obtaining diffusion paths and distances during the development of water pollution emergency response plans and the analysis of accident sites.
[0005] 1. Over-reliance on manual interaction and poor timeliness: Existing methods still largely rely on operators visually interpreting remote sensing imagery, manually drawing the river centerline and measuring segments. Due to the meandering nature of rivers, manual drawing is not only time-consuming and labor-intensive but also heavily influenced by the operator's subjective experience. This approach struggles to guarantee the geometric accuracy and reproducibility of path extraction, leading to discrepancies in data obtained by different personnel.
[0006] 2. General-purpose analysis tools have excessively high requirements for data quality: Existing GIS network analysis functions have extremely strict requirements for the connectivity of basic vector data. However, actual surveying data often contains topological errors such as broken river sections and unclosed endpoints, which often cannot be calculated directly using general-purpose tools. They must first undergo tedious manual cleaning and editing, making it difficult to meet the practical needs of "instant response" in emergency situations.
[0007] Therefore, the applicant has developed an automatic extraction method and system for river pollution diffusion paths to solve the above problems. Summary of the Invention
[0008] This invention proposes an automatic extraction method and system for river pollution diffusion paths, which solves the problems of existing methods for obtaining river pollutant diffusion paths and distances, such as reliance on manual drawing, low efficiency, lack of flow direction constraints, poor accuracy, and low response speed.
[0009] The present invention achieves the above objectives through the following technical solutions:
[0010] This invention discloses an automatic method for extracting river pollution diffusion paths, comprising:
[0011] Obtain vector and elevation data of the river, which includes several river sections;
[0012] A directed network graph is constructed based on the vector and elevation data of the river. The nodes of the directed network graph are the endpoints of the river segments, the directed edges are the river segments, and the edge weights are the lengths through which the river segments flow.
[0013] Obtain the coordinates of the pollution source input point. Construct a buffer zone with the pollution source input point as the center and a preset radius. Select river segments that intersect with the buffer zone in the directed network graph to obtain a candidate set of river segments. Select the river segment closest to the pollution source input point from the candidate set. Divide the river segment according to the projection position of the pollution source input point on the nearest river segment to generate new nodes and directed edges. Update the directed network graph according to the new nodes and directed edges. Obtain the coordinates of the proposed emergency control point. Similarly, update the directed network graph according to the coordinates of the emergency control point.
[0014] Based on the weighted shortest path algorithm, the shortest pollutant diffusion path from the pollution source input point to the emergency control point is calculated in the updated directed network graph.
[0015] Furthermore, obtain the river's vector data, including:
[0016] Obtain the raw vector data of the river;
[0017] The original vector data is subjected to coordinate system identification. If it is a geographic coordinate system, the geographic coordinates are transformed to planar projected coordinates using a projection transformation function.
[0018] Each river segment in the original vector data after coordinate transformation is represented as a polyline point sequence;
[0019] Obtain the endpoints in the sequence of all polyline points to get the endpoint set. The endpoints include the start and end points of each river. Aggregate the neighboring endpoints in the endpoint set based on Euclidean distance and preset endpoint aggregation tolerance to get the aggregated endpoint set.
[0020] The vector data of the river is obtained by processing dangling points and removing isolated subnets after the vector data of the adjacent endpoints are aggregated.
[0021] Furthermore, the aggregation of neighboring endpoints in the endpoint set specifically includes:
[0022] Elements of each river segment Represented as a broken line point sequence: ;
[0023] in represents the coordinates of the points on the polyline, where i represents the river segment number and m represents the total number of nodes in the river segment;
[0024] Then its starting point and the end point The coordinates are as follows: ;
[0025] The set of all endpoints is represented as :
[0026] ;
[0027] Where M represents the total number of river segments;
[0028] Set endpoint aggregation tolerance Euclidean distance is used as the discrimination criterion:
[0029] ;
[0030] and Indicates the two endpoints of the river segment. and Let p be the coordinates of the endpoint. and Let q be the coordinates of the endpoint, when the Euclidean distance is... When determining the endpoints and Belonging to the same cluster For each cluster n represents the number of endpoints within the cluster, j represents the endpoint index within the cluster, and the geometric center coordinates are calculated using the arithmetic mean method. :
[0031] ;
[0032] and Represents the coordinates of the j-th endpoint within the cluster, as a representative point. Replace the original coordinates of all endpoints in the cluster to obtain the aggregated endpoint set.
[0033] Furthermore, a directed network graph is constructed based on the river's vector and elevation data, including:
[0034] Construct a set of network nodes for a directed network graph based on the aggregated set of endpoints;
[0035] Obtain the elevation values of the corresponding nodes at the starting and ending points of each river segment. If the absolute value of the difference between the elevation values of the starting point and the ending point is greater than the preset elevation difference threshold, the flow direction of the directed network graph is determined to be from the high point to the low point. Otherwise, the digitization acquisition order of the vector data is used as the flow direction of the directed network graph.
[0036] Construct directed edges based on the flow direction and the set of network nodes in the directed network graph;
[0037] The edge weights of directed edges are calculated based on the Euclidean distance between each network node.
[0038] Furthermore, the river segment closest to the pollution source input point is selected from the candidate river segment set. The river segment is then divided according to the projection position of the pollution source input point on the nearest river segment, generating new nodes and directed edges. The directed network graph is updated based on the new nodes and directed edges to obtain the coordinates of the proposed emergency control points. Similarly, the directed network graph is updated based on the coordinates of the emergency control points, including:
[0039] The polyline point sequence is decomposed into several line segments, and the relationship between each line segment and the pollution source input point is represented in vector form to obtain the line segment direction vector.
[0040] Calculate the projection parameters of the pollution source input point on each line segment based on the vector from the starting point of the broken line to the pollution source input point and the direction vector of the line segment, and determine the projection position of the pollution source input point on the line segment based on the projection parameters;
[0041] Calculate the Euclidean distance between the pollution source input point and the projection point. Traverse all segments in the polyline and take the projection point with the smallest distance as the nearest point of the river segment. Then compare all river segments, select the globally closest river segment, and take its corresponding projection point with the smallest distance as the insertion node.
[0042] Using the insertion node as the dividing point, the globally nearest river segment is divided into two parts:
[0043] Define the projection point with the smallest distance corresponding to the globally nearest river segment as the new network node, delete the directed edge corresponding to the original river segment, add two new edges, and calculate the weights of the two new edges based on the lengths of the two parts after the river segment is divided.
[0044] Update the directed network graph based on the new nodes and directed edges;
[0045] Obtain the coordinates of the proposed emergency control point. Similarly, based on the coordinates of the emergency control point, project it onto the nearest river segment to obtain the insertion node corresponding to the emergency control point. Then, perform segmentation and update the directed network graph.
[0046] Furthermore, based on the weighted shortest path algorithm, the shortest pollutant diffusion path from the pollution source input point to the proposed emergency control point is calculated in the updated directed network graph, including:
[0047] Let the insertion node of the pollution source input point in the directed network graph be... The insertion node of any emergency control point in the directed network graph is: ;
[0048] Let from arrive The set of all simple paths is For any path :
[0049] ;
[0050] in, Indicates pollution source nodes , Indicates emergency control point The middle one This refers to the nodes that must be traversed between the pollution source and the emergency control point; Represents a node and The constructed edges, Represents a set of directed edges;
[0051] The cost is:
[0052]
[0053] in For the edge The edge weights are given by K, where K is the number of directed edges from the pollution source input point to the proposed emergency control point, and K is the total number of edges. The 'k' inside refers to the... It requires passing through k edges.
[0054] In the set The above solution uses a weighted shortest path algorithm to find the shortest pollutant diffusion path. :
[0055] .
[0056] Furthermore, the weighted shortest path algorithm is Dijkstra's algorithm.
[0057] Furthermore, it also includes calculating the cumulative distance of the shortest pollutant diffusion path.
[0058] Furthermore, it also includes outputting the geometry and cumulative distance of the diffusion path as GIS elements for visualization and emergency response.
[0059] The present invention also provides a system for the aforementioned automatic extraction method of river pollution diffusion paths, comprising:
[0060] The acquisition module is used to acquire vector data and elevation data of the river, which includes several river sections;
[0061] The construction module is used to construct a directed network graph based on the vector data and elevation data of the river. The nodes of the directed network graph are the endpoints of the river segments, the directed edges are the river segments, and the edge weights are the lengths through which the river segments flow.
[0062] The update module is used to obtain the coordinates of the pollution source input point, construct a buffer based on a preset radius with the coordinates of the pollution source input point as the center, filter out the river segments that intersect with the buffer in the directed network graph to obtain a river segment candidate set, and filter out the river segment closest to the pollution source input point in the river segment candidate set, and divide the river segment according to the projection position of the pollution source input point on the nearest river segment to generate new nodes and directed edges, update the directed network graph according to the new nodes and directed edges, obtain the coordinates of the proposed emergency control point, and similarly update the directed network graph according to the coordinates of the emergency control point.
[0063] The calculation module is used to calculate the shortest pollutant diffusion path from the pollution source input point to the emergency control point in the updated directed network graph based on the weighted shortest path algorithm.
[0064] The beneficial effects of this invention are as follows:
[0065] This invention proposes an automatic method and system for extracting river pollution diffusion paths. Based on river vector data, it constructs a topological network that considers flow direction constraints, and combines an optimized point matching algorithm with a shortest path search strategy to automatically extract the diffusion paths from the pollution source input point to downstream control sections, and quickly calculates the cumulative distance. The river pollution diffusion paths obtained by this invention can be combined with hydrological flow velocity to estimate the time it takes for pollutants to reach control sections, providing a scientific basis for the formulation of emergency plans and the deployment of rescue measures, ensuring the targetedness and effectiveness of interception and control. This invention can achieve rapid and automatic extraction of pollutant diffusion paths under complex river network conditions, avoiding reliance on manual drawing and distance measurement, and significantly improving efficiency and consistency of results.
[0066] This invention is mainly applicable to environmental risk assessment of cross-river engineering facilities and riverside industrial parks, digital compilation of emergency plans for sudden pollution incidents in river basins, and emergency command and auxiliary decision-making at the scene of sudden water environment accidents. Attached Figure Description
[0067] Figure 1 This is a flowchart of an automatic extraction method for river pollution diffusion paths according to this application;
[0068] Figure 2 This is a diagram illustrating the automatic extraction of pollutant diffusion paths in the river network in this embodiment of the application. Detailed Implementation
[0069] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0070] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0071] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0072] like Figure 1 As shown, an automatic method for extracting river pollution diffusion paths includes:
[0073] S1: Obtain vector and elevation data of the river, which includes several river sections;
[0074] S2: Construct a directed network graph based on the vector and elevation data of the river. The nodes of the directed network graph are the endpoints of the river segments, the directed edges are the river segments, and the edge weights are the lengths through which the river segments flow.
[0075] S3: Obtain the coordinates of the pollution source input point. Construct a buffer zone with the pollution source input point as the center and a preset radius. Select river segments that intersect with the buffer zone in the directed network graph to obtain a candidate set of river segments. Select the river segment closest to the pollution source input point from the candidate set of river segments. Divide the river segment according to the projection position of the pollution source input point on the nearest river segment to generate new nodes and directed edges. Update the directed network graph according to the new nodes and directed edges. Obtain the coordinates of the proposed emergency control point. Similarly, update the directed network graph according to the coordinates of the emergency control point.
[0076] S4: Based on the weighted shortest path algorithm, calculate the shortest pollutant diffusion path from the pollution source input point to the emergency control point in the updated directed network graph.
[0077] In one embodiment, step S1 is specifically implemented by:
[0078] Coordinate system check and transformation: The input river vector data is checked for coordinate system identification. If it is a geographic coordinate system (latitude and longitude), the projection transformation function Π is used to transform the geographic coordinates. Transform to planar projected coordinates ,Right now:
[0079]
[0080] in Latitude and longitude coordinates These are the projected coordinates. This step ensures that subsequent distance calculations are all in meters, meeting accuracy and comparability requirements.
[0081] Endpoint Extraction and Aggregation: To eliminate minor edge-connection errors generated during data acquisition, adjacent endpoints need to be aggregated. First, the features of each river segment are... Represented as a broken line point sequence:
[0082]
[0083] Then its starting point and ending point are respectively:
[0084] ;
[0085] The set of all endpoints is represented as:
[0086] ;
[0087] Set endpoint aggregation tolerance (e.g., 20 meters), Euclidean distance is used as the criterion:
[0088] ;
[0089] when When determining the endpoints and Belonging to the same cluster For each cluster The coordinates of its geometric center (representative point) are calculated using the arithmetic mean method. :
[0090] ;
[0091] Finally, using representative points Replace the original coordinates of all endpoints in the cluster to achieve physical node snapping and alignment.
[0092] Topology repair: After completing endpoint aggregation, further topology cleaning is performed, including:
[0093] Suspended point handling: Detects suspended nodes with a degree of 1 in the network. If the distance of the suspended node to the nearest disconnected river segment is less than a preset threshold, the river segment is automatically extended to the intersection point to repair the "dead ends" caused by digitization.
[0094] Isolated subnet removal: Identify and remove tiny isolated lines (fragments) that cannot be merged into the main flow, reducing computational noise.
[0095] By following the steps above, the maximum displacement of the endpoints is guaranteed to not exceed... Under the premise of this, endpoint alignment and topology enhancement of river vector data were effectively achieved, providing a coherent and consistent spatial foundation for subsequent river network construction.
[0096] In one embodiment, step S2 specifically includes:
[0097] Node generation: The set of endpoints aggregated in step S1 As a set of network nodes ,Right now:
[0098] ;
[0099] Directed edge generation and flow direction determination: For each river segment element Its starting point and ending point, after endpoint aggregation, correspond to nodes respectively. and Introduce flow direction determination rules:
[0100] Obtain the elevation values at the start and end points. (Can be extracted from DEM). If , If the elevation difference threshold is used, the flow direction is defined as from a high elevation point to a low elevation point. If the elevation difference is not significant, the flow direction is assumed to be the order in which the vector data was digitized. Based on the determined flow direction, directed edges are generated:
[0101] ;
[0102] in, Indicates the starting point of the river. It indicates the end of a river, or the beginning of a line.
[0103] And form an edge set from all edges. .
[0104] Edge weight calculation: The length of the river segment is calculated using Euclidean distance, and the edge weight is defined as follows:
[0105] ;
[0106] in, For river section The coordinates of the broken line points, e represents the river segment. In addition to a starting point and an ending point, there are many nodes in the middle of the river segment. m refers to the total number of nodes in this river segment. This formula means that the distance between two adjacent nodes is calculated and then summed up to get the length of the river segment.
[0107] Network structure definition: consisting of the above set of nodes Set of directed edges and corresponding weights Constructing a directed river network graph .
[0108] In one embodiment, steps S3 and S4 specifically include:
[0109] Recent river section search: Let the input point (pollution source input point or emergency control point) be... Firstly, with Construct a center with a radius of The buffer is used to filter the set of intersecting candidate river segments. For each river segment in the candidate river segment set... Its geometric form is represented as a broken line function:
[0110] ;
[0111] Projection calculation: [This refers to the calculation of the polyline.] Decompose into several line segments For each line segment, to facilitate calculation, the relationship between it and the input point is represented as a vector, and the line segment direction vector is:
[0112] ;
[0113] From start point to input point The vector is:
[0114] ;
[0115] Therefore, the projection parameters of the input point on the line segment can be calculated:
[0116] ;
[0117] According to parameters The value of is used to determine the projection point. The position, when At that time, the projection point is located inside the line segment;
[0118] ;
[0119] when When the projection point is taken as the starting point of the line segment. ;
[0120] when When the projection point is taken as the endpoint of the line segment. ;
[0121] Global optimal matching: Calculate the input point With projection point Euclidean distance:
[0122] ;
[0123] Traverse all segments of the polyline and select the projection point with the smallest distance as the nearest point for that river segment. Then compare all river segments and select the globally closest one. and its projection point As the insertion point.
[0124] Topology Reconstruction and Weight Update: Let the river segment be... The original length is , with projection point Using this as the dividing point, the original river section is divided into two parts:
[0125] Sub-segment 1: A broken line from the original starting point to the projection point, with a length denoted as . ;
[0126] Sub-segment 2: A broken line from the projection point to the original endpoint, with a length denoted as . .
[0127] ;
[0128] Projection point Define as a new network node Delete the original directed edges , i represents the i-th edge, Representing the original starting point and the original ending point respectively, two new directed edges are added:
[0129] ;
[0130] The corresponding edge weights are defined as follows:
[0131] ;
[0132] in The original edge weight (river segment length).
[0133] In this step, an updated directed network diagram was obtained using the coordinates of the pollution source input point and the emergency control point.
[0134] Through the above steps, it is ensured that the pollution source input point and emergency control point can be accurately mapped onto the river network and transformed into formal network nodes, thus participating in the calculation as legitimate start and end points in the subsequent path calculation, ensuring the accuracy and operability of the pollutant diffusion path extraction.
[0135] like Figure 2 As shown, in one embodiment, step S4 specifically includes:
[0136] Start and end node determination: Let the newly inserted node of the pollution source input point in the network be... The newly inserted node at any emergency control point is The endpoint of a river is the endpoint of a river segment.
[0137] Feasible path set and objective function: Defined from arrive The set of all simple paths is For any path:
[0138] in, Indicates pollution source nodes , The corresponding emergency control point The middle one This refers to the nodes that must be traversed between the pollution source and the emergency control point; Represents a node and The constructed edges, Represents a set of directed edges;
[0139] The cost is:
[0140] ;
[0141] in For the edge The edge weights are given by K, where K is the number of directed edges from the pollution source input point to the proposed emergency control point, and K is the total number of edges. The 'k' inside refers to the... It requires traversing k edges. (Defined by step S2 as the length of the corresponding river segment).
[0142] Shortest path solution: in the set Solving the objective
[0143] ;
[0144] A weighted shortest path algorithm based on a non-negative weighted graph, such as Dijkstra's algorithm, can be used to obtain the optimal path and its cumulative distance. Dijkstra's algorithm is an existing algorithm and will not be elaborated on here.
[0145] The present invention also provides a system for an automatic extraction method of river pollution diffusion paths, comprising:
[0146] The acquisition module is used to acquire vector data and elevation data of the river, which includes several river sections;
[0147] The construction module is used to construct a directed network graph based on the vector data and elevation data of the river. The nodes of the directed network graph are the endpoints of the river segments, the directed edges are the river segments, and the edge weights are the lengths through which the river segments flow.
[0148] The update module is used to obtain the coordinates of the pollution source input point, construct a buffer based on a preset radius with the coordinates of the pollution source input point as the center, filter out the river segments that intersect with the buffer in the directed network graph to obtain a river segment candidate set, and filter out the river segment closest to the pollution source input point in the river segment candidate set, and divide the river segment according to the projection position of the pollution source input point on the nearest river segment to generate new nodes and directed edges, update the directed network graph according to the new nodes and directed edges, obtain the coordinates of the proposed emergency control point, and similarly update the directed network graph according to the coordinates of the emergency control point.
[0149] The calculation module is used to calculate the shortest pollutant diffusion path from the pollution source input point to the emergency control point in the updated directed network graph based on the weighted shortest path algorithm.
[0150] The present invention has at least the following technical effects:
[0151] Preventing backflow: By constructing a directed graph model, strictly following the physical law of "water flowing downhill", the "backflow diffusion" error result that may be produced by traditional undirected graph algorithms is completely eliminated.
[0152] Automation and efficiency: It can automatically extract the diffusion path and calculate the distance from the pollution source input point to the emergency control point based on river vector data, avoiding manual drawing and distance measurement, and significantly improving processing efficiency.
[0153] High accuracy: Through the "projection-segmentation" point insertion mechanism, the pollution source input point and emergency control point can be automatically connected to the river network, eliminating the calculation error caused by the point not being on the line in the traditional method, and ensuring the accuracy of distance calculation.
[0154] Adaptable to complex scenarios: It can accurately extract diffusion paths even under complex river network conditions and supports batch calculation of multiple emergency control points, meeting the needs for rapid analysis of multiple targets in emergency response.
[0155] The results are highly applicable: the output diffusion path and cumulative distance can be directly used as GIS elements for visualization and emergency dispatch, providing technical support for emergency plan formulation and on-site rescue deployment.
[0156] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for automatically extracting river pollution diffusion paths, characterized in that, include: Obtain vector and elevation data of the river, which includes several river sections; A directed network graph is constructed based on the vector and elevation data of the river. The nodes of the directed network graph are the endpoints of the river segments, the directed edges are the river segments, and the edge weights are the lengths through which the river segments flow. Obtain the coordinates of the pollution source input point. Construct a buffer zone with the pollution source input point as the center and a preset radius. Select river segments that intersect with the buffer zone in the directed network graph to obtain a candidate set of river segments. Select the river segment closest to the pollution source input point from the candidate set. Divide the river segment according to the projection position of the pollution source input point on the nearest river segment to generate new nodes and directed edges. Update the directed network graph according to the new nodes and directed edges. Obtain the coordinates of the proposed emergency control point. Similarly, update the directed network graph according to the coordinates of the emergency control point. Based on the weighted shortest path algorithm, the shortest pollutant diffusion path from the pollution source input point to the emergency control point is calculated in the updated directed network graph.
2. The method for automatically extracting river pollution diffusion paths according to claim 1, characterized in that, Obtain vector data of the river, including: Obtain the raw vector data of the river; The original vector data is subjected to coordinate system identification. If it is a geographic coordinate system, the geographic coordinates are transformed to planar projected coordinates using a projection transformation function. Each river segment in the original vector data after coordinate transformation is represented as a polyline point sequence; Obtain the endpoints in the sequence of all polyline points to get the endpoint set. The endpoints include the start and end points of each river. Aggregate the neighboring endpoints in the endpoint set based on Euclidean distance and preset endpoint aggregation tolerance to get the aggregated endpoint set. The vector data of the river is obtained by processing dangling points and removing isolated subnets after the vector data of the adjacent endpoints are aggregated.
3. The method for automatically extracting river pollution diffusion paths according to claim 2, characterized in that, Aggregating neighboring endpoints in the endpoint set specifically includes: Elements of each river segment Represented as a broken line point sequence: ; in represents the coordinates of the points on the polyline, where i represents the river segment number and m represents the total number of nodes in the river segment; Then its starting point and the end point The coordinates are as follows: ; The set of all endpoints is represented as : ; Where M represents the total number of river segments; Set endpoint aggregation tolerance Euclidean distance is used as the discrimination criterion: ; and Indicates the two endpoints of the river segment. and Let p be the coordinates of the endpoint. and Let q be the coordinates of the endpoint, when the Euclidean distance is... When determining the endpoints and Belonging to the same cluster For each cluster n represents the number of endpoints within the cluster, j represents the endpoint index within the cluster, and the geometric center coordinates are calculated using the arithmetic mean method. : ; and Represents the coordinates of the j-th endpoint within the cluster, as a representative point. Replace the original coordinates of all endpoints in the cluster to obtain the aggregated endpoint set.
4. The method for automatically extracting river pollution diffusion paths according to claim 2, characterized in that, A directed network graph is constructed based on river vector and elevation data, including: Construct a set of network nodes for a directed network graph based on the aggregated set of endpoints; Obtain the elevation values of the corresponding nodes at the starting and ending points of each river segment. If the absolute value of the difference between the elevation values of the starting point and the ending point is greater than the preset elevation difference threshold, the flow direction of the directed network graph is determined to be from the high point to the low point. Otherwise, the digitization acquisition order of the vector data is used as the flow direction of the directed network graph. Construct directed edges based on the flow direction and the set of network nodes in the directed network graph; The edge weights of directed edges are calculated based on the Euclidean distance between each network node.
5. The method for automatically extracting river pollution diffusion paths according to claim 2, characterized in that, The river segment closest to the pollution source input point is selected from the candidate river segment set. The river segment is then divided according to the projection position of the pollution source input point on the nearest river segment, generating new nodes and directed edges. The directed network graph is updated based on the new nodes and directed edges. The coordinates of the proposed emergency control points are obtained. Similarly, the directed network graph is updated based on the coordinates of the emergency control points, including: The polyline point sequence is decomposed into several line segments, and the relationship between each line segment and the pollution source input point is represented in vector form to obtain the line segment direction vector. Calculate the projection parameters of the pollution source input point on each line segment based on the vector from the starting point of the broken line to the pollution source input point and the direction vector of the line segment, and determine the projection position of the pollution source input point on the line segment based on the projection parameters; Calculate the Euclidean distance between the pollution source input point and the projection point. Traverse all segments in the polyline and take the projection point with the smallest distance as the nearest point of the river segment. Then compare all river segments, select the globally closest river segment, and take its corresponding projection point with the smallest distance as the insertion node. Using the insertion node as the dividing point, the globally nearest river segment is divided into two parts: Define the projection point with the smallest distance corresponding to the globally nearest river segment as the new network node, delete the directed edge corresponding to the original river segment, add two new edges, and calculate the weights of the two new edges based on the lengths of the two parts after the river segment is divided. Update the directed network graph based on the new nodes and directed edges; Obtain the coordinates of the proposed emergency control point. Similarly, based on the coordinates of the emergency control point, project it onto the nearest river segment to obtain the insertion node corresponding to the emergency control point. Then, perform segmentation and update the directed network graph.
6. The method for automatically extracting river pollution diffusion paths according to claim 5, characterized in that, Based on the weighted shortest path algorithm, the shortest pollutant diffusion path from the pollution source input point to the proposed emergency control point is calculated in the updated directed network graph, including: Let the insertion node of the pollution source input point in the directed network graph be... The insertion node of any emergency control point in the directed network graph is: ; Let from arrive The set of all simple paths is For any path : ; in, Indicates the pollution source node. Indicates the emergency control point, in the middle. This refers to the nodes that must be traversed between the pollution source and the emergency control point; Represents a node and The constructed edges, Represents a set of directed edges; The cost is: in For the edge The edge weights, where K is the number of directed edges from the pollution source input point to the proposed emergency control point; In the set The above solution uses a weighted shortest path algorithm to find the shortest pollutant diffusion path. : 。 7. The method for automatically extracting river pollution diffusion paths according to claim 1, characterized in that, The weighted shortest path algorithm is Dijkstra's algorithm.
8. The method for automatically extracting river pollution diffusion paths according to claim 1, characterized in that, It also includes calculating the cumulative distance of the shortest pollutant diffusion path.
9. The method for automatically extracting river pollution diffusion paths according to claim 8, characterized in that, It also includes outputting the geometry and cumulative distance of the diffusion path as GIS elements for visualization and emergency response.
10. A system for an automatic extraction method of river pollution diffusion paths as described in any one of claims 1-9, characterized in that, include: The acquisition module is used to acquire vector data and elevation data of the river, which includes several river sections; The construction module is used to construct a directed network graph based on the vector data and elevation data of the river. The nodes of the directed network graph are the endpoints of the river segments, the directed edges are the river segments, and the edge weights are the lengths through which the river segments flow. The update module is used to obtain the coordinates of the pollution source input point, construct a buffer based on a preset radius with the coordinates of the pollution source input point as the center, filter out the river segments that intersect with the buffer in the directed network graph to obtain a river segment candidate set, and filter out the river segment closest to the pollution source input point in the river segment candidate set, and divide the river segment according to the projection position of the pollution source input point on the nearest river segment to generate new nodes and directed edges, update the directed network graph according to the new nodes and directed edges, obtain the coordinates of the proposed emergency control point, and similarly update the directed network graph according to the coordinates of the emergency control point. The calculation module is used to calculate the shortest pollutant diffusion path from the pollution source input point to the emergency control point in the updated directed network graph based on the weighted shortest path algorithm.