River cross section data processing method and device, electronic equipment and storage medium

By summarizing and generating accurate cross-sectional lines and points on those lines, the problems of data deviation and dispersion in river channel modeling were solved, achieving efficient multi-source data processing and improved modeling accuracy.

CN121935221APending Publication Date: 2026-04-28POWERCHINA HUADONG ENG CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
POWERCHINA HUADONG ENG CORP LTD
Filing Date
2026-01-15
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

In existing technologies, the cross-sectional lines drawn manually for river modeling are prone to errors, leading to errors in the modeling software or model distortion. In addition, the data is scattered across multiple worksheets, making the preprocessing work repetitive, tedious, and inefficient.

Method used

By acquiring cross-section point data and river centerline data, the cross-section point data from multiple worksheets are summarized into a single summary worksheet. Cross-section lines are generated based on the river centerline data, and cross-section points are generated on the cross-section lines. Vector operations and GIS tools are used to ensure the geometric consistency of the data.

Benefits of technology

It has achieved significant improvements in the accuracy and efficiency of river channel modeling, and ensured data geometric consistency and efficient data integration through automated processing of multi-source data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121935221A_ABST
    Figure CN121935221A_ABST
Patent Text Reader

Abstract

The invention provides a river channel cross section data processing method and device, electronic equipment and a storage medium, and relates to the technical field of data processing, and the method comprises the steps: obtaining cross section point data and river channel center line data; wherein the cross section point data is stored in a plurality of worksheets, each worksheet corresponds to a cross section, and the cross section point data comprises a river mileage, an offset distance, an x coordinate, a coordinate and an elevation; summarizing the cross section point data of the plurality of worksheets into a summarized worksheet; generating a cross section line based on the river channel center line data and the river channel mileage in the summary worksheet; section points are generated on the cross section lines based on the offset distances in the summary worksheet. In the mode, the cross section lines and the points on the lines with accurate positions are automatically regenerated, so that the geometric consistency of the data is ensured, batch processing of the multi-source data is realized, and the modeling precision and efficiency are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a method, apparatus, electronic device, and storage medium for processing cross-sectional data of a river channel. Background Technology

[0002] River channel modeling relies on accurate cross-sectional data, but the raw data obtained from surveys often has serious defects: manually drawn cross-sectional lines are often misaligned, and the coordinates of many cross-section points do not strictly fall on the lines, causing errors in modeling software or model distortion. Furthermore, the data is scattered across multiple worksheets by cross-section, making preprocessing repetitive, tedious, and inefficient. Current methods relying on manual correction are time-consuming, labor-intensive, and difficult to guarantee accuracy. Summary of the Invention

[0003] In view of this, the purpose of the present invention is to provide a method, apparatus, electronic device and storage medium for processing river cross-section data, which ensures data geometric consistency by automatically regenerating cross-section lines and points on the lines with accurate positions, and realizes batch processing of multi-source data, significantly improving modeling accuracy and efficiency.

[0004] In a first aspect, embodiments of the present invention provide a method for processing river cross-section data, the method comprising: acquiring cross-section point data and river centerline data; wherein, the cross-section point data is stored in multiple worksheets, each worksheet corresponding to one cross-section, and the cross-section point data includes: river mileage, offset distance, x-coordinate, ... Coordinates and elevations; summarize cross-section point data from multiple worksheets into a summary worksheet; generate cross-section lines based on river centerline data and river mileage in the summary worksheet; generate cross-section points on the cross-section lines based on offset distances in the summary worksheet.

[0005] In a preferred embodiment of the present invention, the above-described method of summarizing cross-sectional point data from multiple worksheets into a summary worksheet includes: importing cross-sectional point data from multiple worksheets into a pandas library; reading an Excel file containing multiple worksheets; initializing an empty DataFrame; and summarizing and standardizing each worksheet in each Excel file based on the empty DataFrame to generate a summary worksheet.

