A processing method for intercepting conventional narrow and long
By adopting a processing method based on opposite information interception in the GIS system, the narrow and long parts of the map spot are automatically detected and cut, and the problem of difficult to identify and crop complex narrow and long areas in the prior art is solved, and more accurate data analysis and area calculation are achieved.
Patent Information
- Application Number
- CN202510128654.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-05
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2045-02-05
AI Technical Summary
The prior art is difficult to effectively identify and crop complex and narrow areas in GIS systems, especially dumbbell-type and multi-section narrow and long pattern patterns, resulting in inaccurate data analysis errors and area calculations.
Using a processing method based on opposite information interception, by obtaining the droop point information and droop point information of all line segments of the target map spot, a collection of line segments of the narrow and long area is constructed, and the narrow and long parts of the map spot are automatically detected and cut.
It realizes automatic identification and cropping of complex pattern spots, improves the accuracy of data analysis and the accuracy of area calculation, and is suitable for various geographic graphics processing in GIS systems.
Smart Images

Figure CN119579622B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of geographic information system graphics processing, and in particular to a processing method for intercepting conventional narrow and long sections based on opposite direction information. Background Art
[0002] In the process of processing land graphics in the Geographic Information System (GIS), narrow and long spots often appear, such as exposed type, dumbbell type, multi-segment narrow and long type, and single-point opening type. Narrow and long areas may lead to data analysis errors and inaccurate area calculations, affecting subsequent land use planning and management, and it is necessary to crop and segment the narrow and long areas of the spots. The existing technology for processing narrow and long areas of spots is relatively simple, and it is impossible to effectively identify and crop complex narrow and long areas, especially dumbbell-shaped and multi-segment narrow and long spots. Summary of the invention
[0003] The purpose of the present invention is to: in view of the shortcomings of the above-mentioned prior art, propose a processing method for intercepting regular narrow and long areas based on opposite direction information, intercepting regular narrow and long areas based on opposite direction information, and automatically detecting and cropping the narrow and long parts of the pattern to solve the problems in the background technology.
[0004] The technical solution adopted by the present invention is as follows:
[0005] The present invention is a processing method for intercepting a conventional narrow and long image based on opposite information, comprising the following steps:
[0006] S1, obtaining the vertical point information and vertical point information of all line segments of the target image patch, determining the line segments with two or more vertical points or vertical points as valid line segments, and adding the valid line segments into the valid line segment set;
[0007] S2, integrating the valid line segment sets, searching for the opposite line segments of the current line segment in turn, and constructing the current line segment set and the opposite line segment set of one or more narrow and long areas;
[0008] S3, judging the narrow type of the target image patch as an exposed type, a dumbbell type or a multi-segment narrow type according to the current line segment set and the opposite line segment set of each narrow area;
[0009] S4, traversing the current line segment set and the opposite line segment set of the narrow and long area, setting the clipping start point and clipping end point of the target image spot, and constructing the clipping line of the narrow and long area of the target image spot;
[0010] S5, according to the narrow and long type of the target image patch and its clipping line, a clipping operation is performed, and an intersection determination is performed to verify the clipping effect.
[0011] Furthermore, in S1, the vertical point information and the vertical point information of all line segments of the target pattern are obtained, specifically:
[0012] Decompose the boundary line of the target patch, obtain the starting point and end point of all line segments, and use the outer loop and inner loop to nest two loops to index the line segments in turn. Specifically:
[0013] The outer loop starts indexing from the line segment numbered 0, and the inner loop is separated from the outer loop by one line segment. The outer loop and the inner loop index simultaneously. When the XY coordinates of the start and end points of the line segment indexed by the inner loop are simultaneously less than or greater than the XY coordinates of the start and end points of the line segment indexed by the outer loop, the current line segment index is skipped, and the inner and outer loops continue to index the line segments downward until the last line segment.
[0014] Furthermore, the outer loop and the inner loop are nested to index the line segments in turn, obtain the vertical point information and the vertical point information of the line segments, and determine the line segments with two or more vertical points or vertical points as valid line segments, and include the valid line segments in the subsequent valid line segment set for forming the narrow and long area.
[0015] The vertical point information includes taking the starting point and the end point of the line segment as vertical points respectively. If the vertical point is on the opposite line segment, then the starting point and the end point and their vertical point and the opposite line segment index are all vertical point information;
[0016] The perpendicular point information includes the perpendicular point on the line segment and the source of the perpendicular point, that is, the starting point and / or end point of the opposite line segment and the opposite line segment index.
[0017] Furthermore, in S2, the valid line segment sets are integrated, and the opposite line segments of the current line segment are searched in sequence to construct the current line segment set and the opposite line segment set of one or more narrow and long areas. Specifically:
[0018] S21, sort the line segments in the valid line segment set from small to large according to the line segment index sequence number, traverse all the line segments in the valid line segment set, and remove the invalid line segment with an index of -1 from the vertical point information and the vertical point information of each line segment;
[0019] S22, starting from the first line segment as the current line segment, searching for the opposite line segment of the current line segment in sequence, if the index numbers of the current line segment and the next line segment are continuous and there is an opposite line segment, then storing them in the current line segment set and the opposite line segment set of the same narrow and long area respectively;
[0020] If the index numbers of the current line segment and the next line segment are not continuous, then determine whether the next line segment already exists in the opposite line segment set of the narrow and long area where the current line segment is located, or is connected to the line segment in the opposite line segment set. If so, stop searching, and if the next line segment is connected to the line segment in the opposite line segment set, add it to the opposite line segment set; if not, split the current line segment and the next line segment, and store the next line segment and its opposite line segment in the current line segment set and the opposite line segment set of the next narrow and long area respectively, until the end of the line segment;
[0021] If the tail line segment is a valid line segment and is connected to the first line segment in the current line segment set of the first narrow area, the tail line segment is merged into the current line segment set of the first narrow area and made the first line segment of the current line segment set of the narrow area to form a closed loop.
[0022] Furthermore, in S3, the narrow type of the target pattern is determined to be an exposed type, a dumbbell type, or a multi-segment narrow type according to the current line segment set and the opposite line segment set of each narrow area, specifically:
[0023] The current line segment set and the line segments in the opposite line segment set of each narrow and long area are looped in turn, and the narrow and long type of the target pattern is determined according to the first line segment, the last line segment in the current line segment set and the corresponding opposite line segment sequence number in the opposite line segment set. Specifically:
[0024] The current line segment index number and the opposite line segment index number are incremented by 1, and the narrow and long type of the target pattern is determined to be an exposed type;
[0025] The current line segment index sequence is the maximum sequence number, 0, and 1 in turn, and the narrow and long type of the target pattern is determined to be an exposed type;
[0026] The current line segment index sequence is the maximum sequence number -1, the maximum sequence number, and 0, and the narrow and long type of the target pattern is determined to be an exposed type;
[0027] If none of the above conditions are met, the target pattern is judged to be a dumbbell-shaped or multi-segmented narrow and long type.
[0028] Furthermore, in S4, the current line segment set and the opposite line segment set of the narrow and long area are traversed, the clipping start point and clipping end point of the target image spot are set, and the clipping line of the narrow and long area of the target image spot is constructed. The specific steps are:
[0029] S41, traversing the current line segment set and the opposite line segment set of all narrow and long areas, for the first line segment in the current line segment set, if there is a vertical point from the starting point of the first line segment, the starting point of the first line segment is set as the clipping starting point, otherwise, the last vertical point on the first line segment is set as the clipping starting point;
[0030] S42, for the tail segment in the current segment set, if there is a vertical point at the end point of the tail segment, set the end point of the tail segment as the clipping end point, otherwise, set the first vertical point on the tail segment as the clipping end point;
[0031] S43, according to the current line segment set and the opposite line segment set of each narrow and long area, obtain the clipping start point and clipping end point of the narrow and long area of the target image spot, and construct the clipping line of the narrow and long area.
[0032] Furthermore, in S5, a clipping operation is performed according to the narrow and long type of the target image spot and its clipping line, and the clipping process is:
[0033] If the target image patch is of the exposed type, it has a clipping line and can be clipped directly;
[0034] If the target image patch is of dumbbell type, there are two clipping lines, which are used for clipping respectively;
[0035] When clipping, determine whether the clipping line intersects with the clipped target plot graphics, perform intersection determination through the GIS platform interface, and verify the clipping effect.
[0036] Furthermore, in S5, intersection determination is performed through the GIS platform interface to verify the clipping effect, specifically: intersection determination is performed using the interface provided by the ArcGIS software. After clipping, if the graphic area of the target plot meets the preset tolerance area, the clipping is determined to be successful. If the error after clipping exceeds the preset tolerance area, the clipping line position is readjusted and clipping is performed again.
[0037] Furthermore, after clipping, the clipped target plot graphics are merged or broken up according to business needs and saved again. Specifically:
[0038] The narrow and long area of the target plot is exposed, and the cropped target plot graphic is merged with other adjacent graphics;
[0039] The narrow area of the target plot is dumbbell-shaped. The two target plots after clipping must be scattered and independent, and assigned attributes.
[0040] In summary, due to the adoption of this technical solution, the beneficial effects of the present invention are:
[0041] The present invention is a processing method for intercepting conventional narrow and long patterns based on opposite direction information. In the process of processing the target pattern, the vertical point information and the vertical point information of the starting point and the end point of the line segment are obtained, a line segment set in the narrow and long area is constructed, and a clipping line is finally generated to realize automatic recognition and clipping of complex patterns.
[0042] The present invention is a processing method for intercepting conventional narrow and long areas based on opposite information, and provides an efficient graphics processing method. It can automatically identify and crop narrow and long areas in two-dimensional image patches, and is particularly suitable for processing various land type graphics in GIS systems, especially exposed type, dumbbell type and multi-segment narrow and long types, and has important practical value and broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present invention and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work. The proportional relationship of each component in the drawings of this specification does not represent the proportional relationship in actual material selection and design, which is only a schematic diagram of the structure or position, where:
[0044] Figure 1 is a flow chart of a method according to an embodiment of the present invention;
[0045] Figure 2a , Figure 2b They are schematic diagrams of exposed narrow strips before and after cutting;
[0046] Figure 3a , Figure 3b They are schematic diagrams of dumbbell-shaped narrow strips before and after cutting;
[0047] Figure 4a , Figure 4b They are schematic diagrams of multi-segment long and narrow cutting before and after cutting;
[0048] Figure 5 are two cyclic orientation graphs;
[0049] Figure 6 is a schematic diagram of the vertical point of line segment A;
[0050] Figure 7 is a schematic diagram of the perpendicular point of line segment A;
[0051] Figure 8 This is a schematic diagram of the exposed and long and narrow index. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention, that is, the embodiments described are only part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations.
[0053] It should be noted that the terms "comprises", "includes" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or apparatus that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or apparatus.
[0054] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present invention.
[0055] All features disclosed in this specification, or steps in all methods or processes disclosed, except mutually exclusive features and / or steps, can be combined in any manner.
[0056] The present invention will be described in detail below in conjunction with the accompanying drawings.
[0057] The specific implementation example is as follows:
[0058] like Figure 1 As shown, the present invention is a processing method for intercepting a conventional narrow and long image based on opposite information, comprising the following steps:
[0059] S1, obtaining the vertical point information and vertical point information of all line segments of the target image patch, determining the line segments with two or more vertical points or vertical points as valid line segments, and adding the valid line segments into the valid line segment set;
[0060] Decompose the boundary line of the target patch, obtain the starting point and end point of all line segments, and use the outer loop and inner loop to nest two loops to index the line segments in turn. Specifically:
[0061] In this embodiment, if Figure 5As shown, taking the exposed pattern as an example, the outer loop starts indexing from the line segment numbered 0, and the inner loop starts indexing from the line segment numbered 2. The outer loop and the inner loop are performed in a clockwise direction, and the outer loop and the inner loop are indexed at the same time. When the XY coordinates of the start and end points of the line segment indexed by the inner loop are simultaneously less than or greater than the XY coordinates of the start and end points of the line segment indexed by the outer loop, the current line segment index is skipped, and the inner and outer loops continue to index the line segments downward until the last line segment.
[0062] The line segments obtained from the target pattern are indexed from the line segment number 0 by default; two loops are used to obtain the vertical point information and the vertical point information of all line segments. The inner loop and the outer loop are separated by 1 line segment index in order to obtain the relative position information. The interval between two line segments can determine whether they form a narrow and long area, rather than using two adjacent line segments to determine whether they form a narrow and long area. This is not true. Figure 5 As shown, outer loop.
[0063] The outer loop and the inner loop are nested to index the line segments in turn, obtain the vertical point information and the vertical point information of the line segments, and determine the line segments with two or more vertical points or vertical points as valid line segments. The valid line segments are included in the valid line segment set for the subsequent narrow and long area. The valid line segments have 1 vertical point and 1 vertical point, or two vertical points, or both vertical points are determined to be valid line segments. The valid line segment set is the set of all line segments that meet the narrow and long distance range.
[0064] The vertical point information includes taking the starting point and the end point of the line segment as vertical points respectively. If the vertical point is on the opposite line segment, then the starting point and the end point and their vertical point and the opposite line segment index are all vertical point information;
[0065] The perpendicular point information includes the perpendicular point on the line segment, and the source of the perpendicular point, that is, the starting point and / or end point of the opposite line segment, and the opposite line segment index. The perpendicular point is: the perpendicular point made from the starting point or end point of the opposite line segment falls on the line segment.
[0066] The complete vertical point information of a line segment includes the corresponding vertical points of the starting point and the end point. If the vertical point is on the opposite line segment, then the starting point or end point and its vertical point and the opposite line segment index will be retained in the vertical point information set (cdinfos) of this line segment.
[0067] If there is a perpendicular point on this line segment, the source of this perpendicular point is the starting point or end point of the opposite line segment, including the opposite line segment index, which is also recorded in the perpendicular point information set (bcdinfos) of this line segment;
[0068] In the vertical point information set of the line segment and the vertical point information set, the line segment index corresponding to the vertical point is initialized to -1, that is, it does not exist, so that it is convenient to exclude it later. Figure 6 As shown, in Figure 6 In the figure, the current line segment A has a starting point A and an end point A. Starting from the starting point A, a perpendicular point is made on the opposite line segment to obtain the perpendicular point corresponding to the starting point A. Starting from the end point A, a perpendicular point is made on the opposite line segment to obtain the perpendicular point corresponding to the end point A. Therefore, the perpendicular point information of the current line segment A includes the starting point A and its corresponding perpendicular point, the end point A and its corresponding perpendicular point, and the opposite line segment index.
[0069] The perpendicular point is expressed as Figure 7 As shown, starting from the B starting point of the opposite line segment B, a perpendicular point is made on the current line segment A, which is the perpendicular point on the current line segment A. Similarly, starting from the B end point of the opposite line segment B, a perpendicular point is made on the current line segment A, which is the perpendicular point on the current line segment A. Therefore, the perpendicular point information of the current line segment A includes the index of the opposite line segment B, the starting point of B and its corresponding perpendicular point on the current line segment A, the end point of B and its corresponding perpendicular point on the current line segment A.
[0070] S2, integrating the valid line segment sets, searching for the opposite line segments of the current line segment in turn, and constructing the current line segment set and the opposite line segment set of one or more narrow and long areas;
[0071] S21, sort the line segments in the valid line segment set from small to large according to the line segment index sequence number, traverse all the line segments in the valid line segment set, and remove the invalid line segment with an index of -1 from the vertical point information and the vertical point information of each line segment;
[0072] S22, starting from the first line segment as the current line segment, searching for the opposite line segment of the current line segment in sequence, if the index numbers of the current line segment and the next line segment are continuous and there is an opposite line segment, then storing them in the current line segment set and the opposite line segment set of the same narrow and long area respectively;
[0073] If the index numbers of the current line segment and the next line segment are not continuous, then determine whether the next line segment already exists in the opposite line segment set of the narrow and long area where the current line segment is located, or is connected to the line segment in the opposite line segment set. If so, stop searching, and if the next line segment is connected to the line segment in the opposite line segment set, add it to the opposite line segment set; if not, split the current line segment and the next line segment, and store the next line segment and its opposite line segment in the current line segment set and the opposite line segment set of the next narrow and long area respectively, until the end of the line segment;
[0074] If the tail line segment is a valid line segment and is connected to the first line segment in the current line segment set of the first narrow and long area, the tail line segment is merged into the current line segment set of the first narrow and long area and is used as the first line segment of the current line segment set of the narrow and long area to form a closed loop. Step 22 of the present invention starts searching from the line segment with index number 0 in the valid line segment set, and the relationship between the last valid line segment and the first valid line segment needs to be determined.
[0075] According to the operation of step 2, starting from the first line segment, if the current line segment and the next line segment have continuous serial numbers until the end line segment, then you only need to construct a current line segment set and an opposite line segment set for a narrow and long area; if the current line segment and the next line segment have discontinuous serial numbers, and do not exist in the opposite line segment set of the narrow and long area where the current line segment is located, and are not connected to the line segments in the opposite line segment set, then split the current line segment and the next line segment, create a new narrow and long area, store the next line segment with discontinuous serial numbers and its opposite line segment in the current line segment set and the opposite line segment set of the newly created narrow and long area, respectively, and use them as the first line segment in the current line segment set of the newly created narrow and long area, and continue to judge the next line segment until the end line segment.
[0076] According to the above step 2, the current line segment set and the opposite line segment set required for the multiple narrow and long areas are obtained respectively, because the narrow and long type of the target pattern may be a multi-segment narrow and long type.
[0077] S3, judging the narrow type of the target image patch as an exposed type, a dumbbell type or a multi-segment narrow type according to the current line segment set and the opposite line segment set of each narrow area;
[0078] This embodiment adopts a clockwise loop to loop the current line segment set and the line segments in the opposite line segment set of each narrow and long area in turn, and judges whether it is the narrow and long type of the target pattern according to the first line segment, the last line segment in the current line segment set and the corresponding opposite line segment sequence number in the opposite line segment set. Specifically:
[0079] The current line segment index number and the opposite line segment index number are incremented by 1, and the narrow and long type of the target pattern is determined to be an exposed type;
[0080] The current line segment index number is the largest number ( Figure 8 maxIndex), 0, 1, the target image patch is judged to be of the exposed type;
[0081] The current line segment index number is the maximum number - 1 ( Figure 8 maxIndex-1), the maximum sequence number ( Figure 8 maxIndex), 0, the target image patch is judged to be of the exposed type;
[0082] The indexes for judging the above three types of exposed patterns are as follows: Figure 8If none of the above conditions are met, the target pattern is judged to be a dumbbell or multi-segment narrow and long type. The multi-segment narrow and long type is just a repetition of the dumbbell type. Figure 2a As shown, including the target plot and the outcropping location, the dumbbell type is as follows Figure 3a As shown, including target plot a, target plot b and narrow and long positions, multiple narrow and long types are as follows Figure 4a As shown, it includes target plot c, target plot d and multiple narrow sections.
[0083] S4, traversing the current line segment set and the opposite line segment set of the narrow and long area, setting the clipping start point and clipping end point of the target image spot, and constructing the clipping line of the narrow and long area of the target image spot;
[0084] S41, traversing the current line segment set and the opposite line segment set of all narrow and long areas, for the first line segment in the current line segment set, if there is a vertical point from the starting point of the first line segment, the starting point of the first line segment is set as the clipping starting point, otherwise, the last vertical point on the first line segment is set as the clipping starting point;
[0085] S42, for the tail segment in the current segment set, if there is a vertical point at the end point of the tail segment, set the end point of the tail segment as the clipping end point, otherwise, set the first vertical point on the tail segment as the clipping end point;
[0086] S43, according to the current line segment set and the opposite line segment set of each narrow and long area, obtain the clipping start point and clipping end point of the narrow and long area of the target image spot, and construct the clipping line of the narrow and long area.
[0087] Specific construction process of the clipping line: for the first line segment in the current line segment set of the current narrow area, if the starting point of the first line segment is effectively vertical or its perpendicular point set has data, that is, there is a perpendicular point, then take the last perpendicular point in its perpendicular point set as the point to be selected, and start selecting and setting from the starting point. If the starting point is valid, take the starting point as the clipping starting point first, otherwise take this perpendicular point as the clipping starting point; for the tail line segment of the current line segment set, if the end point of the tail line segment is effectively vertical or its perpendicular point set has data, that is, there is a perpendicular point, then take the first perpendicular point in its perpendicular point set as the point to be selected, and start selecting and setting from the end point. If the end point is valid, select the end point as the clipping end point first, otherwise take this perpendicular point as the clipping end point. At this point, the clipping line is constructed according to the clipping starting point and clipping end point; then start to loop over the next narrow area to construct the clipping line of the narrow area. In this embodiment, the starting point of the first line segment is effectively vertical, that is, starting from the starting point of the first line segment, its vertical point is on the opposite line segment, and the end point of the last line segment is effectively vertical, that is, starting from the end point of the last line segment, its vertical point is on the opposite line segment.
[0088] S5, according to the narrow and long type of the target image patch and its clipping line, a clipping operation is performed, and an intersection determination is performed to verify the clipping effect.
[0089] The cutting process is:
[0090] If the target image is of the exposed type, it has a clipping line and can be clipped directly. Figure 2a As shown, including the target plot and the exposed position, the clipping position is Figure 2a The middle arrow indicates that the exposed pattern is cut out as follows Figure 2b As shown, there is only 1 target plot;
[0091] If the target image patch is a dumbbell-shaped narrow patch, there are two clipping lines, which are clipped separately. Figure 3a As shown, it includes target plot a, target plot b and narrow and long position, and its clipping position is Figure 3a The middle arrow indicates that the dumbbell-shaped pattern is cut out as follows Figure 3b As shown, there are two target plots, namely target plot a and target plot b;
[0092] In this implementation, if Figure 4a The figure shows a schematic diagram of a multi-segment narrow and long pattern before cutting, including a target plot c, a target plot d and a multi-segment narrow and long pattern. The multi-segment narrow and long pattern has two cutting lines. Figure 4b As shown, there are target plot c and target plot d.
[0093] When clipping, determine whether the clipping line intersects with the clipped target plot graphics, perform intersection determination through the GIS platform interface, and verify the clipping effect.
[0094] The intersection determination and the verification of the clipping effect are performed through the GIS platform interface, specifically:
[0095] The interface provided by ArcGIS software is used for intersection determination. In this embodiment, the tolerance area is set to 5 square meters. After cropping, the graphic area of the target plot meets the preset tolerance area of 5 square meters, which means that the cropping is successful. When the error after cropping exceeds the preset tolerance area of 5 square meters, the cropping line position is readjusted and cropping is performed again.
[0096] According to business needs, merge or break up the clipped target plot graphics and save them again. Specifically:
[0097] The narrow and long area of the target plot is exposed, and the cropped target plot graphic is merged with other adjacent graphics;
[0098] The narrow area of the target plot is dumbbell-shaped. The two target plots after clipping must be scattered and independent, and assigned attributes.
[0099] At this point, all operations of narrow and long cropping of the image spots by the method of the present invention are completed, and cropping is achieved.
[0100] For the common narrow spots of GIS vectors, they are divided into exposed type, dumbbell type, multi-segment narrow and long type, and single-point opening type, but the most common ones are the first three, and for the dumbbell type, there are multiple narrow and long situations. Therefore, the present invention constructs a new way to detect and intercept the narrow and long areas in the two-dimensional spots for the exposed type, dumbbell type, and multi-segment narrow and long spots. The effect of clipping the narrow spots according to this method is good, and the accuracy and standardization of land type graphic data are improved, and the land type interpretation errors caused by narrow and long areas are avoided. For example, there are 97 erroneous spot data in a certain area, and 68 of the first three types of narrow and long spots are included. 68 spots are narrow and long and can be processed, while the remaining parts are single-point narrow and long and abnormal multi-faceted. The processing method of the single-point narrow and long is to pull it out of the tolerance according to the vertical point in the opposite direction, and then update the current and adjacent areas. The method of the present invention is mainly used to process the narrow spots of exposed type, dumbbell type and multi-segment narrow and long types.
[0101] The above is only a preferred embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be thought of by a person skilled in the art within the technical scope disclosed by the present invention without creative work should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope defined in the claims.
Claims
1. A method for intercepting conventional narrow and long lines based on opposite information, characterized in that: The following steps are involved: S1, obtaining the vertical point information and vertical point information of all line segments of the target image spot, determining the line segments with two or more vertical points or vertical points as valid line segments, and adding the valid line segments into the valid line segment set; In step S1, the vertical point information and vertical point information of all line segments of the target pattern are obtained, specifically: Decompose the boundary line of the target patch, obtain the starting and ending points of all line segments, and use the outer loop and inner loop to nest two loops to index the line segments in turn. Specifically: The outer loop starts indexing from the line segment with sequence number 0, and the inner loop is separated from the outer loop by 1 line segment. The outer loop and the inner loop index simultaneously. When the XY coordinates of the start and end points of the line segment indexed by the inner loop are both smaller than or larger than the XY coordinates of the start and end points of the line segment indexed by the outer loop, the current line segment index is skipped, and the inner and outer loops continue to index the line segments downward until the last line segment. The outer loop and the inner loop are nested to index the line segments in turn, obtain the vertical point information and the vertical point information of the line segments, and determine the line segments with two or more vertical points or vertical points as valid line segments, and include the valid line segments in the subsequent valid line segment set for forming the narrow and long area; The vertical point information includes taking the starting point and the end point of the line segment as the vertical point. If the vertical point is on the opposite line segment, then the starting point and the end point and their vertical point and the opposite line segment index are all vertical point information. The perpendicular point information includes the perpendicular point on the line segment, and the source of the perpendicular point, that is, the starting point and / or end point of the opposite line segment, and the opposite line segment index; S2, integrating the valid line segment sets, searching for the opposite line segments of the current line segment in turn, and constructing the current line segment set and the opposite line segment set of one or more narrow and long areas; Specific: S21, sort the line segments in the valid line segment set from small to large according to the line segment index sequence number, traverse all the line segments in the valid line segment set, and remove the invalid line segment with an index of -1 from the vertical point information and the vertical point information of each line segment; S22, starting from the first line segment as the current line segment, searching for the opposite line segment of the current line segment in sequence, if the index numbers of the current line segment and the next line segment are continuous and there is an opposite line segment, then storing them in the current line segment set and the opposite line segment set of the same narrow and long area respectively; If the index numbers of the current line segment and the next line segment are not continuous, then determine whether the next line segment already exists in the opposite line segment set of the narrow and long area where the current line segment is located, or is connected to the line segment in the opposite line segment set. If so, stop searching, and if the next line segment is connected to the line segment in the opposite line segment set, add it to the opposite line segment set; if not, split the current line segment and the next line segment, and store the next line segment and its opposite line segment in the current line segment set and the opposite line segment set of the next narrow and long area respectively, until the end of the line segment; If the tail line segment is a valid line segment and is connected to the first line segment in the current line segment set of the first narrow area, the tail line segment is merged into the current line segment set of the first narrow area and is made the first line segment of the current line segment set of the narrow area to form a closed loop; S3, judging the narrow type of the target image patch as an exposed type, a dumbbell type or a multi-segment narrow type according to the current line segment set and the opposite line segment set of each narrow area; Specifically: The current line segment set and the line segments in the opposite line segment set of each narrow and long area are looped in turn, and the narrow and long type of the target pattern is determined according to the first line segment, the last line segment in the current line segment set and the corresponding opposite line segment sequence number in the opposite line segment set. Specifically: The current line segment index number and the opposite line segment index number are incremented by 1, and the narrow and long type of the target pattern is determined to be an exposed type; The current line segment index sequence is the maximum sequence number, 0, and 1 in turn, and the narrow and long type of the target pattern is determined to be an exposed type; The current line segment index sequence is the maximum sequence number -1, the maximum sequence number, and 0, and the narrow and long type of the target pattern is determined to be an exposed type; If none of the above conditions are met, the target pattern is judged to be a dumbbell-shaped or multi-segmented narrow and long type; S4, traversing the current line segment set and the opposite line segment set of the narrow and long area, setting the clipping start point and clipping end point of the target image spot, and constructing the clipping line of the narrow and long area of the target image spot; The specific steps are: S41, traversing the current line segment set and the opposite line segment set of all narrow and long areas, for the first line segment in the current line segment set, if there is a vertical point from the starting point of the first line segment, the starting point of the first line segment is set as the clipping starting point, otherwise, the last vertical point on the first line segment is set as the clipping starting point; S42, for the tail segment in the current segment set, if there is a vertical point at the end point of the tail segment, set the end point of the tail segment as the clipping end point, otherwise, set the first vertical point on the tail segment as the clipping end point; S43, obtaining a clipping start point and a clipping end point of the target long and narrow area according to the current line segment set and the opposite line segment set of each long and narrow area, and constructing a clipping line of the long and narrow area; S5, according to the narrow and long type of the target image patch and its clipping line, a clipping operation is performed, and an intersection determination is performed to verify the clipping effect.
2. A method for intercepting a conventional narrow and long image based on opposite direction information according to claim 1, characterized in that: In step S5, a clipping operation is performed according to the narrow and long type of the target image spot and its clipping line. The clipping process is as follows: If the target image patch is of the exposed type, it has a clipping line and can be clipped directly; If the target image patch is of dumbbell type, there are two clipping lines, which are used for clipping respectively; When clipping, determine whether the clipping line intersects with the clipped target plot graphics, perform intersection determination through the GIS platform interface, and verify the clipping effect.
3. A method for intercepting a conventional narrow and long image based on opposite direction information according to claim 2, characterized in that: In step S5, intersection determination is performed through the GIS platform interface to verify the clipping effect, specifically: intersection determination is performed using the interface provided by the ArcGIS software. After clipping, if the graphic area of the target plot meets the preset tolerance area, the clipping is determined to be successful. If the error after clipping exceeds the preset tolerance area, the clipping line position is readjusted and clipping is performed again.
4. A method for intercepting a conventional narrow and long image based on opposite direction information according to claim 3, characterized in that: After clipping, merge or break up the clipped target plot graphics according to business needs and save them again. Specifically: The narrow and long area of the target plot is exposed, and the cropped target plot graphic is merged with other adjacent graphics; The narrow area of the target plot is dumbbell-shaped. The two target plots after clipping must be scattered and independent, and assigned attributes.
Citation Information
Patent Citations
Method and system for extracting narrow and long area of surface, and storage medium
CN116630360A
Long and narrow area pattern spot processing method, memory and device
CN117392147A