A multi-level gridding storage method for seafloor terrain data
Patent Information
- Application Number
- CN202610848119.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-12
- Publication Date
- 2026-09-11
AI Technical Summary
因此用户无法基于原始数据信息评估存储的网格化数据的数据质量状况,而导致数据的可靠度降低
本申请公开的一种面向海底地形数据的多级网格化存储方法,适用于不同空间分布特征的多来源海底地形数据,能够根据地形数据点的空间位置信息自动完成多级网格划分以及网格节点赋值,在提供结构化数据存储形式的同时,也能够充分存储原始数据的信息。基于该方法得到的以数据结构体、表或文本等形式存储的面向海底地形数据的多级网格化存储文件,能够在充分保留原始数据信息的条件下高效实现地形数据的网格化存储,满足数据空间分块、稀疏化处理以及网格化计算的需求,同时也能够根据结构体中的相关属性还原原始数据及评估网格化数据的数据质量。可适用于不同应用环境,无需专业软件即可读取和使用,方便于不同知识背景的用户进行海底地形数据的高效利用,具有重要的实际工程应用价值。
Smart Images

Figure CN122733992A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data storage technology, and in particular to a multi-level gridded storage method for seabed topographic data. Background Technology
[0002] In engineering practice, seabed topographic data collected and used typically exhibit characteristics such as large volume, wide spatial coverage, and relatively sparse data point distribution. Multi-source topographic data acquired through various methods, including handheld depth sounders, single-beam bathymeters, multi-beam bathymeters, and UAV laser depth sounders, also display diverse spatial distribution characteristics; some are gridded, while others are discrete points distributed along the survey line. To effectively manage and efficiently utilize the generated and collected topographic data, it is necessary to develop appropriate data storage formats tailored to its characteristics.
[0003] Seafloor topography data is three-dimensional coordinate data composed of latitude and longitude coordinates or projected geodetic coordinates and elevation data. Currently, the storage formats for seafloor topography data mainly fall into two categories: structured storage and general-purpose storage. Structured storage includes binary encoding formats such as NetCDF and GeoTIFF, while general-purpose storage includes text formats such as XYZ and ESRI Grid.
[0004] The most common storage format for seabed topography data is to store 3D data in columns using standard delimiters (such as commas, spaces, and tabs), forming a text-formatted XYZ file. This file format accurately preserves the original data and has advantages such as simple definition, clear meaning, and easy reading. However, when processing and using seabed topography (such as slope calculation, contour line extraction, and lighting rendering), gridded data is usually required. XYZ files that directly store 3D coordinates in columns often cannot meet these requirements, necessitating manual data gridding or interpolation by the user, increasing the complexity. Furthermore, before visualization, users cannot easily perform spatial partitioning or sparsification of seabed topography data stored in XYZ files. If the data volume is too large, the inability to selectively select data leads to high resource consumption and long processing times when reading and retrieving data.
[0005] Structured storage formats such as NetCDF and GeoTIFF can efficiently store gridded seabed topographic data, allowing users to spatially partition or sparsify the data based on grid points before visualization. However, for seabed topographic data lacking spatial gridded distribution, structured storage files obtained using these formats only store the gridded data, without any original data information. Therefore, users cannot assess the quality of the stored gridded data based on the original data information, leading to reduced data reliability. Furthermore, when gridding topographic data points with uneven spatial distribution, these storage files often suffer from information loss or over-interpolation of topographic features. Summary of the Invention
[0006] To address the aforementioned problems and technical requirements, this application proposes a multi-level gridded storage method for seabed topographic data. The technical solution of this application is as follows: A multi-level gridded storage method for seabed topographic data includes the following steps: Obtain the original seabed topography data point set. Each data point in the original seabed topography data point set includes the X-axis coordinate, Y-axis coordinate, and Z-axis coordinate in the geodetic coordinate system. Based on the spatial distribution characteristics of the data points in the original seabed topography data point set, a background main grid covering all data points in the original seabed topography data point set is determined. Multiple first-level grids are constructed based on the background master grid, and a corresponding grid data structure is established for each first-level grid. The grid data structure is used to store grid attributes, original data points inside the grid, and grid refinement status. Based on the spatial distribution of data points in the original seabed topography data set, and in conjunction with the grid data structure, each first-level grid is refined and the grid data structure is updated. All generated grid data structures are converted into storage files in a preset format.
[0007] The further technical solution is that the grid data structure includes: X-axis coordinates, Y-axis coordinates, X-axis grid size, Y-axis grid size, water depth, grid level, sub-grid number, refinement status, internal data point set and number of internal data points, and X-axis and Y-axis offsets between the grid water depth source data points and the grid coordinates; refining the grid at any level and updating the grid data structure includes: Traverse all data points in the original seabed topography data point set to determine the number of data points within the first-level grid. Based on the grid level, number of internal data points, water depth, and refinement status in the first-level grid's grid data structure, determine whether the refinement conditions are met: When the refinement conditions are not met, the grid data structure of the first-level grid is updated using the information of data points inside the first-level grid. When the refinement conditions are met, the first-level grid is divided into multiple sub-grids, a corresponding grid data structure is established for each sub-grid, and the grid data structure of the first-level grid is updated.
[0008] A further technical solution involves dividing the primary grid into multiple sub-grids, establishing a corresponding grid data structure for each sub-grid, and updating the primary grid's grid data structure, including: The first-level grid is used as the parent grid to divide the grid into multiple sub-grids; the grid refinement status in the parent grid's grid data structure is set to refined, and the number of each sub-grid is recorded in the parent grid's grid data structure. Based on the positional relationship between the coordinates of each data point inside the parent grid and the center point of the parent grid, all data points inside the parent grid are assigned to the corresponding sub-grids one by one; For each newly generated subgrid, if the subgrid contains only one data point, the corresponding grid data structure of the subgrid is constructed using the grid structure data of the parent grid and the data point information contained in the subgrid. Otherwise, the subgrid is recursively refined until all subgrids no longer meet the refinement conditions.
[0009] The further technical solution is that when the refinement state of the first-level grid structure data is unrefined, the number of internal data points is greater than 1, and the grid level is less than the preset highest level, the refinement conditions are determined to be met.
[0010] Further technical solutions include updating the grid data structure, such as: For the first-level grids in the refined grid data structure that do not yet have water depth values, reverse filling is performed based on the water depth information of their sub-grids, including: Traverse all subgrids of the first-level grid. When the grid data structure of any subgrid has a water depth value, obtain the coordinates of the original data point corresponding to the water depth value, calculate the offset of the first-level grid relative to the original data point, and assign the water depth value to the first-level grid. When the first-level grid has no subgrids with water depth values, recursively perform the same search and assignment operation on the subgrids.
[0011] Its further technical solution is to construct the grid data structure corresponding to the sub-grid, including: When the X-axis coordinate of a data point contained within a subgrid is less than the X-axis coordinate of the center point of the parent grid of the subgrid, the X-axis coordinate of the parent grid of the subgrid is used as the X-axis coordinate of the subgrid; when the X-axis coordinate of a data point contained within a subgrid is not less than the X-axis coordinate of the center point of the parent grid of the subgrid, the X-axis coordinate of the center point of the parent grid of the subgrid is used as the X-axis coordinate of the subgrid. When the Y-axis coordinate of a data point contained within a subgrid is greater than the Y-axis coordinate of the center point of the parent grid of the subgrid, the Y-axis coordinate of the parent grid of the subgrid is used as the Y-axis coordinate of the subgrid; when the Y-axis coordinate of a data point contained within a subgrid is not greater than the Y-axis coordinate of the center point of the parent grid of the subgrid, the Y-axis coordinate of the center point of the parent grid of the subgrid is used as the Y-axis coordinate of the subgrid. The X-axis grid size of the sub-grid is half the X-axis grid size of the parent grid of the sub-grid; the Y-axis grid size of the sub-grid is half the Y-axis grid size of the parent grid of the sub-grid. When the X-axis coordinate of the data point contained within the subgrid is less than the X-axis coordinate of the center point of the parent grid of the subgrid, and the Y-axis coordinate of the data point contained within the subgrid is greater than the Y-axis coordinate of the center point of the parent grid of the subgrid, the water depth value of the parent grid of the subgrid is used as the water depth value of the subgrid, the X-axis offset of the parent grid of the subgrid is used as the X-axis offset of the subgrid, and the Y-axis offset of the parent grid of the subgrid is used as the Y-axis offset of the subgrid; otherwise, the water depth value, X-axis offset, and Y-axis offset of the subgrid are all set to empty. Add 1 to the mesh level of the parent mesh of the sub-mesh to get the mesh level of the sub-mesh; set the refined state of the sub-mesh to the unrefined state; The set of all data points contained within a subgrid is defined as the internal data point set of the subgrid; the number of all data points contained within a subgrid is defined as the internal data point count of the subgrid.
[0012] A further technical solution involves updating the grid data structure of the first-level grid using data point information located within the first-level grid when the refinement conditions are not met. This includes: When the refinement state of the first-level grid structure data is unrefined, the number of internal data points is equal to 1, and the water depth value is empty, it is determined that the refinement condition is not met. The water depth value of the data point inside the first-level grid is taken as the water depth value of the first-level grid. The result of subtracting the X-axis coordinate of the data point from the X-axis coordinate of the first-level grid is taken as the X-axis offset of the first-level grid. The result of subtracting the Y-axis coordinate of the data point from the Y-axis coordinate of the first-level grid is taken as the Y-axis offset of the first-level grid. The set of internal data points of the first-level grid is updated to empty, the number of internal data points of the first-level grid is updated to 0, and the refinement state of the first-level grid is updated to refined state. When the refinement status of the first-level grid is unrefined, the number of internal data points is greater than 1, the grid level is equal to the preset highest level, and the water depth value is empty, it is determined that the refinement conditions are not met. The water depth value of the data point closest to the grid node of the first-level grid among all data points inside the first-level grid is determined as the water depth value of the first-level grid. The X-axis offset of the first-level grid is obtained by subtracting the X-axis coordinate of the nearest data point from the X-axis coordinate of the first-level grid. The Y-axis offset of the first-level grid is obtained by subtracting the Y-axis coordinate of the nearest data point from the Y-axis coordinate of the first-level grid. The nearest data point is deleted from the internal data point set of the first-level grid, the number of internal data points of the first-level grid is reduced by 1, and the refinement status of the first-level grid is updated to refined.
[0013] The further technical solution involves determining the background main grid covering all data points in the original seabed topography data set, including: Identify data points belonging to a regular grid in the original seabed topography data point set, extract the coordinate values of all data points belonging to the regular grid on the X-axis and Y-axis, and sort them to obtain the X-axis vector and Y-axis vector respectively; Calculate the difference between any two adjacent elements in the X-axis vector and the Y-axis vector respectively; use the most frequent difference in the X-axis vector as the X-axis grid size of the background main grid, and use the most frequent difference in the Y-axis vector as the Y-axis grid size of the background main grid. The vertex coordinates of the background main grid are calculated based on the maximum coordinate value of the element corresponding to the most frequent difference in the grid size and coordinate axis vectors of the background main grid.
[0014] Its further technical solution is to construct multiple first-level meshes based on the background main mesh, including: The minimum and maximum X-axis coordinates of the vertex coordinates of the background main mesh are used as the X-axis direction limit points, and the minimum and maximum Y-axis coordinates of the vertex coordinates of the background main mesh are used as the Y-axis direction limit points. The X-axis mesh size of the background main mesh is used as the X-axis direction mesh size, and the Y-axis mesh size of the background main mesh is used as the Y-axis direction mesh size. The background main mesh is divided into multiple first-level meshes.
[0015] A further technical solution involves establishing a corresponding grid data structure for any level of grid, including: The X-axis grid node on the background main grid corresponding to the first-level grid is used as the X-axis coordinate of the first-level grid, and the Y-axis grid node on the background main grid corresponding to the first-level grid is used as the Y-axis coordinate of the first-level grid. The X-axis grid size of the background main grid is used as the X-axis grid size of the primary grid, and the Y-axis grid size of the background main grid is used as the Y-axis grid size of the primary grid. Set the grid level of the first-level grid to 1; set the number of internal data points of the first-level grid to 0; set the refinement state to unrefined state; When there are data points in the original seabed topography data point set that have the same coordinates as the first-level grid, the water depth value of the data point is used as the water depth value of the first-level grid, and the X-axis offset and Y-axis offset between the grid water depth source data point and the grid coordinates are set to 0; when there are no data points in the original seabed topography data point set that have the same coordinates as the first-level grid, the water depth value of the first-level grid is set to empty, and the X-axis offset and Y-axis offset between the grid water depth source data point and the grid coordinates are set to 0.
[0016] The beneficial technical effects of this application are: This application discloses a multi-level gridded storage method for seabed topographic data, applicable to multi-source seabed topographic data with different spatial distribution characteristics. It can automatically complete multi-level grid division and grid node assignment based on the spatial location information of topographic data points, providing structured data storage while fully preserving the information of the original data. The multi-level gridded storage file for seabed topographic data obtained based on this method, stored in the form of data structures, tables, or text, can efficiently achieve gridded storage of topographic data while fully preserving the original data information. It meets the needs of data spatial partitioning, sparsity processing, and gridded computation, and can also restore the original data and evaluate the data quality of the gridded data based on relevant attributes in the structure. It is applicable to different application environments, can be read and used without specialized software, and facilitates efficient utilization of seabed topographic data by users with different knowledge backgrounds, possessing significant practical engineering application value.
[0017] This method defines a structure suitable for seabed topographic data attributes. The original data point coordinates are fully preserved through the internal data point set field within the structure, enabling lossless restoration of the original data. The coordinate axis offset field records the offset between the original data points and grid nodes, allowing for the assessment of the impact of gridding on data quality. This plays a crucial role in evaluating the effectiveness of practical engineering applications.
[0018] By designing a structure assignment method oriented towards the background master grid, the grid size is automatically adjusted according to the data distribution density. Fine grids are used in dense data areas to ensure accuracy, while coarse grids are used in sparse areas to improve efficiency, effectively improving storage efficiency and reducing storage space usage.
[0019] The multi-level grid structure supports the rapid retrieval of terrain data for target areas according to spatial range. When performing local terrain processing and visualization, only the grid data corresponding to the target area needs to be loaded, without having to read all the data, which greatly reduces memory consumption, improves the efficiency of terrain data processing and visualization, and solves the problem of time-consuming and labor-intensive reading and calling when the data volume is large in the existing storage method.
[0020] On the other hand, by designing a transmission mechanism that allows subgrid water depth information to be backfilled into the parent grid, it is ensured that all grids have valid water depth data while retaining the position offset information of the original data. This reduces unnecessary grid subdivision, avoids storing redundant data, and further balances the relationship between storage accuracy and storage efficiency. Attached Figure Description
[0021] Figure 1 This is a flowchart of a multi-level gridded storage method.
[0022] Figure 2 This is a schematic diagram showing the distribution of the original seabed topographic data point set in the background main grid of an example.
[0023] Figure 3 This is a schematic diagram of the overall result of multi-level grid refinement of the original seabed topographic data point set in an example.
[0024] Figure 4 This is a partial schematic diagram of the multi-level grid refinement result of the original seabed topographic data point set in an example. Detailed Implementation
[0025] The specific embodiments of this application will be further described below with reference to the accompanying drawings.
[0026] This application discloses a multi-level gridded storage method for seabed topographic data. Please refer to [reference needed]. Figure 1 The flowchart shown illustrates the specific steps of this method as follows: Step 1: Obtain the original seabed topography data point set. Each data point in the original seabed topography data point set includes the X-axis coordinate, Y-axis coordinate, and Z-axis coordinate in the geodetic coordinate system.
[0027] The raw seafloor topography data set is an N×3 dimensional set of data points composed of three sets of vectors: X-axis coordinates, Y-axis coordinates, and Z-axis coordinates. It is obtained directly through topographic surveying and data collection, or through multi-source seafloor topography data in geodetic coordinate systems such as CGCS2000 and WGS84 obtained by projecting latitude and longitude coordinates using Gauss-Kruger projection. N represents the number of data points in the set, typically ranging from tens of thousands to tens of millions of sets. The X-axis of the geodetic coordinate system points to the intersection of the Greenwich Meridian and the equator, the Z-axis points to the Earth's reference pole, and the Y-axis forms a right-handed rectangular coordinate system with the X and Z axes. The first column of the raw seafloor topography data set is the X column, representing the coordinates of points on the X-axis (abbreviated as X); the second column is the Y column, representing the coordinates of points on the Y-axis (abbreviated as Y); and the third column is the Z column, representing the coordinates of points on the Z-axis, which usually directly represents water depth (abbreviated as Z). The X, Y, and Z columns together constitute the three-dimensional coordinates of the seafloor topography data points, typically expressed in meters. By combining the central meridian information used during projection, each set of (X, Y, Z) coordinates can be mapped to a specific point on Earth.
[0028] Step 2: Based on the spatial distribution characteristics of the data points in the original seabed topography data point set, determine the background main grid that covers all data points in the original seabed topography data point set.
[0029] To ensure that the generated grid data covers all original data points, a background for the entire terrain region must first be constructed. In one embodiment, determining the background master grid that covers all data points in the original seabed terrain data set includes: (1) Identify the data points belonging to the regular grid in the original seabed topography data point set, and extract the coordinate values of all data points belonging to the regular grid on the X-axis and Y-axis and sort them to obtain the X-axis vector and Y-axis vector respectively.
[0030] Considering that some multi-source measurement methods output data in a gridded form while others output non-gridded data, and since the original gridded data is already an interpolated result, to prevent further reduction in the accuracy of the original gridded data, the two spatial distribution forms of data are first separated to identify data points belonging to the regular grid. The specific method used in this application is as follows: Repeated values in the X and Y axes of the original seabed topographic data point set are counted separately, and values with more than three repetitions are determined to be gridded data coordinates on the X and Y axes. Each data point is then individually evaluated; if both the X and Y values of the same data point belong to gridded data coordinates on the X and Y axes, then the point is determined to be a gridded data point; otherwise, it is determined to be a non-grid data point.
[0031] Then, the determined grid point data is extracted to form an independent grid point dataset. X and Y are extracted from the grid point dataset and arranged in order to form the X-axis vector (XU) and Y-axis vector (YU). The vector sequence can be in ascending or descending order. For the convenience of subsequent difference calculation, this application adopts ascending order.
[0032] (2) Calculate the difference between any adjacent elements on the X-axis vector and the Y-axis vector respectively; count the most frequent difference in the X-axis vector as the X-axis grid size of the background main grid, and count the most frequent difference in the Y-axis vector as the Y-axis grid size of the background main grid.
[0033] Calculate the difference between adjacent elements (any i-th and i+1-th elements) in vectors XU and YU respectively, i.e., XU(i+1)-XU(i) and YU(i+1)-YU(i), denoted as grid interval vectors XD and YD; count the repeated values in XD and YD respectively, and define the element with the most repeated values as the main grid size XS and YS on the X-axis and Y-axis; extract the positions Xm and Ym of the elements in grid interval vectors XD and YD that are equal to the main grid size XS and YS; define the elements in XU and YU at positions Xm and Ym respectively as main grid nodes XGm and YGm, that is, determine the position of the main grid node by selecting the most common grid point interval on the X-axis and Y-axis.
[0034] (3) Based on the grid size of the background main grid and the maximum value of the coordinates of the element corresponding to the most frequent difference in the coordinate axis vector, the vertex coordinates of the background main grid are calculated.
[0035] The specific calculation method is as follows: The initial four corner coordinates of the background main grid are formed using the maximum and minimum values of the main grid nodes XGm and YGm. Then, using the main grid size as an interval, the four corner coordinates are extended to both sides along the X and Y axes until all target data points fall within the area defined by the grid. The grid node position is generally defined as the upper left corner of the grid, therefore, it needs to be extended an additional main grid size in the positive X-axis and negative Y-axis directions. It should be noted that the grid node can also be defined at other positions, and corresponding extensions in those directions are also required. This application uses the upper left corner of the grid node as an example for illustration.
[0036] The formula for calculating the coordinates (Xmin, Xmax, Ymin, Ymax) of the four vertices of the background main mesh can be expressed as:
[0037]
[0038]
[0039]
[0040] in, To find the minimum value function, To find the maximum value function, This is the floor function.
[0041] This involves calculating the difference between the maximum or minimum value in the main grid node and the maximum or minimum value of the original terrain data points, and then extending upwards to both sides by taking an integer multiple of the main grid size. This method typically ensures that the defined background main grid covers all data points while maintaining the main grid size. Considering that subsequent grids define their coordinates using their upper left corner, an additional grid layer is added to the right and bottom of the background grid that includes all data points to ensure the node definition is meaningful.
[0042] Step 3: Construct multiple first-level grids based on the background main grid, and establish a corresponding grid data structure for each first-level grid. The grid data structure is used to store grid attributes, original data points inside the grid, and grid refinement status.
[0043] In one embodiment, the specific method for constructing multiple primary grids based on the background primary grid is as follows: the minimum and maximum values of the vertex coordinates of the background primary grid along the X-axis are used as the X-axis direction limit points, the minimum and maximum values of the vertex coordinates of the background primary grid along the Y-axis are used as the Y-axis direction limit points, the X-axis grid size of the background primary grid is used as the X-axis direction grid size, and the Y-axis grid size of the background primary grid is used as the Y-axis direction grid size to divide the background primary grid and construct multiple primary grids.
[0044] After the background master mesh is divided, the X-axis and Y-axis mesh nodes of each first-level mesh are obtained. At this point, multiple evenly distributed first-level meshes are obtained, and the coordinate vectors of the background master mesh nodes in the X-axis and Y-axis directions are XG and YG, respectively. The minimum value of XG is Xmin, the maximum value is Xmax, and the step size is XS; the minimum value of YG is Ymin, the maximum value is Ymax, and the step size is XS.
[0045] Furthermore, a corresponding grid data structure is constructed for each first-level grid. This data structure is used to store grid attributes, original data points within the grid, and grid refinement status. The specific content can be set according to actual application requirements. This application defines the grid data structure by analyzing a large amount of original terrain data, including: X-axis coordinates, Y-axis coordinates, X-axis grid size, Y-axis grid size, water depth, grid level, sub-grid number, refinement status, set of internal data points and number of internal data points, as well as the X-axis offset and Y-axis offset between the grid water depth source data points and the grid coordinates.
[0046] The grid structure containing 12 fields is defined as follows: Grid = struct('X',{},'Y',{},... 'XL',{},'YL',{},... 'Depth',{},... 'LeveL',{},'Children',{},... 'points',{},... 'points_num',{}, ... 'offset_X',{},... 'offset_Y',{},... 'isdivided',{}); Here, Grid is a collection of grid structures, where each element Grid(k) corresponds to a first-level grid. Each first-level grid stores and expresses the grid's attribute information in the form of the above structure; the fields 'X' and 'Y' are grid coordinates, representing the X-axis and Y-axis coordinates corresponding to the top-left corner of the grid (i.e., the negative X-axis direction and the positive Y-axis direction); 'XL' represents the X-axis grid size, and 'YL' represents the Y-axis grid size; 'Depth' represents the water depth attribute corresponding to the grid; 'LeveL' represents the grid level, initially defined as level 1, increasing by 1 level with each refinement; 'Children' represents the number of the next-level refined sub-grids contained in this grid within the Grid; 'points' represents the number of points falling within this grid. The data point set includes 'points_num', which represents the number of data points falling within the grid. This set of internal data points does not include the data points from which the grid's depth attribute originates. 'offset_X' and 'offset_Y' represent the offset distances between the data points from which the grid's depth attribute originates and the grid coordinates. 'isdivided' indicates whether the grid has been refined; it is marked as 1 if refined and 0 otherwise. '.' represents the operator for extracting different fields of data from the structure. For example, to extract the depth attribute field of the k-th element in the grid structure set, you can use Grid(k).Depth.
[0047] Based on the grid structure form defined above, establishing the corresponding grid data structure for any level of grid includes: The X-axis grid node on the background main grid corresponding to the first-level grid is used as the X-axis coordinate of the first-level grid, and the Y-axis grid node on the background main grid corresponding to the first-level grid is used as the Y-axis coordinate of the first-level grid; The X-axis grid size of the background main grid is used as the X-axis grid size of this primary grid, and the Y-axis grid size of the background main grid is used as the Y-axis grid size of this primary grid; Set the grid level of the first-level grid to 1; set the number of internal data points of the first-level grid to 0; set the refinement state to unrefinement state; When there is a data point in the original seabed topography data point set with the same coordinates as the first-level grid, the water depth value of that data point is used as the water depth value of the first-level grid, and the X-axis offset and Y-axis offset between the grid water depth source data point and the grid coordinates are set to 0; when there is no data point in the original seabed topography data point set with the same coordinates as the first-level grid, the water depth value of the first-level grid is set to empty, and the X-axis offset and Y-axis offset between the grid water depth source data point and the grid coordinates are set to 0.
[0048] When establishing a first-level grid data structure, it is necessary to assign values to the structure. The actual operation can be as follows: 1) Perform two-layer loops using X-axis grid node XG and Y-axis grid node YG to operate on the background main grid one by one. YG is the outer loop, looping in reverse order from largest to smallest; XG is the inner loop, looping in forward order from smallest to largest. Record the number of loops as k. 2) In the k-th iteration, assign values to the k-th element in the Grid structure collection. Fields 'X' and 'Y' are assigned values corresponding to XG and YG in the current iteration; fields 'XL' and 'YL' are assigned values corresponding to XS and YS; field 'LeveL' is assigned a value of 1, indicating a level 1 grid; field 'points_num' is assigned a value of 0, indicating no data points within the grid (further checks will be performed later); field 'isdivided' is assigned a value of 0, indicating the grid has not been refined. 3) In the k-th loop, determine whether there are any terrain data points in the original terrain data point set (X, Y) that coincide with the grid node (XG, YG): If there is a matching point in the data point set (X, Y) with the same value as (XG, YG), it means that there are data points in the original data that fall on the grid node. Then, the field 'Depth' in the k-th element of the Grid structure is assigned the Z value of the matching point to represent the water depth information of the grid. The fields 'offset_X' and 'offset_Y' are both assigned to 0, indicating that there is no spatial offset between the original data point and the grid data point. The matching point is then deleted from the data point set. If there is no matching point in the data point set (X, Y) with the same value as (XG, YG), it means that there are no data points in the original data that fall on the grid node. Then, the field 'Depth' in the k-th element of the Grid structure is assigned the value nan, indicating that the grid currently has no water depth information; and the fields 'offset_X' and 'offset_Y' are assigned the value 0.
[0049] Step 4: Based on the spatial distribution of data points in the original seabed topography data set and in conjunction with the grid data structure, refine each first-level grid and update the grid data structure.
[0050] In one embodiment, performing refinement processing and updating the grid data structure for any level of grid includes: (1) Traverse all data points in the original seabed topography data point set and determine the number of data points inside the first-level grid.
[0051] The remaining data points in the original terrain data point set, after removing matching points, are iterated through, and each point is determined to fall within a specific grid cell. The left and top boundaries of the grid cell are considered the internal region, while the right and bottom boundaries are considered the external region. For the m-th data point [X(m), Y(m), Z(m)], the following processing is performed: 1) Find the k-th element Grid(k) in the struct collection Grid such that it simultaneously satisfies: Grid(k).X ≤X(m)<Grid(k).X + Grid(k).XL; as well as Grid(k).Y - Grid(k).YL≤Y(m)<Grid(k).Y; 2) While retaining the 'points' field information in Grid(k), add a set of coordinate information [X(m),Y(m),Z(m)] to this field; 3) Incrementing the 'points_num' field value of Grid(k) by 1 indicates that an additional set of data points within the grid has been added.
[0052] (2) Based on the grid level, number of internal data points, water depth value, and refinement status in the grid data structure of the first-level grid, determine whether the refinement conditions are met: One scenario is that when the refinement conditions are not met, the grid data structure of the first-level grid is updated using the information of data points located within that first-level grid.
[0053] In one embodiment, when the refinement condition is not met, updating the grid data structure of the first-level grid using data point information located within the first-level grid includes: When the refinement status of the first-level grid is unrefined, the number of internal data points is equal to 1, and the water depth value is empty, it means that the grid has not been refined, there is only one data point inside, and there is no water depth information. It is determined that the refinement condition is not met at this time. The water depth value of the data point inside the first-level grid is taken as the water depth value of the first-level grid. The result of subtracting the X-axis coordinate of the data point from the X-axis coordinate of the first-level grid is taken as the X-axis offset of the first-level grid. The result of subtracting the Y-axis coordinate of the data point from the Y-axis coordinate of the first-level grid is taken as the Y-axis offset of the first-level grid. The set of internal data points of the first-level grid is updated to empty, the number of internal data points of the first-level grid is updated to 0, and the refinement status of the first-level grid is updated to refined. When the refinement status of the first-level grid is unrefined, the number of internal data points is greater than 1, the grid level is equal to the preset highest level, and the water depth value is empty, it indicates that the grid has not been refined, contains more than one data point, has reached the highest refinement level, and currently has no water depth information. Therefore, it is determined that the refinement conditions are not met at this time. The water depth value of the data point closest to the grid node of the first-level grid among all data points inside the first-level grid is determined as the water depth value of the first-level grid. The X-axis coordinate of the first-level grid is subtracted from the X-axis coordinate of the nearest data point as the X-axis offset of the first-level grid. The Y-axis coordinate of the first-level grid is subtracted from the Y-axis coordinate of the nearest data point as the Y-axis offset of the first-level grid. The nearest data point is then removed from the internal data point set of the first-level grid, the number of internal data points of the first-level grid is reduced by 1, and the refinement status of the first-level grid is updated to refined.
[0054] Another scenario is that when the refinement conditions are met, the first-level grid is divided into multiple sub-grids, a corresponding grid data structure is established for each sub-grid, and the grid data structure of the first-level grid is updated.
[0055] When the refinement status of the first-level grid's grid structure data is unrefined, the number of internal data points is greater than 1, and the grid level is less than the preset maximum level, it indicates that the grid has not been refined, contains at least one original data point, and has not reached the defined maximum level. Therefore, the refinement conditions are met, and the first-level grid is refined. The preset maximum level can be customized according to actual application requirements.
[0056] In one embodiment, dividing the primary grid into multiple sub-grids, establishing a corresponding grid data structure for each sub-grid, and updating the grid data structure of the primary grid includes: 1) The first-level grid is used as the parent grid to divide the grid into multiple sub-grids; the grid refinement state in the grid data structure of the parent grid is set to refined, and the number of each sub-grid is recorded in the grid data structure of the parent grid; when dividing the sub-grids, the more sub-grids there are, the higher the accuracy, but the larger the memory consumption and the longer the time to read the data. Considering both accuracy and computational load, in one example, the specific way to divide the first-level grid into multiple sub-grids using the parent grid as the parent grid is as follows: the parent grid is divided into two parts in the X-axis and Y-axis directions using the center point of the parent grid as the dividing point, generating four sub-grids of equal size.
[0057] 2) Based on the positional relationship between the coordinates of each data point inside the parent grid and the center point of the parent grid, all data points inside the parent grid are assigned to the corresponding sub-grids one by one.
[0058] Read all information from 'points' in Grid(k), represent it as a vector (xp, yp, zp) consisting of the coordinates of all data points, and loop through this vector to determine which subgrid partition each point falls into. The condition for determining any data point (xp, yp, zp) is: Partition 1: (xp < xc) and (yp > yc); 2 partitions: (xp≥xc) and (yp>yc); 3 partitions: (xp < xc) and (yp ≤ yc); 4 partitions: (xp≥xc) and (yp≤yc); The coordinates of the center point of the parent grid are (xc, yc), where xc = Grid(k).X + Grid(k).XL / 2; yc = Grid(k).Y - Grid(k).YL / 2.
[0059] The subgrid numbers from 1 to 4 are cycled. If a data point falls into the corresponding subgrid partition, the corresponding structure Grid_c is declared in the format in step 3; otherwise, it is skipped.
[0060] 3) For each newly generated subgrid, if the subgrid contains only one data point, construct the corresponding grid data structure of the subgrid using the grid structure data of the parent grid and the data point information contained in the subgrid. Otherwise, recursively continue to refine the subgrid until all subgrids no longer meet the refinement conditions.
[0061] In one embodiment, constructing the grid data structure corresponding to the sub-grid includes: When the X-axis coordinate of a data point contained within a subgrid is less than the X-axis coordinate of the center point of the parent grid of the subgrid, the X-axis coordinate of the parent grid of the subgrid is used as the X-axis coordinate of the subgrid; when the X-axis coordinate of a data point contained within a subgrid is not less than the X-axis coordinate of the center point of the parent grid of the subgrid, the X-axis coordinate of the center point of the parent grid of the subgrid is used as the X-axis coordinate of the subgrid. When the Y-axis coordinate of a data point contained within a subgrid is greater than the Y-axis coordinate of the center point of the parent grid of the subgrid, the Y-axis coordinate of the parent grid of the subgrid is used as the Y-axis coordinate of the subgrid; when the Y-axis coordinate of a data point contained within a subgrid is not greater than the Y-axis coordinate of the center point of the parent grid of the subgrid, the Y-axis coordinate of the center point of the parent grid of the subgrid is used as the Y-axis coordinate of the subgrid. The X-axis grid size of the sub-grid is half the X-axis grid size of its parent grid; the Y-axis grid size of the sub-grid is half the Y-axis grid size of its parent grid. When the X-axis coordinate of the data point contained within the subgrid is less than the X-axis coordinate of the center point of the parent grid of the subgrid, and the Y-axis coordinate of the data point contained within the subgrid is greater than the Y-axis coordinate of the center point of the parent grid of the subgrid, the water depth value of the parent grid of the subgrid is used as the water depth value of the subgrid, the X-axis offset of the parent grid of the subgrid is used as the X-axis offset of the subgrid, and the Y-axis offset of the parent grid of the subgrid is used as the Y-axis offset of the subgrid; otherwise, the water depth value, X-axis offset, and Y-axis offset of the subgrid are all set to empty. Increment the mesh level of the parent mesh of the sub-mesh by 1 to obtain the mesh level of the sub-mesh; set the refined state of the sub-mesh to the unrefined state; The set of internal data points of a subgrid is defined as all the data points contained within it; the number of internal data points of a subgrid is defined as the total number of data points contained within it.
[0062] Based on the above 1-4 partitions, the above method of assigning values to the subgrid partitions where a point falls in can be expressed as: For partitions 1 to 4, the field 'X' is assigned the value (Grid(k).X,xc,Grid(k).X,xc) respectively, using either the parent grid coordinates or the grid center point coordinates. For partitions 1 to 4, the field 'Y' is assigned the value (Grid(k).Y,Grid(k).Y,yc,yc) using either the parent grid coordinates or the grid center point coordinates, respectively. Assign the values 'XL' and 'YL' to Grid(k).XL / 2 and Grid(k).YL / 2 respectively, based on the parent grid information; Set the value of the field 'isdivided' to 0; Assign the value Grid(k).LeveL+1 to the field 'LeveL'; Assign the field 'points' the (X, Y, Z) information of all points that fall within this area; Assign the value 'points_num' to the total number of points that fall into the area. If the partition being processed is partition 1, then the corresponding fields of the child grid are assigned values based on the 'Depth', 'offset_X', and 'offset_Y' fields of the parent grid Grid(k). If the partitions being processed are partitions 2 to 4, then the 'Depth' field of the child grid is assigned the value nan.
[0063] For each Grid_c declared under this grid, add the corresponding number of elements to the tail of the grid structure collection Grid to store the structure information of the sub-grid; at the same time, perform an update operation on the parent grid Grid(k): set the 'isdivided' field of the parent grid Grid(k) to 1, indicating that the grid has been divided; add the number of each sub-grid in the Grid to the 'Children' field of the parent grid Grid(k); If all elements in the Grid structure set satisfy any one of the following three conditions: isdivided=1, LevelL=Lm and Depth is not nan, and points_num=0, then all grids have been refined into multi-level grids as required, and the grid division and structure assignment are complete. If there are still structure elements that do not satisfy the above three conditions, then the refinement process is re-executed on the Grid structure set that has undergone the above processing.
[0064] After the refinement process is complete, updating the grid data structure also includes: For the first-level grids in the refined grid data structure that do not yet have water depth values, reverse filling is performed based on the water depth information of their sub-grids, including: Traverse all subgrids of the first-level grid. When the grid data structure of any subgrid has a water depth value, obtain the coordinates of the original data point corresponding to the water depth value, calculate the offset of the first-level grid relative to the original data point, and assign the water depth value to the first-level grid. When the first-level grid has no subgrids with water depth values, recursively perform the same search and assignment operation on the subgrid.
[0065] The specific operation for assigning water depth values to the Grid structure collection is as follows: Extract each element k in the Grid structure collection whose 'Depth' field value is nan, and determine whether its corresponding 'Children' field is null. 1) If the 'Children' field is not empty, then cycle through the subgrid numbers in the 'Children' field.
[0066] Extract the structure element corresponding to subgrid number j. If the 'Depth' field of the subgrid is not NaN, assign it to the 'Depth' field of the parent grid. Return the coordinates of the data source point corresponding to the grid's water depth value based on X = Grid(j).X-Grid(j).offset_X and Y = Grid(j).Y-Grid(j).offset_Y. Then calculate the 'offset_X' and 'offset_Y' fields based on the parent grid coordinates. Grid(k).offset_X = Grid(k).XX, Grid(k).offset_Y = Grid(k).YY.
[0067] If the 'Depth' field of the subgrid is nan, then the above retrieval and assignment process is recursively executed on the next lower level grid of the subgrid Grid(j). The recursion terminates when the 'Depth' field of the subgrid is not nan or the 'Children' field of the parent grid is null. 2) If the 'Children' field is empty, then this structure element will not be processed.
[0068] Following the steps above and setting the maximum refinement level to 3, the acquired raw seabed topography data point set is refined. The distribution of the raw seabed topography data point set on the background main grid is as follows: Figure 2 As shown, the original seabed topography data set includes both gridded and non-gridded data points, while the background main grid covers all data points in the original seabed topography data set. The final refined overall result is shown below. Figure 3 As shown, the local results are as follows Figure 4 As shown in the diagram, black grids represent level one grids, red grids represent level two grids, and green grids represent level three grids. Figure 3 , 4 As can be seen, the degree of grid refinement varies in different regions of the figure. The original grid data with the largest data size has the same grid size as the background main grid, so it has not been refined. The data points in the original non-grid data point region and the original grid data region with small grid size are relatively dense, so the grid layers are deeper. The original data points in the original grid data region with large grid size are relatively sparse, so it has only been refined once.
[0069] Step 5: Convert all generated grid data structures into storage files in a preset format.
[0070] The processed collection of structures is converted into a storage file in a preset format, with each field as a column. Specifically, it can be in table or text format.
[0071] Through the above operations, multi-level grid refinement of the target seabed topographic data and gridded storage of data containing complete original information were completed in three formats: program structure, table, and text. This facilitates the extraction of grid topographic data of different fineness and also enables the lossless reconstruction of the original measurement data.
[0072] The above descriptions are merely preferred embodiments of this application, and this application is not limited to the above embodiments. It is understood that other improvements and variations that can be directly derived or conceived by those skilled in the art without departing from the spirit and concept of this application should be considered to be included within the protection scope of this application.
Claims
1. A multi-level gridded storage method for seabed topographic data, characterized in that, The multi-level gridded storage method includes: Obtain the original seabed topography data point set, wherein each data point in the original seabed topography data point set includes the X-axis coordinate, Y-axis coordinate, and Z-axis coordinate in the geodetic coordinate system; Based on the spatial distribution characteristics of the data points in the original seabed topography data point set, a background main grid covering all data points in the original seabed topography data point set is determined. Multiple first-level grids are constructed based on the background main grid, and a corresponding grid data structure is established for each first-level grid. The grid data structure is used to store grid attributes, original data points inside the grid, and grid refinement status. Based on the spatial distribution of data points in the original seabed topography data set, and in conjunction with the grid data structure, each first-level grid is refined and the grid data structure is updated. All generated grid data structures are converted into storage files in a preset format.
2. The multi-level gridded storage method according to claim 1, characterized in that, The grid data structure includes: X-axis coordinates, Y-axis coordinates, X-axis grid size, Y-axis grid size, water depth, grid level, sub-grid number, refinement status, internal data point set and number of internal data points, and X-axis and Y-axis offsets between the grid water depth source data points and the grid coordinates; performing refinement processing and updating the grid data structure for any level of grid includes: Traverse all data points in the original seabed topography data point set to determine the number of data points located within the first-level grid. Based on the grid level, number of internal data points, water depth, and refinement status in the first-level grid's grid data structure, determine whether the refinement conditions are met: When the refinement conditions are not met, the grid data structure of the first-level grid is updated using the data point information inside the first-level grid. When the refinement conditions are met, the first-level grid is divided into multiple sub-grids, a corresponding grid data structure is established for each sub-grid, and the grid data structure of the first-level grid is updated.
3. The multi-level gridded storage method according to claim 2, characterized in that, The process of dividing the primary grid into multiple sub-grids, establishing a corresponding grid data structure for each sub-grid, and updating the grid data structure of the primary grid includes: The first-level grid is used as the parent grid to divide the grid into multiple sub-grids; the grid refinement state in the grid data structure of the parent grid is set to the refined state, and the number of each sub-grid is recorded in the grid data structure of the parent grid. Based on the positional relationship between the coordinates of each data point inside the parent grid and the center point of the parent grid, all data points inside the parent grid are assigned one by one to the corresponding sub-grids; For each newly generated subgrid, if the subgrid contains only one data point, the grid data structure corresponding to the subgrid is constructed using the grid structure data of the parent grid of the subgrid and the data point information contained in the subgrid. Otherwise, the subgrid is recursively refined until all subgrids no longer meet the refinement conditions.
4. The multi-level gridded storage method according to claim 2, characterized in that, When the refinement state of the first-level grid's grid structure data is unrefined, the number of internal data points is greater than 1, and the grid level is less than the preset highest level, the refinement conditions are determined to be met.
5. The multi-level gridded storage method according to claim 2, characterized in that, Updating the grid data structure also includes: For the first-level grids in the refined grid data structure that do not yet have water depth values, reverse filling is performed based on the water depth information of their sub-grids, including: Traverse all subgrids of the first-level grid. When the grid data structure of any subgrid has a water depth value, obtain the coordinates of the original data point corresponding to the water depth value, calculate the offset of the first-level grid relative to the original data point, and assign the water depth value to the first-level grid. When the first-level grid has no subgrids with water depth values, recursively perform the same retrieval and assignment operations on the subgrids.
6. The multi-level gridded storage method according to claim 3, characterized in that, Constructing the grid data structure corresponding to the sub-grid includes: When the X-axis coordinate of the data point contained within the sub-grid is less than the X-axis coordinate of the center point of the parent grid of the sub-grid, the X-axis coordinate of the parent grid of the sub-grid is used as the X-axis coordinate of the sub-grid; when the X-axis coordinate of the data point contained within the sub-grid is not less than the X-axis coordinate of the center point of the parent grid of the sub-grid, the X-axis coordinate of the center point of the parent grid of the sub-grid is used as the X-axis coordinate of the sub-grid. When the Y-axis coordinate of the data point contained within the sub-grid is greater than the Y-axis coordinate of the center point of the parent grid of the sub-grid, the Y-axis coordinate of the parent grid of the sub-grid is used as the Y-axis coordinate of the sub-grid; when the Y-axis coordinate of the data point contained within the sub-grid is not greater than the Y-axis coordinate of the center point of the parent grid of the sub-grid, the Y-axis coordinate of the center point of the parent grid of the sub-grid is used as the Y-axis coordinate of the sub-grid. The X-axis grid size of the sub-grid is half of the X-axis grid size of the parent grid of the sub-grid; the Y-axis grid size of the sub-grid is half of the Y-axis grid size of the parent grid of the sub-grid. When the X-axis coordinate of the data point contained within the sub-grid is less than the X-axis coordinate of the center point of the parent grid of the sub-grid, and the Y-axis coordinate of the data point contained within the sub-grid is greater than the Y-axis coordinate of the center point of the parent grid of the sub-grid, the water depth value of the parent grid of the sub-grid is used as the water depth value of the sub-grid, the X-axis offset of the parent grid of the sub-grid is used as the X-axis offset of the sub-grid, and the Y-axis offset of the parent grid of the sub-grid is used as the Y-axis offset of the sub-grid; otherwise, the water depth value, X-axis offset, and Y-axis offset of the sub-grid are all set to empty. The mesh level of the parent mesh of the sub-mesh is incremented by 1 to obtain the mesh level of the sub-mesh; the refined state of the sub-mesh is set to the unrefined state. The set of all data points contained within the sub-grid is defined as the set of internal data points of the sub-grid; the number of all data points contained within the sub-grid is defined as the number of internal data points of the sub-grid.
7. The multi-level gridded storage method according to claim 2, characterized in that, When the refinement conditions are not met, updating the grid data structure of the first-level grid using data point information located within the first-level grid includes: When the refinement state of the first-level grid is unrefined, the number of internal data points is equal to 1, and the water depth value is empty, it is determined that the refinement condition is not met. The water depth value of the data point inside the first-level grid is taken as the water depth value of the first-level grid. The X-axis coordinate of the first-level grid minus the X-axis coordinate of the data point is taken as the X-axis offset of the first-level grid. The Y-axis coordinate of the first-level grid minus the Y-axis coordinate of the data point is taken as the Y-axis offset of the first-level grid. The set of internal data points of the first-level grid is updated to empty, the number of internal data points of the first-level grid is updated to 0, and the refinement state of the first-level grid is updated to refined state. When the refinement state of the primary grid is unrefined, the number of internal data points is greater than 1, the grid level is equal to the preset highest level, and the water depth value is empty, it is determined that the refinement conditions are not met. The water depth value of the data point closest to the grid node of the primary grid among all data points inside the primary grid is determined as the water depth value of the primary grid. The X-axis coordinate of the primary grid is subtracted from the X-axis coordinate of the nearest data point as the X-axis offset of the primary grid. The Y-axis coordinate of the primary grid is subtracted from the Y-axis coordinate of the nearest data point as the Y-axis offset of the primary grid. The nearest data point is deleted from the internal data point set of the primary grid, the number of internal data points of the primary grid is reduced by 1, and the refinement state of the primary grid is updated to refined state.
8. The multi-level gridded storage method according to claim 1, characterized in that, The background master grid that covers all data points in the original seabed topography data point set includes: Identify data points belonging to a regular grid in the original seabed topography data point set, extract the coordinate values of all data points belonging to the regular grid on the X-axis and Y-axis, and sort them to obtain the X-axis vector and Y-axis vector respectively; Calculate the difference between any two adjacent elements in the X-axis vector and the Y-axis vector respectively; use the most frequent difference in the X-axis vector as the X-axis grid size of the background main grid, and use the most frequent difference in the Y-axis vector as the Y-axis grid size of the background main grid. The vertex coordinates of the background main grid are calculated based on the maximum coordinate value of the element corresponding to the most frequent difference in the grid size and coordinate axis vectors of the background main grid.
9. The multi-level gridded storage method according to claim 8, characterized in that, Multiple first-level meshes are constructed based on the aforementioned background master mesh, including: The minimum and maximum X-axis coordinates of the vertex coordinates of the background main mesh are used as the X-axis direction limit points, and the minimum and maximum Y-axis coordinates of the vertex coordinates of the background main mesh are used as the Y-axis direction limit points. The X-axis mesh size of the background main mesh is used as the X-axis direction mesh size, and the Y-axis mesh size of the background main mesh is used as the Y-axis direction mesh size. The background main mesh is divided into multiple first-level meshes.
10. The multi-level gridded storage method according to claim 9, characterized in that, Establishing a corresponding grid data structure for any level of grid includes: The X-axis grid node on the background main grid corresponding to the first-level grid is used as the X-axis coordinate of the first-level grid, and the Y-axis grid node on the background main grid corresponding to the first-level grid is used as the Y-axis coordinate of the first-level grid; The X-axis grid size of the background main grid is used as the X-axis grid size of the primary grid, and the Y-axis grid size of the background main grid is used as the Y-axis grid size of the primary grid. Set the grid level of the first-level grid to 1; set the number of internal data points of the first-level grid to 0; set the refinement state to the unrefined state; When there is a data point in the original seabed topography data point set with the same coordinates as the first-level grid, the water depth value of the data point is used as the water depth value of the first-level grid, and the X-axis offset and Y-axis offset between the grid water depth source data point and the grid coordinates are set to 0; when there is no data point in the original seabed topography data point set with the same coordinates as the first-level grid, the water depth value of the first-level grid is set to empty, and the X-axis offset and Y-axis offset between the grid water depth source data point and the grid coordinates are set to 0.