[0006] In a preferred embodiment of the present invention, the above-mentioned empty DataFrame-based method summarizes and standardizes each worksheet in each Excel file to generate a summary worksheet, including: traversing each worksheet in each Excel file; reading the cross-section point data from the worksheet into a temporary DataFrame; creating a "Cross-section Name" column in the temporary DataFrame, where the cross-section name corresponds to the name of the worksheet; appending the temporary DataFrame to an empty DataFrame to obtain the target DataFrame; and adjusting the column order of the target DataFrame according to a pre-set order, including: cross-section name, river mileage, offset distance, x-coordinate, ... Coordinates and elevation; write the adjusted column order DataFrame to the output file to generate a summary worksheet.

[0007] In a preferred embodiment of the present invention, the above-mentioned generation of cross-section lines based on river centerline data and river mileage in the summary worksheet includes: determining the river mileage corresponding to each cross-section name and the cross-section width range based on the cross-section name and offset distance in the summary worksheet; obtaining the river mileage corresponding to each cross-section name from the summary worksheet; locating the center point of each cross-section on the river centerline based on the river mileage; and generating a cross-section line perpendicular to the river centerline through each center point based on the cross-section width range.

[0008] In a preferred embodiment of the present invention, the above-mentioned generation of a cross-sectional line perpendicular to the river centerline through each center point based on the cross-sectional width range includes: determining the tangent direction angle of the river centerline at each center point; rotating the tangent direction angle by 90 degrees to obtain the vertical direction angle of the cross-sectional line; calculating the starting point coordinates and ending point coordinates of the cross-sectional line respectively through vector operations based on the center point coordinates, the vertical direction angle, the minimum offset distance and the maximum offset distance corresponding to the cross-sectional width range; and connecting the starting point and the ending point to create line elements.

[0009] In a preferred embodiment of the present invention, the above-mentioned calculation of the starting point coordinates and the ending point coordinates by vector operation includes: obtaining the starting point coordinates and the ending point coordinates by performing vector operation using the following formula: the X coordinate of the starting point = the X coordinate of the center point + the minimum offset distance × cos(vertical direction angle); the starting point's X coordinates = the X coordinate of the center point + the minimum offset distance × cos(vertical direction angle); Coordinates = Center Point The X-coordinate of the endpoint = the X-coordinate of the center point + the maximum offset distance × cos(vertical angle); Coordinates = Center Point Coordinates + maximum offset distance × sin (vertical direction angle).

[0010] In a preferred embodiment of the present invention, generating cross-sectional points on a cross-section line based on the offset distance in a summary worksheet includes: importing the summary worksheet into a geographic database; creating a point feature class to store the generated cross-sectional points; adding fields to the point feature class; the fields include the cross-section line, offset distance, and elevation; for each cross-section line, locating the point position on the cross-section line according to the offset distance; generating point features based on the point position and setting corresponding attributes; and writing the point features into the point feature class.

[0011] Secondly, embodiments of the present invention also provide a river cross-section data processing device, comprising: a data acquisition module for acquiring cross-section point data and river centerline data; wherein, the cross-section point data is stored in multiple worksheets, each worksheet corresponding to one cross-section, and the cross-section point data includes: river mileage, offset distance, x-coordinate, ... The module includes: coordinates and elevation; a summary worksheet generation module, used to summarize cross-section point data from multiple worksheets into a single summary worksheet; a cross-section line generation module, used to generate cross-section lines based on river centerline data and river mileage data in the summary worksheet; and a cross-section point generation module, used to generate cross-section points on the cross-section lines based on the offset distance in the summary worksheet.

[0012] Thirdly, embodiments of the present invention also provide an electronic device, including a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the river cross-section data processing method of the first aspect described above.

[0013] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are invoked and executed by a processor, the computer-executable instructions cause the processor to implement the river cross-section data processing method of the first aspect described above.

[0014] The embodiments of the present invention bring the following beneficial effects: This invention provides a method, apparatus, electronic device, and storage medium for processing river cross-section data. It can acquire cross-section point data and river centerline data. The cross-section point data is stored in multiple worksheets, each worksheet corresponding to one cross-section. The cross-section point data includes: river mileage, offset distance, x-coordinate, etc. The coordinates and elevations are used to summarize the cross-sectional point data from multiple worksheets into a single summary worksheet. Cross-sectional lines are generated based on the river centerline data and the river mileage in the summary worksheet. Cross-sectional points are then generated on these lines based on the offset distances specified in the summary worksheet. This method ensures data geometric consistency by automatically regenerating precisely positioned cross-sectional lines and points, and enables batch processing of multi-source data, significantly improving modeling accuracy and efficiency.

