A method for segmenting and merging linear features based on ArcGIS
By processing linear ground vector data in the ArcGIS platform, topological errors are identified and corrected, and segmentation parameters are dynamically adjusted, the problem of spot boundary instability caused by topological errors in the linear ground centerline is solved, and a higher consistency and accurate spot segmentation result is achieved.
Patent Information
- Application Number
- CN202510251548.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-05
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2045-03-05
AI Technical Summary
In the prior art, the topological error of the linear ground center line may lead to instability in the generation of the spot boundary under different scales, thereby reducing the accuracy of the spot segmentation result.
By obtaining and processing linear ground vector data in the ArcGIS platform, identifying and correcting topological errors, generating topological correction rules, applying a centerline extraction algorithm to generate centerlines, and dynamically adjusting segmentation parameters through multi-scale sampling and tensor flow field analysis, and finally performing pattern segmentation and spatial merging processing with the centerline as the guide.
It effectively eliminates the instability of the pattern boundary generation caused by topological errors, improves the consistency and accuracy of the pattern segmentation results, and significantly improves the reliability of spatial data processing.
Smart Images

Figure CN119741318B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image patch segmentation technology, and more specifically, to an ArcGIS-based linear feature centerline segmentation and image patch merging method. Background Art
[0002] In the field of geographic information processing, linear features (such as rivers, roads, boundaries, etc.) are important basic data for map segmentation and spatial analysis. In order to accurately represent the geometric morphology and spatial characteristics of linear features, it is usually necessary to extract the centerline based on its vector data. However, there are often topological errors (such as breakpoints and discontinuities) in the vector data of linear features. These errors not only affect the accuracy of centerline generation, but may also cause unstable segmentation results of map boundary at multiple scales. In different application scenarios, such as map segmentation based on the ArcGIS platform, as the scale changes, the effect of topological error amplification may make the map boundary present greater randomness, further affecting the accuracy and reliability of data analysis.
[0003] In the prior art, the topological error of the center line of a linear feature may lead to instability in the generation of patch boundaries at different scales, which may cause a decrease in the accuracy of the patch segmentation result. Summary of the invention
[0004] In order to overcome the above-mentioned defects of the prior art, an embodiment of the present invention provides a method for segmenting and merging linear features centerlines based on ArcGIS to solve the problems raised in the above-mentioned background technology.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] The method for segmenting and merging the center lines of linear features based on ArcGIS includes the following steps:
[0007] S1: Obtain linear feature vector data in the ArcGIS platform, perform topological check processing on the linear feature vector data, and identify and obtain topological error information;
[0008] S2: Generate topology correction rules based on topology error information, and use the topology correction rules to perform topology correction on linear feature vector data with breakpoints and discontinuities;
[0009] S3: Apply the centerline extraction algorithm to the linear feature vector data after topological correction to generate the centerline of the linear feature, and use the centerline as a guiding element;
[0010] S4: Before the image segmentation, the local curvature change rate of the centerline is analyzed by multi-scale sampling to evaluate the spatial consistency of the centerline curvature change; the centerline offset direction tensor is analyzed by tensor flow field construction to evaluate the coordination of the offset direction in the adjacent range with the centerline as the core;
[0011] S5: Dynamically adjust the segmentation parameters based on the spatial consistency of the centerline curvature change and the coordination of the offset direction within the adjacent range centered on the centerline;
[0012] S6: Perform patch segmentation based on the segmentation parameters and the center line as a guide, and perform spatial merging of the segmented patches based on the geometric adjacency relationship and attribute similarity rules of the patches.
[0013] In a preferred embodiment, linear feature vector data is obtained in an ArcGIS platform, and topological check processing is performed on the linear feature vector data to identify topological error information, specifically including:
[0014] Load the vector data file of the linear feature in the ArcGIS platform. The vector data file contains vector data describing the geometric shape and topological relationship of the linear feature.
[0015] Use the topology check tool in ArcGIS platform to check the topological integrity of vector data, including the detection of breakpoints, discontinuous segments and duplicate nodes;
[0016] Generate a topology check result file, which contains the location information and error type information of the topology error.
[0017] In a preferred embodiment, a topology correction rule is generated based on the topology error information, and the topology correction rule is used to perform topology correction on the linear feature vector data with breakpoints and discontinuities, specifically including:
[0018] Based on the topological error information in the topological check result file, the location information of the breakpoints, discontinuous line segments and repeated nodes and the error type information are extracted;
[0019] Generate topology correction rules based on error type information:
[0020] For breakpoints, the generated rules are used to automatically connect the endpoints of adjacent line segments, and the connection conditions include that the distance between the endpoints is less than the preset tolerance value;
[0021] For discontinuous line segments, the generation rules are used to correct the positions of the start and end points of the line segments so that they coincide with the nodes of the adjacent line segments;
[0022] For duplicate nodes, the generation rules are used to remove duplicate nodes and retain a unique node;
[0023] Use topology correction rules to perform topology correction on linear feature vector data: adjust the geometric position of line segments and node connection relationships according to topology correction rules; verify the topology-corrected vector data to ensure that the corrected vector data meets the topology integrity requirements;
[0024] The linear feature vector data after topological correction is saved as a corrected data file, which contains line segment geometry information, node connection relationship and unique identifier.
[0025] In a preferred embodiment, a centerline extraction algorithm is applied to the linear feature vector data after topological correction to generate the centerline of the linear feature, and the centerline is used as a guiding element, specifically including:
[0026] Based on the linear feature vector data after topological correction, the geometric center point sequence of each line segment is extracted, and the center point is defined as the midpoint of the line segment;
[0027] According to the spatial position of the center point and the connection relationship between the adjacent line segments, a spatial connectivity network of the center point is constructed, where the network nodes are the center points and the edges are the connecting lines of the adjacent center points.
[0028] Based on the spatial connectivity network, the geometric center point sequence is adjusted, redundant nodes are removed and offsets are corrected to generate the initial shape of the center line of the linear feature;
[0029] A smoothing algorithm is applied to the initial shape of the centerline to adjust the curvature change rate, output the centerline vector data, and mark the centerline vector data as a guide feature.
[0030] In a preferred embodiment, the local curvature change rate of the centerline is analyzed by multi-scale sampling to evaluate the spatial consistency of the centerline curvature change, specifically including:
[0031] Select the sampling range and define the sampling point interval under multiple scales based on the centerline vector data;
[0032] Based on the geometric relationship between adjacent sampling points, the curvature change rate of the center line at each scale is calculated segment by segment;
[0033] The curvature change rate at each scale is mapped to the spatial position of the center line to generate a spatial distribution model of the curvature change rate;
[0034] The curvature change spatial consistency index was calculated based on the spatial distribution model of the curvature change rate to evaluate the spatial consistency of the centerline curvature change.
[0035] In a preferred embodiment, the curvature variation spatial consistency index is calculated, and its expression is: ;in, represents the spatial consistency index of curvature change, represents the variance of the rate of change of curvature, Represents the average value of the curvature change rate.
[0036] In a preferred embodiment, the tensor of the centerline offset direction is analyzed by constructing a tensor flow field to evaluate the coordination of the offset direction within an adjacent range with the centerline as the core, specifically including:
[0037] Based on the centerline vector data, point sampling is performed in the adjacent space range on both sides of the centerline, and the offset vector of each point relative to the centerline is recorded;
[0038] The offset vector in the adjacent spatial range is converted into a tensor representation, each tensor is constructed based on the direction and magnitude of the offset vector, and a tensor flow field covering the adjacent spatial range is generated;
[0039] Perform eigenvalue decomposition on each tensor in the tensor flow field, extract the main axis direction and the secondary axis direction, and record the offset direction distribution of the main axis direction and the secondary axis direction in the adjacent space range respectively;
[0040] Based on the offset direction distribution of the primary axis direction and the secondary axis direction in the adjacent spatial range, the offset direction synergy index is calculated to quantify the synergy of the offset direction in the adjacent range with the center line as the core.
[0041] In a preferred embodiment, the expression of the offset direction synergy index is: ;in, represents the offset direction synergy index, Indicates The principal axis direction angles of the tensor, represents the weighted average of the main axis direction angles, Indicates The principal eigenvalue of a tensor, Indicates The secondary eigenvalues of a tensor, Indicates the number of tensors corresponding to the sampling.
[0042] In a preferred embodiment, based on the spatial consistency of the centerline curvature change and the coordination of the offset direction within the adjacent range with the centerline as the core, the segmentation parameters are dynamically adjusted, specifically including:
[0043] The spatial consistency index of curvature change and the synergy index of offset direction are used as input indicators for segmentation parameter adjustment. According to the influence relationship of the input indicators, a weight model is constructed and the influence weight of each input indicator is defined.
[0044] Based on the weight model and the input index, the segmentation parameter adjustment amount is calculated, and the segmentation parameter adjustment amount includes a dynamic adjustment value of a spatial offset threshold and a neighborhood radius;
[0045] The calculated segmentation parameter adjustment amount is applied to the segmentation parameter update to generate a dynamically adjusted segmentation parameter set.
[0046] In a preferred embodiment, the image spots are segmented by using the segmentation parameters with the center line as the guide, and the segmented image spots are spatially merged based on the geometric adjacent relationship and attribute similarity rules of the image spots, specifically including:
[0047] Based on the dynamically adjusted segmentation parameters, the adjacent space range is divided into regions through the center line to generate the initial segmentation boundary;
[0048] Optimize the initial segmentation boundary based on the boundary smoothness rule between adjacent segmentation regions;
[0049] Extract geometric features from each segmented patch, including area, perimeter, shape index and its spatial adjacency relationship with adjacent patches;
[0050] Extracting the patch attribute features based on the spatial data inside the patch, the patch attribute features include category information, density distribution and its attribute similarity with neighboring patches;
[0051] According to the geometric adjacency relationship and attribute similarity rules of the patches, the patches that meet the merging conditions are spatially merged to generate the final segmentation result.
[0052] The technical effects and advantages of the method for segmenting and merging linear features based on ArcGIS are as follows:
[0053] 1. By acquiring and processing linear feature vector data in the ArcGIS platform, topological errors such as breakpoints and discontinuities are systematically identified and corrected, thereby effectively eliminating the instability of patch boundary generation caused by topological errors in the existing technology. By applying multi-scale sampling methods, the local curvature change rate of the centerline is deeply analyzed, and a tensor flow field is constructed to evaluate the coordination of the offset direction. The segmentation parameters can be dynamically adjusted to make the patch segmentation process more adaptable and accurate, ensuring the high consistency and accuracy of the patch segmentation results at different scales, and significantly improving the reliability of spatial data processing.
[0054] 2. Combining the geometric adjacency relationship and attribute similarity rules, the initially segmented patches are spatially merged to further optimize the overall quality of the segmentation results. By constructing a weight model, the influence weights of the spatial consistency of curvature changes and the synergy index of the offset direction are reasonably allocated, and the segmentation parameters are scientifically and dynamically adjusted. This not only improves the flexibility and adaptability of patch segmentation, but also ensures the stability and accuracy of the segmentation results in complex terrain and changing environments, significantly improving the problems of insufficient patch segmentation accuracy and poor stability in the existing technology. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 It is a schematic diagram of the method for segmenting and merging spots of linear features centerlines based on ArcGIS of the present invention. DETAILED DESCRIPTION
[0056] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0057] Example: Figure 1 The present invention provides a method for segmenting and merging linear features based on ArcGIS, which includes the following steps:
[0058] S1: Obtain linear feature vector data in the ArcGIS platform, perform topological check processing on the linear feature vector data, and identify topological error information.
[0059] S2: Generate topology correction rules based on topology error information, and use the topology correction rules to perform topology correction on linear feature vector data with breakpoints and discontinuities.
[0060] S3: Apply the centerline extraction algorithm to the linear feature vector data after topological correction to generate the centerline of the linear feature, and use the centerline as the guiding element.
[0061] S4: Before the image segmentation, the local curvature change rate of the centerline is analyzed through multi-scale sampling to evaluate the spatial consistency of the centerline curvature change; the centerline offset direction tensor is analyzed through tensor flow field construction to evaluate the coordination of the offset direction in the adjacent range with the centerline as the core.
[0062] S5: Dynamically adjust the segmentation parameters based on the spatial consistency of the centerline curvature change and the coordination of the offset direction within the adjacent range centered on the centerline.
[0063] S6: Perform patch segmentation based on the segmentation parameters and the center line as a guide, and perform spatial merging of the segmented patches based on the geometric adjacency relationship and attribute similarity rules of the patches.
[0064] Obtain linear feature vector data in the ArcGIS platform, perform topological check processing on the linear feature vector data, and identify topological error information, including:
[0065] Load the vector data file of the linear feature in the ArcGIS platform. The vector data file contains vector data describing the geometric shape and topological relationship of the linear feature:
[0066] In the ArcGIS platform, use the data management tool to load the vector data file of the linear feature. The vector data file can be in Shapefile format, GeoJSON format, or a vector data table in a database (such as Geodatabase format).
[0067] The vector data file of linear features is mainly used to describe the geometric shape and topological relationship of linear features. The geometric shape includes the node coordinate information of the line segment; the topological relationship includes the connection relationship between the line segments, the node sharing relationship, etc.
[0068] Users need to set the working directory in the ArcGIS environment and import the linear feature vector file into the specified map layer. After the file is imported, the platform automatically loads the vector data as a visualization feature layer for subsequent topology checking operations.
[0069] If incompatible file formats or missing data fields are detected during the loading process, ArcGIS will automatically prompt an error message and require the user to repair the data format or re-specify the file path. To ensure the accuracy of subsequent topology checks, it is necessary to verify the consistency of the projection coordinate system of the vector data after loading is completed. The coordinate system of the vector data must be unified into a projection coordinate system (such as WGS 84 or UTM) to avoid geometric data offset or inaccuracy due to differences in coordinate systems.
[0070] Use the topology check tool in the ArcGIS platform to check the topological integrity of vector data, including the detection of breakpoints, discontinuous segments, and duplicate nodes:
[0071] In ArcGIS, select a topology check tool (such as Topology Checker or Topology RuleManager) to perform a topology check on the loaded linear feature vector data.
[0072] Topology checking rules need to be set according to the characteristics of linear features, mainly including the following three categories:
[0073] Breakpoint detection: used to identify the breakpoints between line segments, which usually appear as gaps between the endpoints of two adjacent line segments.
[0074] Discontinuous Line Detection: Used to detect situations where line segments are not geometrically correctly connected, including situations where the start and end points of a line segment do not share a common node.
[0075] Duplicate node detection: used to find nodes that are stored repeatedly at the same location, which may cause abnormal topological relationships.
[0076] When the platform performs a topology check, it scans the geometric structure segment by segment and verifies the geometric characteristics of each segment according to the rules. If an anomaly is found, the platform will generate a corresponding error mark.
[0077] The parameters in the inspection process need to be set in combination with the specific characteristics of the linear features, for example: the tolerance value allowed for breakpoints (usually set to an accuracy of 10 to the power of -6); the minimum distance threshold for repeated nodes (such as 0.001 meters).
[0078] After the check is completed, users can view the topology check results through the ArcGIS visualization interface. The results are displayed in the form of a marker layer. The marker layer will highlight the line segments containing topological errors and mark the specific error type.
[0079] Generate a topology check result file, which contains the location information and error type information of topology errors:
[0080] Export the error marking results of the topology check in the form of a file to generate a topology check result file. The result file is usually saved in the form of a vector data table and supports multiple formats in the ArcGIS platform, such as Shapefile, CSV file or database table.
[0081] Topological error types: including breakpoints, discontinuous line segments, and duplicate nodes.
[0082] Error location information: Use geometric coordinates to indicate the specific location of the topological error, such as the coordinates of a breakpoint or a duplicate node.
[0083] Generate topology correction rules based on topology error information, and use topology correction rules to perform topology correction on linear feature vector data with breakpoints and discontinuities, including:
[0084] Based on the topological error information in the topology check result file, extract the location information of breakpoints, discontinuous line segments and repeated nodes and the error type information:
[0085] Extracting data containing topological error information from the topology check result file mainly includes the following three parts:
[0086] Breakpoint information: records the coordinates of endpoints that are not correctly connected between adjacent line segments;
[0087] Discontinuous line segment information: records the spatial position where the start and end points of the line segment are not aligned or have gaps;
[0088] Duplicate node information: records the spatial coordinates of duplicate nodes located at the same or close positions.
[0089] The extracted topological error information must include error type information, clearly marking the category of each error (such as breakpoints, discontinuous line segments, or repeated nodes) and the corresponding unique identifier for subsequent rule generation and positioning.
[0090] By reading the attribute fields in the topology check result file, the spatial coordinates (such as two-dimensional coordinates or three-dimensional coordinates) of each error point or line segment and the associated geometric element number are extracted to ensure that the topological error can be accurately associated with the linear feature vector data.
[0091] Generate topology correction rules based on error type information:
[0092] For breakpoints, rules are generated to automatically connect the endpoints of adjacent line segments, with the connection condition including that the distance between the endpoints is less than the preset tolerance value:
[0093] Based on the extracted breakpoint information, generation rules are used to automatically connect the endpoints of adjacent line segments.
[0094] The conditions include: when the spatial distance between the endpoints of adjacent line segments is less than a preset tolerance value, the endpoints are merged into a single node, and the connection relationship is adjusted to form a continuous line segment.
[0095] If the endpoint direction angle difference exceeds a preset threshold (such as 10 degrees), it is marked as a manual verification point to avoid incorrect connection.
[0096] For discontinuous line segments, the generation rules are used to correct the positions of the start and end points of the line segments so that they coincide with the nodes of the adjacent line segments:
[0097] Based on the start and end point coordinates of the discontinuous line segments, generation rules are used to correct the geometric positions.
[0098] The correction method includes: adjusting the starting point or end point of the discontinuous line segment so that its spatial coordinates completely coincide with the node coordinates of the adjacent line segment, thereby restoring the connection relationship between the line segments.
[0099] If there are multiple possible connections between line segments, the node with the closest distance is selected first.
[0100] For duplicate nodes, the generation rule is used to remove duplicate nodes and keep one unique node:
[0101] Based on the duplicate node information, a rule is generated to delete redundant nodes and retain a unique node.
[0102] Deletion conditions include: the spatial positions of duplicate nodes are the same or their spacing is less than the tolerance value (such as 0.001 meters).
[0103] For the deleted nodes, the geometric connectivity of their related segments is updated, and all the segments related to the node are redirected to the retained nodes.
[0104] Use topology correction rules to perform topology correction on linear feature vector data:
[0105] Adjust the geometric position of the line segment and the node connection relationship according to the topology correction rules:
[0106] For breakpoints: adjust the endpoint coordinates to connect adjacent line segments to form a continuous line segment;
[0107] For discontinuous line segments: adjust the coordinates of the start and end points so that they coincide with the nodes of the adjacent line segments;
[0108] For duplicate nodes: delete redundant nodes and update the line connection relationship related to the retained nodes.
[0109] During the correction process, the topological relationships in the vector data are recalculated, including ensuring that the start and end points of the line segments are correctly connected to adjacent nodes, checking whether breakpoints or duplicate nodes still exist, and ensuring that the geometric continuity of the line segments is not affected by other factors.
[0110] Verify the topologically corrected vector data to ensure that the corrected vector data meets the topological integrity requirements:
[0111] When verifying the correction results, each error type is checked separately and a complete topology report of the corrected vector data is generated, including a comparison of the topological information before and after the correction.
[0112] The linear feature vector data after topological correction is saved as a corrected data file, which contains line segment geometry information, node connection relationship and unique identifier:
[0113] The vector data that has completed topology correction is saved as a corrected data file. The file format can be Shapefile, GeoJSON or other vector data formats that support topological relationships.
[0114] Line segment geometry information: including the coordinates of the start and end points of each line segment;
[0115] Node connection relationship: the relationship between each node and its associated line segment;
[0116] Unique identifier: used to identify each line segment and node for subsequent processing.
[0117] Apply the centerline extraction algorithm to the linear feature vector data after topological correction to generate the centerline of the linear feature, and use the centerline as a guiding element, including:
[0118] Based on the linear feature vector data after topological correction, the geometric center point sequence of each line segment is extracted, and the center point is defined as the midpoint of the line segment:
[0119] In the linear feature vector data after topology correction, all line segments are traversed one by one and the geometric center point of each line segment is calculated.
[0120] The geometric center point is calculated as follows: for a straight line segment, the geometric center point is the midpoint between the start and end points of the segment; for a curved segment, the geometric center point is defined as the centroid of the segment, which is obtained by calculating the weighted average after discrete sampling.
[0121] In the process of center point extraction, in order to ensure geometric accuracy, it is necessary to check whether there are abnormal line segments, such as degenerate line segments with a length of zero. The numbers of these abnormal line segments should be recorded and excluded from the calculation range; the geometric center point of each line segment should be recorded as a center point sequence, and an index structure should be established to match the subsequent line segment connection relationship.
[0122] According to the spatial position of the center point and the connection relationship between the adjacent line segments, a spatial connectivity network of the center point is constructed, where the network nodes are the center points and the edges are the connecting lines of the adjacent center points:
[0123] Determine whether each center point is directly connected to the center point of the adjacent line segment. The connection condition is that the spatial distance between the two points is less than the preset tolerance value; if the distance between the center points exceeds the tolerance value, no connection is established.
[0124] Construct a spatial connectivity network, where the network nodes are geometric center points and the network edges are the connection relationship between adjacent center points. The representation of the spatial connectivity network is an undirected graph structure, where nodes represent center points and edges represent directly connected pairs of center points.
[0125] During the construction process, isolated nodes (central points that are not connected to any other nodes) need to be marked and their influence excluded.
[0126] Based on the spatial connectivity network, the geometric center point sequence is adjusted, redundant nodes are removed and offsets are corrected to generate the initial shape of the center line of the linear feature:
[0127] Determine the starting and ending points of the spatial connectivity network, which are usually the endpoints of linear features.
[0128] When there are multiple possible paths, the path with the shortest geometric length is preferred, while avoiding paths with large curvature changes.
[0129] During the path optimization process, redundant nodes in the center point sequence are removed. For example, the straight line formed by multiple adjacent center points can be replaced by the starting point and the end point. The offset nodes in the path are corrected. The offset correction is based on the geometric linear relationship between adjacent center points. The node position is adjusted to keep it smoothly connected to the overall path.
[0130] Output the optimized initial shape of the centerline to ensure that it is geometrically coherent and consistent with the overall shape of the linear feature.
[0131] Apply a smoothing algorithm to the initial shape of the centerline to adjust the curvature change rate, output the centerline vector data, and mark the centerline vector data as a guide feature:
[0132] The spline interpolation algorithm is used to reconstruct the node positions of the center line so that the curvature change rate of the center line smoothly transitions between adjacent nodes. For parts with large curvature changes, the center line shape is further optimized by adding interpolation points or adjusting the node positions.
[0133] Generate the final vector data of the centerline, record the geometric information (such as node coordinates) and attribute information (such as the unique identifier of the line segment to which it belongs) of the centerline; mark the generated centerline vector data as a guide feature and store it in a vector file format supported by ArcGIS (such as Shapefile or GeoJSON).
[0134] The final generated centerline vector data will be used as the input of the subsequent spot segmentation operation to guide the boundary generation process of the spot.
[0135] The change rate of the local curvature of the centerline is analyzed through multi-scale sampling to evaluate the spatial consistency of the change of the centerline curvature, including:
[0136] Select the sampling range and define the sampling point interval under multiple scales based on the centerline vector data:
[0137] Multi-scale refers to processing the centerline at different zoom ratios, such as data at scales of 1:1000, 1:5000, and 1:10000, with each scale corresponding to a different sampling density.
[0138] The sampling point interval is defined based on the line segment length at each scale, and ensures that the intervals between adjacent sampling points remain uniform. For example, the sampling point interval can be set to 5% of the line segment length.
[0139] Based on the geometric relationship between adjacent sampling points, the curvature change rate of the center line at each scale is calculated segment by segment:
[0140] The curvature change rate between every two adjacent sampling points is calculated. The curvature change rate is defined as the ratio of the change value of the curvature value between adjacent sampling points to the interval between adjacent sampling points.
[0141] The curvature value can be calculated by the following formula: ;in, represents the curvature value, , and Represent the coordinates of three consecutive sampling points respectively.
[0142] Map the curvature change rate at each scale to the spatial position of the center line to generate a spatial distribution model of the curvature change rate:
[0143] The spatial distribution model represents the law of the curvature change rate changing with the spatial position of the center line. The spatial distribution model of the curvature change rate can be expressed as: ;in, The spatial distribution model representing the rate of change of curvature, Indicates The coordinates of the sampling points, Indicates The curvature change rate of the sampling points, and Respectively represent the center line vector data The horizontal and vertical coordinates of the sampling points are Indicates the number of the sampling point. Indicates the number of sampling points.
[0144] The spatial distribution model of the curvature change rate is visualized as a polyline, where the color depth of each point represents the magnitude of the curvature change rate.
[0145] The spatial consistency index of curvature change is calculated based on the spatial distribution model of curvature change rate to evaluate the degree of spatial consistency of centerline curvature change:
[0146] Calculate the spatial consistency index of curvature change, and its expression is: ;in, represents the spatial consistency index of curvature change, represents the variance of the rate of change of curvature, Represents the average value of the curvature change rate.
[0147] The spatial consistency index of curvature change is used to evaluate the spatial consistency of the curvature change of the centerline, that is, to evaluate whether the curvature change of the centerline at different spatial positions is uniform. Specifically, the lower the spatial consistency index of curvature change, the more uniform the curvature change of the centerline in space, that is, the shape of the centerline tends to be smooth and regular, which is suitable for scenes with high precision requirements such as patch segmentation; and the higher the spatial consistency index of curvature change, the uneven distribution of the curvature change of the centerline in space, and there may be local curvature mutations or large fluctuations. This unevenness may cause the centerline to cause boundary discontinuity or reduced precision when guiding patch segmentation, especially at multiple scales, which may further amplify the error in the curvature mutation area, thereby affecting the stability of the patch boundary.
[0148] The tensor flow field is constructed to analyze the centerline offset direction tensor and evaluate the coordination of the offset direction within the adjacent range with the centerline as the core, including:
[0149] Based on the centerline vector data, point sampling is performed in the adjacent space on both sides of the centerline, and the offset vector of each point relative to the centerline is recorded:
[0150] Based on the centerline vector data, define the adjacent spatial range with the centerline as the core. The width of the spatial range can be set to a fixed proportion of the centerline length, such as 5% or 10%, to cover the geometric changes on both sides of the centerline.
[0151] Within the defined adjacent space range, point sampling is performed at fixed intervals. The location of the sampling points is determined by the vertical distance from the center line to ensure that the entire adjacent space range is covered.
[0152] For each sampling point, calculate its offset vector relative to the nearest point on the center line. The offset vector is defined as a combination of direction and magnitude:
[0153] Direction: The direction of the offset vector represents the relative position of the sampling point and the center line, and is calculated as the angle between the vector and the positive direction of the x-axis. ;in, is the direction angle of the offset vector, are the coordinates of the sampling points, are the coordinates of the nearest point on the center line.
[0154] Magnitude: The length of the offset vector, representing the straight-line distance between the sample point and the closest point on the center line: ;in, is the magnitude of the offset vector.
[0155] The offset vector in the adjacent spatial range is converted into a tensor representation. Each tensor is constructed based on the direction and magnitude of the offset vector to generate a tensor flow field covering the adjacent spatial range:
[0156] A tensor is defined for each sampling point. A tensor is a symmetric matrix that describes the characteristics of the offset vector in the primary and secondary directions: ;in, is the tensor representation of the offset vector, Represents the square of the component of the offset vector in the x-axis direction, Represents the square of the component of the offset vector in the y-axis direction, Represents the relative components of the offset vector in the x-axis and y-axis directions.
[0157] in, ; The tensor representation of the offset vector is used to describe the distribution characteristics of the offset direction and amplitude of the sampling point relative to the center line on the major and minor axes.
[0158] The tensor data of all sampling points are organized into a tensor flow field, covering the entire adjacent spatial range; the visualization of the tensor flow field is a tensor grid, in which each tensor is represented by an elliptical pattern, and the major and minor axis directions of the ellipse correspond to the main direction and the minor direction.
[0159] Perform eigenvalue decomposition on each tensor in the tensor flow field, extract the main axis direction and the secondary axis direction, and record the offset direction distribution of the main axis direction and the secondary axis direction in the adjacent space range respectively:
[0160] Perform eigenvalue decomposition on each tensor in the tensor flow field to extract the major axis direction and the minor axis direction. The formula for eigenvalue decomposition is: ;in, and are the eigenvalues corresponding to the major and minor axes respectively.
[0161] The solution of the eigenvalue corresponding to the eigenvector (in the direction of the major axis and the direction of the minor axis) is calculated as follows: , ;in, Representation and The corresponding eigenvector describes the offset characteristics of the tensor in the direction of the principal axis; Representation and The corresponding eigenvector describes the offset characteristics of the tensor in the direction of the minor axis.
[0162] The major axis direction and minor axis direction of each sampling point are recorded separately to construct the offset direction distribution in the adjacent spatial range.
[0163] Based on the offset direction distribution of the main axis direction and the secondary axis direction in the adjacent spatial range, the offset direction synergy index is calculated to quantify the synergy of the offset direction in the adjacent range with the center line as the core:
[0164] The offset direction synergy index is used to quantify the concentration of offset directions within adjacent spatial ranges, and its expression is: ;in, It represents the synergy index of the offset direction, and its value range is from 0 to 1. The closer it is to 1, the stronger the synergy of the offset direction in the adjacent range with the center line as the core; Indicates The principal axis direction angle of the tensor, in radians, represents the angle of deviation from the principal direction; It represents the weighted average of the main axis direction angles, indicating the trend of the overall offset direction; Indicates The principal eigenvalue of the tensor represents the strength in the direction of the principal axis; Indicates The secondary eigenvalue of a tensor represents the perturbation intensity in the secondary axis direction; Indicates the number of tensors corresponding to the sampling.
[0165] in, .
[0166] The smaller the offset direction synergy index is, the weaker the synergy of the offset direction in the adjacent range with the center line as the core is, which means that the change of the offset direction in the adjacent range with the center line as the core is unstable or inconsistent, and the morphology of the local area shows a large change. This usually indicates that the terrain morphology in the area is complex, and there may be factors such as high terrain undulations, geological structure differences or human interference. These factors lead to large differences in the offset directions of adjacent areas, and the offsets of the main axis and the secondary axis are relatively scattered, so that the overall offset direction lacks regularity and synergy, which may also affect the subsequent spatial analysis and modeling, increase the uncertainty of the model, and affect the stability and accuracy of the center line. A low offset direction synergy index may indicate that there is a large spatial heterogeneity in the area, and the guiding ability and coherence of the center line are poor.
[0167] Based on the spatial consistency of the centerline curvature change and the coordination of the offset direction within the adjacent range with the centerline as the core, the segmentation parameters are dynamically adjusted, including:
[0168] The spatial consistency index of curvature change and the synergy index of offset direction are used as input indicators for segmentation parameter adjustment. According to the influence relationship of the input indicators, a weight model is constructed and the influence weight of each input indicator is defined:
[0169] The spatial consistency index of curvature change and the synergy index of offset direction are dimensionless, and a weight model for segmentation parameter adjustment is constructed based on the relative importance of the input indicators. The weight model combines the two input indicators in a linear weighted manner, and the formula is: ;in, It is the output of the weight model, which is used to guide the dynamic adjustment of segmentation parameters; The weight coefficient of the spatial consistency index of curvature change indicates the degree of influence of this index on the adjustment of segmentation parameters; The weight coefficient of the offset direction synergy index indicates the degree of influence of this index on the segmentation parameter adjustment; and Both are greater than 0.
[0170] The weight coefficients of the curvature change spatial consistency index and the offset direction synergy index are set by comprehensively analyzing the segmentation accuracy requirements and regional characteristics. If the regional curvature changes significantly and affects the segmentation accuracy, the weight coefficient of the curvature change spatial consistency index should be increased. Conversely, if the regional offset direction synergy has a greater impact on the segmentation result, the weight of the offset direction synergy index can be increased. The specific weight distribution needs to be adjusted according to the regional complexity and data distribution characteristics.
[0171] Based on the weight model and input indicators, the segmentation parameter adjustment amount is calculated. The segmentation parameter adjustment amount includes the dynamic adjustment value of the spatial offset threshold and the neighborhood radius:
[0172] The segmentation parameters include the spatial offset threshold and the neighborhood radius. The spatial offset threshold is used to control the offset tolerance of the patch boundary relative to the center line, and the neighborhood radius is used to define the local search range when segmenting the patch. The segmentation parameters directly affect the accuracy and stability of the segmentation process.
[0173] The segmentation parameter adjustment is calculated based on the weight model and input index. The adjustment formula of the spatial offset threshold is: ;in, is the dynamically adjusted spatial offset threshold, is the adjustment coefficient of the spatial offset threshold, The initial setting value of the spatial offset threshold.
[0174] The adjustment formula for the neighborhood radius is: ;in, is the neighborhood radius after dynamic adjustment, is the initial setting value of the neighborhood radius, is the adjustment coefficient of the neighborhood radius, and Both are greater than 0.
[0175] Among them, the adjustment coefficient of the spatial offset threshold controls the amplitude of dynamic adjustment of the threshold due to curvature change and offset direction. It is usually a positive value and is used to amplify or reduce the sensitivity of the adjustment. A reasonable range (such as 0.1-0.5) is selected according to the scenario. The adjustment coefficient of the neighborhood radius is used to adjust the sensitivity of the neighborhood range. It is usually a positive value, indicating the degree of influence of curvature change and offset direction on the dynamic change of the neighborhood radius. The typical value range is 0.1-0.3.
[0176] The initial setting value of the spatial offset threshold is the default value for tolerance of offset during the segmentation process. It is usually set according to the data distribution to ensure that it adapts to the offset characteristics of the general area. It is often taken as a fixed ratio or empirical value (such as 5% to 10% of the center line length). The initial setting value of the neighborhood radius defines the default local search range when segmenting the patch. It is usually set according to the area size or segmentation accuracy requirements. The typical value can be 2% to 5% of the center line length to meet the segmentation accuracy.
[0177] when When larger, Increase, Reduced, suitable for areas of high consistency and high synergy; when When smaller, Reduce, Increased to accommodate complex areas of low consistency or low coordination.
[0178] The calculated segmentation parameter adjustment amount is applied to the segmentation parameter update to generate a dynamically adjusted segmentation parameter set:
[0179] Update the segmentation parameter set to generate a dynamically adjusted segmentation parameter set for subsequent segmentation processing: ;in, Represents the dynamically adjusted segmentation parameter set.
[0180] The adjusted segmentation parameters are stored as configurable files or dynamic input data for segmentation algorithm calls, ensuring that subsequent segmentation processing is based on the latest parameter adjustment results.
[0181] The image spots are segmented based on the segmentation parameters and the center line. The segmented image spots are spatially merged based on the geometric adjacency and attribute similarity rules of the image spots. Specifically, the following steps are performed:
[0182] Based on the dynamically adjusted segmentation parameters, the adjacent spatial range is divided by the center line to generate the initial segmentation boundary:
[0183] Use a dynamically adjusted set of segmentation parameters, including spatial offset threshold and neighborhood radius.
[0184] Based on the centerline vector data, the adjacent spatial range is defined, and the range width is determined by the neighborhood radius.
[0185] In the adjacent space, the center line is used as the reference and the boundary position is determined according to the spatial offset threshold. Specific division rule: All points whose offset distance from the center line is less than the spatial offset threshold are classified as an initial segmentation area.
[0186] Generate the initial segmentation boundary, and the result is represented by polygonal vector data, including a set of boundary points for each segmentation area.
[0187] Optimize the initial segmentation boundary based on the boundary smoothness rule between adjacent segmentation regions:
[0188] The initial segmentation boundary generated by input includes the boundary point coordinates of the segmentation area and the adjacent area information.
[0189] The optimization rules are based on boundary smoothness indicators, including:
[0190] Boundary curvature: calculate the curvature of each boundary and smooth out excessive curvature changes;
[0191] Boundary node angle: smooth adjustment of nodes with sharp or obtuse angles in the segmentation boundary;
[0192] Boundary continuity: Ensure that there are no overlaps or breaks in the boundaries of adjacent regions.
[0193] A boundary smoothing algorithm is used to adjust areas with large boundary curvature change rates; a node position adjustment method is used to ensure smooth transition of boundary lines.
[0194] Output the optimized segmentation boundary, and the boundary shape is more regular.
[0195] The geometric features are extracted for each segmented patch, including area, perimeter, shape index and its spatial adjacency relationship with adjacent patches:
[0196] Using the optimized segmentation boundaries, input is polygonal vector data for each patch.
[0197] Area is the total area of a polygon; perimeter is the length of the polygon's border.
[0198] The shape index is expressed as: ;in, is the shape index, is the perimeter of the polygon, is the area of the polygon.
[0199] Spatial adjacency relationship: records the spatial contact length and topological relationship between each patch and its adjacent patches.
[0200] Based on the spatial data inside the patch, the patch attribute features are extracted. The patch attribute features include category information, density distribution and its attribute similarity with neighboring patches:
[0201] Category information: the classification attributes of spatial data within the statistical map;
[0202] Density distribution: calculate the density of point data or grid data within the map;
[0203] Attribute similarity: Calculate the similarity with the attributes of neighboring patches, such as based on Euclidean distance or other similarity metrics.
[0204] According to the geometric adjacency relationship and attribute similarity rules of the patches, the patches that meet the merging conditions are spatially merged to generate the final segmentation result:
[0205] Determine whether the spots meet the merging conditions based on the following rules:
[0206] Geometric rule: two spots are adjacent and their contact length exceeds a preset threshold;
[0207] Attribute rule: The attribute similarity scores of two patches are higher than the preset threshold.
[0208] The spatial merging algorithm is used to merge the patches that meet the conditions, and the geometric and attribute characteristics of the merged patches are recalculated.
[0209] Output the final segmentation result, which includes the merged patch vector dataset and its feature information.
[0210] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters and thresholds in the formula are set by technicians in this field according to actual conditions.
[0211] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented by software, the above embodiments may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or may be transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media sets. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium may be a solid-state hard disk.
[0212] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0213] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and modules described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0214] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0215] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, and may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0216] In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0217] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.
[0218] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0219] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for segmenting and merging linear features based on ArcGIS, characterized in that: The steps include: S1: Obtain linear feature vector data in the ArcGIS platform, perform topological check processing on the linear feature vector data, and identify and obtain topological error information; S2: Generate topology correction rules based on topology error information, and use the topology correction rules to perform topology correction on linear feature vector data with breakpoints and discontinuities; S3: Apply the centerline extraction algorithm to the linear feature vector data after topological correction to generate the centerline of the linear feature, and use the centerline as a guiding element; S4: Before the image segmentation, the local curvature change rate of the centerline is analyzed through multi-scale sampling to evaluate the spatial consistency of the centerline curvature change, including: Select the sampling range and define the sampling point interval under multiple scales based on the centerline vector data; Based on the geometric relationship between adjacent sampling points, the curvature change rate of the center line at each scale is calculated segment by segment; The curvature change rate at each scale is mapped to the spatial position of the center line to generate a spatial distribution model of the curvature change rate; The spatial consistency index of curvature change is calculated based on the spatial distribution model of curvature change rate to evaluate the degree of spatial consistency of the centerline curvature change; The expression of the spatial consistency index of curvature change is: ;in, represents the spatial consistency index of curvature change, represents the variance of the rate of change of curvature, represents the average value of the curvature change rate; The tensor flow field is constructed to analyze the centerline offset direction tensor and evaluate the coordination of the offset direction within the adjacent range with the centerline as the core, including: Based on the centerline vector data, point sampling is performed in the adjacent space range on both sides of the centerline, and the offset vector of each point relative to the centerline is recorded; The offset vector in the adjacent spatial range is converted into a tensor representation, each tensor is constructed based on the direction and magnitude of the offset vector, and a tensor flow field covering the adjacent spatial range is generated; Perform eigenvalue decomposition on each tensor in the tensor flow field, extract the main axis direction and the secondary axis direction, and record the offset direction distribution of the main axis direction and the secondary axis direction in the adjacent space range respectively; Based on the offset direction distribution of the main axis direction and the secondary axis direction in the adjacent spatial range, the offset direction synergy index is calculated to quantify the synergy of the offset direction in the adjacent range with the center line as the core; The expression of the offset direction synergy index is: ;in, represents the offset direction synergy index, Indicates The principal axis direction angles of the tensor, represents the weighted average of the main axis direction angles, Indicates The principal eigenvalue of a tensor, Indicates The secondary eigenvalues of a tensor, Indicates the number of tensors corresponding to the sampling; S5: Based on the spatial consistency of the centerline curvature change and the coordination of the offset direction within the adjacent range with the centerline as the core, the segmentation parameters are dynamically adjusted, including: The spatial consistency index of curvature change and the synergy index of offset direction are used as input indicators for segmentation parameter adjustment. According to the influence relationship of the input indicators, a weight model is constructed and the influence weight of each input indicator is defined. Based on the weight model and the input index, the segmentation parameter adjustment amount is calculated, and the segmentation parameter adjustment amount includes a dynamic adjustment value of a spatial offset threshold and a neighborhood radius; Applying the calculated segmentation parameter adjustment amount to segmentation parameter update to generate a dynamically adjusted segmentation parameter set; S6: Performing spot segmentation based on the segmentation parameters and the center line as a guide, and performing spatial merging of the segmented spots based on the geometric adjacent relationship and attribute similarity rules of the spots, including: Based on the dynamically adjusted segmentation parameters, the adjacent space range is divided into regions through the center line to generate the initial segmentation boundary; Optimize the initial segmentation boundary based on the boundary smoothness rule between adjacent segmentation regions; Extract geometric features from each segmented patch, including area, perimeter, shape index and its spatial adjacency relationship with adjacent patches; Extracting the patch attribute features based on the spatial data inside the patch, the patch attribute features include category information, density distribution and its attribute similarity with neighboring patches; According to the geometric adjacency relationship and attribute similarity rules of the patches, the patches that meet the merging conditions are spatially merged to generate the final segmentation result.
2. The method for segmenting and merging linear features based on ArcGIS according to claim 1, characterized in that: Obtain linear feature vector data in the ArcGIS platform, perform topological check processing on the linear feature vector data, and identify topological error information, including: Load the vector data file of the linear feature in the ArcGIS platform. The vector data file contains vector data describing the geometric shape and topological relationship of the linear feature. Use the topology check tool in ArcGIS platform to check the topological integrity of vector data, including the detection of breakpoints, discontinuous segments and duplicate nodes; Generate a topology check result file, which contains the location information and error type information of the topology error.
3. The method for segmenting and merging linear features based on ArcGIS according to claim 2, characterized in that: Generate topology correction rules based on topology error information, and use topology correction rules to perform topology correction on linear feature vector data with breakpoints and discontinuities, including: Based on the topological error information in the topological check result file, the location information of the breakpoints, discontinuous line segments and repeated nodes and the error type information are extracted; Generate topology correction rules based on error type information: For breakpoints, the generated rules are used to automatically connect the endpoints of adjacent line segments, and the connection conditions include that the distance between the endpoints is less than the preset tolerance value; For discontinuous line segments, the generation rules are used to correct the positions of the start and end points of the line segments so that they coincide with the nodes of the adjacent line segments; For duplicate nodes, the generation rules are used to remove duplicate nodes and retain a unique node; Use topology correction rules to perform topology correction on linear feature vector data: adjust the geometric position of line segments and node connection relationships according to topology correction rules; verify the topology-corrected vector data to ensure that the corrected vector data meets the topology integrity requirements; The linear feature vector data after topological correction is saved as a corrected data file, which contains line segment geometry information, node connection relationship and unique identifier.
4. The method for segmenting and merging linear features based on ArcGIS according to claim 3, characterized in that: Apply the centerline extraction algorithm to the linear feature vector data after topological correction to generate the centerline of the linear feature, and use the centerline as a guiding element, including: Based on the linear feature vector data after topological correction, the geometric center point sequence of each line segment is extracted, and the center point is defined as the midpoint of the line segment; According to the spatial position of the center point and the connection relationship between the adjacent line segments, a spatial connectivity network of the center point is constructed, where the network nodes are the center points and the edges are the connecting lines of the adjacent center points. Based on the spatial connectivity network, the geometric center point sequence is adjusted, redundant nodes are removed and offsets are corrected to generate the initial shape of the center line of the linear feature; A smoothing algorithm is applied to the initial shape of the centerline to adjust the curvature change rate, output the centerline vector data, and mark the centerline vector data as a guide feature.
Citation Information
Patent Citations
Improved large-range road center line block extraction algorithm
CN114049327A
ES database pattern spot object chain type tracking method for territorial investigation
CN114972440A