[0015] Other features and advantages of this disclosure will be set forth in the following description, or some features and advantages may be inferred from the description or determined without doubt, or may be learned by practicing the techniques described above.

[0016] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0017] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0018] Figure 1 A flowchart of a method for processing river cross-section data provided in an embodiment of the present invention; Figure 2 A flowchart of another method for processing river cross-section data provided in an embodiment of the present invention; Figure 3 A flowchart of another method for processing river cross-section data provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of a river cross-section data processing device provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] River channel modeling relies on accurate cross-sectional data, but the raw data obtained from surveys often has serious defects: manually drawn cross-sectional lines are often misaligned, and the coordinates of many cross-section points do not strictly fall on the lines, causing errors in modeling software or model distortion. Furthermore, the data is scattered across multiple worksheets by cross-section, making preprocessing repetitive, tedious, and inefficient. Current methods relying on manual correction are time-consuming, labor-intensive, and difficult to guarantee accuracy.

[0021] Based on this, the present invention provides a method, apparatus, electronic device, and storage medium for processing river cross-section data. This method can acquire cross-section point data and river centerline data. The cross-section point data is stored in multiple worksheets, each worksheet corresponding to a cross-section. The cross-section point data includes: river mileage, offset distance, x-coordinate, etc. The coordinates and elevations are used to summarize the cross-sectional point data from multiple worksheets into a single summary worksheet. Cross-sectional lines are generated based on the river centerline data and the river mileage in the summary worksheet. Cross-sectional points are then generated on these lines based on the offset distances specified in the summary worksheet. This method ensures data geometric consistency by automatically regenerating precisely positioned cross-sectional lines and points, and enables batch processing of multi-source data, significantly improving modeling accuracy and efficiency.

[0022] To facilitate understanding of this embodiment, a method for processing river cross-section data disclosed in this embodiment of the invention will first be described in detail.

[0023] Example 1 This invention provides a method for processing river cross-section data. Figure 1 This is a flowchart illustrating a method for processing river cross-section data, provided as an embodiment of the present invention. Figure 1 As shown, the method for processing river cross-section data may include the following steps: Step S101: Obtain cross-sectional point data and river centerline data.

[0024] The cross-section point data is stored in multiple worksheets, with each worksheet corresponding to one cross-section. The cross-section point data includes: river channel mileage, offset distance, x-coordinate, etc. Coordinates and elevation.

[0025] The cross-sectional point data is a set of discrete points obtained through field exploration (such as GPS-RTK measurement, cross-sectional mapping, laser scanning, etc.) and used to describe the cross-sectional morphology of the river channel.

[0026] Among them, the river centerline data is usually a vector line (such as LineString in Shapefile or GeoJSON), representing the main line or center trajectory of the river.

[0027] In this context, a worksheet refers to a single sheet page in an Excel file, and each sheet stores all the measurement point data for a specific cross-section.

[0028] For example, suppose a river has 3 cross sections (S1, S2, S3), then the original data might be an Excel file named "RiverData.xlsx" containing 3 worksheets named "S1", "S2", and "S3" respectively.

[0029] Each worksheet contains the following data columns: River mileage: such as 0+100, 0+200, 0+300 (representing 100 meters, 200 meters, and 300 meters from the starting point of the river).

[0030] Offset distance: e.g., -20, -10, 0, 10, 20 (negative values ​​represent the left side of the center line, and positive values ​​represent the right side).

[0031] x-coordinate, Coordinates: The coordinates of the measuring point in a geodetic coordinate system (such as CGCS2000).

[0032] Elevation: The elevation value (e.g., altitude) of the measuring point.

[0033] Step S102: Summarize the cross-sectional point data from multiple worksheets into a summary worksheet.

[0034] In order to centralize the management of scattered data and facilitate subsequent automated processing, data can be summarized to obtain a summary data table.

[0035] One approach is to write a script (such as Python pandas) to automatically traverse all worksheets, read the data, add an identifier column (section name) to distinguish the data source, and finally merge them into a large table.

[0036] Step S103: Generate cross-sectional lines based on the river centerline data and the river mileage in the summary worksheet.

[0037] This step utilizes accurate river centerline geometry and mileage to generate a theoretically perfectly vertical and correctly positioned cross-section line through spatial calculations, replacing the original hand-drawn cross-section line which may contain deviations.

[0038] For example, spatial operations can be performed using GIS libraries such as GeoPandas and ArcPy. A point is located on the centerline based on the mileage, then the perpendicular direction of that point is calculated, and line segments are generated based on the cross-sectional width range.

[0039] Step S104: Generate cross-section points on the cross-section line based on the offset distance in the summary worksheet.

[0040] Among them, the cross-section points can be accurately projected based on the original offset distance of each measuring point, so as to ensure that all cross-section points are strictly located on the newly generated cross-section line, thus solving the problem of "points not on the line" in the original data.

[0041] One method is to use spatial linear reference techniques to convert the offset distance into specific coordinates on the line segment. For example, by moving a given offset distance along the direction of the section line from the starting point, the position of a point can be determined.

[0042] Specifically, generating cross-section points on a cross-section line based on the offset distance in the summary worksheet can include: importing the summary worksheet into a geodatabase; creating a point feature class to store the generated cross-section points; adding fields to the point feature class; the fields include cross-section line, offset distance, and elevation; for each cross-section line, locating the point position on the cross-section line according to the offset distance; generating point features based on the point position and setting corresponding attributes; and writing the point features into the point feature class.

[0043] This involves converting a summary Excel table containing information on all cross-section points into a table format (such as a Geodatabase Table) that can be recognized and used in spatial processing by GIS software (such as ArcGIS).

[0044] Point feature classes are collection files in GIS used to store point-like geographic features, such as a Shapefile or Feature Class in a Geodatabase.

[0045] One can create a new, empty point layer in the GIS workspace to store the final, precisely located cross-sectional points.

[0046] Attribute fields can be created in the feature class of this point to store the original information (such as offset distance and elevation) and related information (such as the ID of the cross section line to which it belongs) of each point.

[0047] Specifically, for each record in the summary table, its corresponding cross-sectional line is located. Then, starting from the starting point of that line, the point is moved along the line by a given "offset distance" to calculate its absolute coordinates. For example, this can be achieved using ArcGIS's `arcpy.GeneratePointsAlongLines_management` tool or Shapely's `interpolate` method combined with coordinate transformation.

[0048] In this process, a point geometry object can be created based on the coordinates calculated in the previous step, and all the attributes of the point (such as elevation, offset distance, and the name of the section to which it belongs) can be assigned to this point feature.

[0049] This allows all generated point features to be written in batches to the final output point feature class file. This file can then be directly and error-free imported into modeling software such as Infoworks ICM to build high-precision river models.

[0050] The river cross-section data processing method provided in this embodiment of the invention can acquire cross-section point data and river centerline data. The cross-section point data is stored in multiple worksheets, each worksheet corresponding to one cross-section. The cross-section point data includes: river mileage, offset distance, x-coordinate, etc. The coordinates and elevations are used to summarize the cross-sectional point data from multiple worksheets into a single summary worksheet. Cross-sectional lines are generated based on the river centerline data and the river mileage in the summary worksheet. Cross-sectional points are then generated on these lines based on the offset distances specified in the summary worksheet. This method ensures data geometric consistency by automatically regenerating precisely positioned cross-sectional lines and points, and enables batch processing of multi-source data, significantly improving modeling accuracy and efficiency.

[0051] Example 2 This invention also provides another method for processing river cross-section data; this method is implemented based on the method in the above embodiments; the method focuses on describing the specific implementation of summarizing cross-section point data from multiple worksheets into a summary worksheet.

[0052] Figure 2 A flowchart of another method for processing river cross-section data provided in an embodiment of the present invention is shown below. Figure 2 As shown, summarizing cross-sectional point data from multiple worksheets into a single summary worksheet can include the following steps: Step S201: Import the cross-sectional point data from multiple worksheets into the pandas library.

[0053] Pandas is a core data processing library for Python, and its functions can be invoked by starting a Python environment.

[0054] For example, in code it is usually expressed as import pandas as pd.

[0055] Step S202: Read the Excel file containing multiple worksheets.

[0056] Pandas functions can be used to open and parse Excel files.

[0057] For example, xls=pd.ExcelFile('River Cross-section Data.xlsx').

[0058] Step S203: Initialize an empty DataFrame.

[0059] In Pandas, a DataFrame is a two-dimensional tabular data structure that can be understood as an Excel spreadsheet in memory. An empty table is created as a container to hold all the data later.

[0060] For example, combined_df = pd.DataFrame().

[0061] Step S204: Summarize and standardize each worksheet in each Excel file based on an empty DataFrame to generate a summary worksheet.

[0062] Specifically, based on an empty DataFrame, each worksheet in each Excel file is summarized and standardized to generate a summary worksheet. This may include: traversing each worksheet in each Excel file; reading the cross-section point data from the worksheet into a temporary DataFrame; creating a "Cross-section Name" column in the temporary DataFrame, where the cross-section name corresponds to the worksheet name; appending the temporary DataFrame to an empty DataFrame to obtain the target DataFrame; and adjusting the column order of the target DataFrame according to a pre-set order, including: cross-section name, river channel mileage, offset distance, x-coordinate, ... Coordinates and elevation; write the adjusted column order DataFrame to the output file to generate a summary worksheet.

[0063] The process involves reading data from the current worksheet (e.g., "S1") into a temporary variable `df_temp`. A new column is added to `df_temp`, and all columns are assigned the value "S1". This ensures that each point belongs to a specific section after merging. The contents of `df_temp` are then appended to the end of the summary table `combined_df`. To maintain data neatness and facilitate subsequent processing, the column order is standardized. Finally, the merged `combined_df` is saved as a new Excel file or worksheet, serving as a summary worksheet.

[0064] In this embodiment, a script (such as one based on Python pandas) can be written to automatically traverse and merge dozens or even hundreds of scattered worksheets, compressing the copy-paste work that originally required dozens of manual repetitions into an automated process that can be completed with a single click, thus improving efficiency. Furthermore, a unified "section name" identifier is automatically added to all data, and the data is arranged in a preset order (e.g., section name, mileage, offset distance, x, ...). The standardized arrangement of fields (e.g., elevation) eliminates omissions, labeling errors, or column order confusion that may result from manual operations. This provides a clean, consistent, and clearly sourced data source for all subsequent processing steps, reducing error rates and ensuring data consistency.

[0065] Example 3 This invention also provides another method for processing river cross-section data; this method is implemented based on the method in the above embodiments; this method focuses on describing the specific implementation of generating cross-section lines based on river centerline data and river mileage in the summary worksheet.

[0066] Figure 3 A flowchart of another method for processing river cross-section data provided in an embodiment of the present invention is shown below. Figure 3 As shown, generating cross-sectional lines based on river centerline data and river mileage data in the summary worksheet can include the following steps: Step S301: Based on the section name and offset distance in the summary worksheet, determine the river mileage and section width range corresponding to each section name.

[0067] Among them, the range of cross-sectional width is the range of distances from the leftmost measuring point to the rightmost measuring point on a cross-section, defined by the minimum offset distance and the maximum offset distance.

[0068] For example, you can group the summary worksheet by section name, and then find the minimum (e.g., -25) and maximum (e.g., 30) value in the offset distance column for each group (e.g., all points of section "S1"). The width range of this section S1 is -25 to 30.

[0069] Step S302: Obtain the river mileage corresponding to each cross-section name from the summary worksheet.

[0070] Specifically, the value of the river mileage segment can be read from any row of records under the cross-section group; or, the mean, mode, or first value of the field can be calculated as the representative value when grouping.

[0071] Step S303: Locate the center point of each section on the center line of the river based on the river mileage.

[0072] The river centerline can be viewed as a line segment with a start and an end, and the river mileage is the location on this line segment. Using GIS tools or geometric algorithms, the precise coordinates of the centerline corresponding to each mileage (e.g., 200 meters) can be found.

[0073] For example, use ArcGIS's arcpy.LocateFeaturesAlongRoutes_lr tool or the interpolate method of the Shapely library to determine the center point.

[0074] Step S304: Based on the cross-sectional width range, generate cross-sectional lines perpendicular to the river centerline through each center point.

[0075] Specifically, based on the cross-sectional width range, generating cross-sectional lines perpendicular to the river channel centerline through each center point can include: determining the tangent direction angle of the river channel centerline at each center point; rotating the tangent direction angle by 90 degrees to obtain the vertical direction angle of the cross-sectional line; calculating the starting and ending coordinates of the cross-sectional line through vector operations based on the center point coordinates, vertical direction angle, minimum offset distance, and maximum offset distance corresponding to the cross-sectional width range; and connecting the starting and ending points to create line elements.

[0076] The tangent direction angle is the angle between the tangent at the center point along the direction of travel of the center line and the due north direction (usually calculated clockwise, in degrees).

[0077] The tangent direction is estimated by calculating the direction of the line connecting the two adjacent vertices before and after the center point, or by using the differential geometry function of the GIS library.

[0078] To ensure that the generated cross-sectional line is perpendicular to the center line of the river channel, rotating it 90 degrees will give you the vertical direction.

[0079] The calculated start and end coordinates are constructed into a linear geometric object (LineString), and attributes are assigned to it (such as section name=S1, mileage=200), and then written into a new line feature class (Shapefile, etc.).

[0080] The starting and ending coordinates are obtained through vector operations using the following formula: Starting point X-coordinate = Center point X-coordinate + Minimum offset distance × cos(vertical angle); Coordinates = Center Point The X-coordinate of the endpoint = the X-coordinate of the center point + the maximum offset distance × cos(vertical angle); Coordinates = Center Point Coordinates + maximum offset distance × sin (vertical direction angle).

[0081] In this process, vector operations are used to convert the relative center point and offset distance into absolute geodetic coordinates.

[0082] In this embodiment of the application, through rigorous geometric calculations, cross-sectional lines and points on the lines with absolutely precise positions and strictly vertical shapes are regenerated, completely solving the geometric defects of "line position deviation" and "point-line separation" in the original data.

[0083] Example 4 Corresponding to the above method embodiments, this invention provides a river channel cross-section data processing device. Figure 4 This is a schematic diagram of the structure of a river cross-section data processing device provided in an embodiment of the present invention, as shown below. Figure 4 As shown, the river channel cross-section data processing device may include: Data acquisition module 401 is used to acquire cross-section point data and river centerline data. The cross-section point data is stored in multiple worksheets, each worksheet corresponding to one cross-section. The cross-section point data includes: river mileage, offset distance, x-coordinate, etc. Coordinates and elevation.

[0084] The summary worksheet generation module 402 is used to summarize cross-sectional point data from multiple worksheets into a single summary worksheet.

[0085] The cross-section line generation module 403 is used to generate cross-section lines based on the river centerline data and the river mileage in the summary worksheet.

[0086] The section point generation module 404 is used to generate section points on the cross section line based on the offset distance in the summary worksheet.

[0087] The river cross-section data processing device provided in this embodiment of the invention can acquire cross-section point data and river centerline data. The cross-section point data is stored in multiple worksheets, each worksheet corresponding to one cross-section. The cross-section point data includes: river mileage, offset distance, x-coordinate, etc. The coordinates and elevations are used to summarize the cross-sectional point data from multiple worksheets into a single summary worksheet. Cross-sectional lines are generated based on the river centerline data and the river mileage in the summary worksheet. Cross-sectional points are then generated on these lines based on the offset distances specified in the summary worksheet. This method ensures data geometric consistency by automatically regenerating precisely positioned cross-sectional lines and points, and enables batch processing of multi-source data, significantly improving modeling accuracy and efficiency.

[0088] In some embodiments, the summary worksheet generation module is further configured to import cross-sectional point data from multiple worksheets into the pandas library; read an Excel file containing multiple worksheets; initialize an empty DataFrame; and summarize and standardize each worksheet in each Excel file based on the empty DataFrame to generate a summary worksheet.

[0089] In some embodiments, the summary worksheet generation module is further configured to iterate through each worksheet in each Excel file: read the cross-section point data from the worksheet into a temporary DataFrame; create a "Cross-section Name" column in the temporary DataFrame, where the cross-section name corresponds to the name of the worksheet; append the temporary DataFrame to an empty DataFrame to obtain the target DataFrame; and adjust the column order of the target DataFrame according to a pre-set order, including: cross-section name, river channel mileage, offset distance, x-coordinate, ... Coordinates and elevation; write the adjusted column order DataFrame to the output file to generate a summary worksheet.

[0090] In some embodiments, the cross-section line generation module is further configured to determine the river mileage and cross-section width range corresponding to each cross-section name based on the cross-section name and offset distance in the summary worksheet; obtain the river mileage corresponding to each cross-section name from the summary worksheet; locate the center point of each cross-section on the river centerline based on the river mileage; and generate a cross-section line perpendicular to the river centerline through each center point based on the cross-section width range.

[0091] In some embodiments, the cross-section line generation module is further configured to determine the tangent direction angle of the river centerline at each center point; rotate the tangent direction angle by 90 degrees to obtain the vertical direction angle of the cross-section line; calculate the starting point coordinates and ending point coordinates of the cross-section line respectively through vector operations based on the center point coordinates, vertical direction angle, minimum offset distance and maximum offset distance corresponding to the cross-section width range; and connect the starting point and ending point to create line elements.

[0092] In some embodiments, the cross-section line generation module is further configured to obtain the starting point coordinates and the ending point coordinates through vector operations using the following formula: Starting point X-coordinate = Center point X-coordinate + Minimum offset distance × cos(vertical angle); Coordinates = Center Point The X-coordinate of the endpoint = the X-coordinate of the center point + the maximum offset distance × cos(vertical angle); Coordinates = Center Point Coordinates + maximum offset distance × sin (vertical direction angle).

[0093] In some embodiments, the cross-section point generation module is also used to import a summary worksheet into a geographic database; create a point feature class to store the generated cross-section points; add fields to the point feature class; the fields include cross-section line, offset distance, and elevation; for each cross-section line, locate the point position on the cross-section line according to the offset distance; generate point features based on the point position and set the corresponding attributes; and write the point features into the point feature class.

[0094] The device provided in this embodiment of the invention has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.

[0095] Example 5 This invention also provides an electronic device for running the above-described river cross-section data processing method; see also Figure 5 The diagram shows the structure of an electronic device, which includes a memory 500 and a processor 501. The memory 500 is used to store one or more computer instructions, which are executed by the processor 501 to implement the above-mentioned method for processing river cross-section data.

[0096] Furthermore, Figure 5 The electronic device shown also includes a bus 502 and a communication interface 503. The processor 501, the communication interface 503 and the memory 500 are connected via the bus 502.

[0097] The memory 500 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 503 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc. The bus 502 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0098] Processor 501 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 501 or by instructions in software form. Processor 501 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 500, and processor 501 reads information from memory 500 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.

[0099] This invention also provides a computer-readable storage medium storing computer-executable instructions. When these computer-executable instructions are called and executed by a processor, they cause the processor to implement the above-described method for processing river cross-section data. For specific implementation details, please refer to the method embodiments, which will not be repeated here.

[0100] The computer program product for processing river cross-section data provided in this embodiment of the invention includes a computer-readable storage medium storing non-volatile program code executable by a processor. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation details, please refer to the method embodiments, which will not be repeated here.

[0101] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0102] In the several embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0103] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0104] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0105] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0106] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for processing river cross-section data, characterized in that, The method includes: Obtain cross-section point data and river centerline data; wherein, the cross-section point data is stored in multiple worksheets, each worksheet corresponding to one cross-section, and the cross-section point data includes: river mileage, offset distance, x-coordinate, etc. Coordinates and elevation; The cross-sectional point data from multiple worksheets are summarized into a single summary worksheet. A cross-section line is generated based on the river centerline data and the river mileage in the summary worksheet. Cross-section points are generated on the cross-section line based on the offset distance in the summary worksheet.

2. The method according to claim 1, characterized in that, The step of summarizing the cross-sectional point data from multiple worksheets into a single summary worksheet includes: Import the cross-sectional point data from multiple worksheets into the pandas library; Read the Excel file containing multiple of the worksheets; Initialize an empty DataFrame; Based on the empty DataFrame, each worksheet in each of the Excel files is summarized and standardized to generate a summary worksheet.

3. The method according to claim 2, characterized in that, The process of summarizing and standardizing each worksheet in each Excel file based on the empty DataFrame to generate a summary worksheet includes: Iterate through each worksheet in each of the aforementioned Excel files: Read the cross-sectional point data from the worksheet into a temporary DataFrame; Create a "section name" column in the temporary DataFrame, where the section name corresponds to the name of the worksheet; The temporary DataFrame is appended to the empty DataFrame to obtain the target DataFrame; The column order of the target DataFrame is adjusted according to a pre-set order; the order includes: cross-section name, river mileage, offset distance, x-coordinate, Coordinates and elevation; Write the DataFrame with the column order adjusted to an output file to generate a summary worksheet.

4. The method according to claim 1, characterized in that, The process of generating cross-sectional lines based on the river centerline data and the river mileage in the summary worksheet includes: Based on the cross-section name and offset distance in the summary worksheet, determine the river mileage and cross-section width range corresponding to each cross-section name. Obtain the river mileage corresponding to each cross-section name from the summary worksheet; Based on the river mileage, locate the center point of each section on the center line of the river. Based on the stated cross-sectional width range, a cross-sectional line perpendicular to the river centerline is generated through each of the stated center points.

5. The method according to claim 4, characterized in that, The step of generating a cross-sectional line perpendicular to the river centerline through each of the aforementioned center points, based on the cross-sectional width range, includes: Determine the tangent direction angle of the river channel centerline at each center point; Rotate the tangent direction angle by 90 degrees to obtain the vertical direction angle of the cross section line; Based on the center point coordinates of the center point, the vertical direction angle, and the minimum and maximum offset distances corresponding to the cross-sectional width range, the starting and ending coordinates of the cross-sectional line are calculated respectively through vector operations. Connect the start and end points to create line elements.

6. The method according to claim 5, characterized in that, The calculation of the starting and ending coordinates through vector operations includes: The starting and ending coordinates are obtained by performing vector operations using the following formula: The X-coordinate of the starting point = the X-coordinate of the center point + the minimum offset distance × cos(vertical angle); Starting point Coordinates = Center Point Coordinates + minimum offset distance × sin (vertical direction angle); The X-coordinate of the endpoint = the X-coordinate of the center point + the maximum offset distance × cos(vertical angle); The end Coordinates = Center Point Coordinates + maximum offset distance × sin (vertical direction angle).

7. The method according to claim 1, characterized in that, The process of generating section points on the cross-section line based on the offset distance in the summary worksheet includes: Import the summary worksheet into the geographic database; Create a point feature class to store the generated cross-section points; Add fields to the point feature class; the fields include cross-section line, offset distance, and elevation. For each cross-section line, locate the position of the point on the cross-section line according to the offset distance; Generate point features based on point locations and set corresponding attributes; Write the point features into the point feature class.

8. A river channel cross-section data processing device, characterized in that, The device includes: The data acquisition module is used to acquire cross-section point data and river centerline data; wherein, the cross-section point data is stored in multiple worksheets, each worksheet corresponding to one cross-section, and the cross-section point data includes: river mileage, offset distance, x-coordinate, etc. Coordinates and elevation; The summary worksheet generation module is used to summarize the cross-sectional point data of multiple worksheets into a single summary worksheet. The cross-section line generation module is used to generate cross-section lines based on the river centerline data and the river mileage in the summary worksheet. The cross-section point generation module is used to generate cross-section points on the cross-section line based on the offset distance in the summary worksheet.

9. An electronic device, characterized in that, The method includes a processor and a memory, the memory storing computer-executable instructions that can be executed by the processor, the processor executing the computer-executable instructions to implement the river cross-section data processing method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the river cross-section data processing method according to any one of claims 1 to 7.