A method for calculating the shape complexity of cultivated land patches
By calculating multiple shape feature indicators of cultivated land vector map spots, a comprehensive complexity evaluation indicator was constructed, which solved the problem that the existing technology could not effectively evaluate the shape complexity of cultivated land map spots, and realized the accurate quantitative analysis of cultivated land shape complexity. Land use and rectification provide effective reference.
Patent Information
- Application Number
- CN202311563847.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-20
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2043-11-20
AI Technical Summary
The existing technology cannot effectively evaluate the shape complexity of cultivated map spots, lacks comprehensive utilization of multiple indicators, and it is difficult to provide an accurate reference for land use and rectification.
By calculating the area, perimeter, number of vertices and area and perimeter of convex hull polygons of cultivated land vector map spots, the contour edge amplitude, squareness and shape convexity are constructed, and the pattern shape complexity evaluation index is comprehensively constructed, and the GDAL algorithm library is used. and shoelace theorem to quickly obtain data.
The quantitative analysis of the shape complexity of cultivated land spots is realized, and the comprehensive evaluation indicators obtained are highly accurate, which can provide effective reference for land planning and rectification, and is fast and accurate.
Smart Images

Figure CN117974755B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of calculation of shape complexity of cultivated land patches, and in particular to a method for calculating shape complexity of cultivated land patches. Background Art
[0002] The present invention relates to a method for calculating the shape complexity of cultivated land patches, and quantitatively evaluates the shape complexity of cultivated land images based on the construction of multi-index data. Based on vector data, the GDAL algorithm library is used to respectively calculate the cultivated land vector patch area, the cultivated land vector patch perimeter, the number of vertices and the convex hull polygon area; further, according to the above-mentioned information, the contour edge amplitude is respectively constructed, and the contour squareness and the patch convexity are calculated; based on the shape feature index calculated in the previous step, the patch shape complexity comprehensive evaluation index is constructed. The present invention overcomes the accuracy problem of measuring shape complexity with a single index at present, realizes the comprehensive utilization of multiple indexes, and provides a reference basis for rectification site selection for land use and land rectification.
[0003] After searching, no prior art identical or similar to the present application was found. Although the patent document with document number CN112182896A discloses a method for calculating the local environmental complexity of terrain and landforms, which involves the calculation of the local environmental complexity of terrain and landforms, it is mainly a method for calculating the roughness of terrain and landforms, and cannot be applied to the evaluation and calculation of the shape complexity of cultivated land patches. Summary of the invention
[0004] The purpose of the present invention is to provide a method for calculating the shape complexity of cultivated land map patches, which can quantitatively analyze cultivated land vector map patches and provide an effective reference for land planning and land rectification.
[0005] The purpose of the present invention can be achieved by the following technical solution: A method for calculating the shape complexity of a cultivated land patch comprises the following steps:
[0006] S1. According to the cultivated land vector patch data, obtain the number of cultivated land vector patch vertices and calculate the area S of each cultivated land vector patch A and perimeter C A ;
[0007] S2. Construct the convex hull polygon corresponding to each cultivated land vector patch; traverse each convex hull polygon and calculate the area of each convex hull polygon and perimeter
[0008] S3, calculating the boundary amplitude index, squareness and shape convexity of each convex hull polygon contour;
[0009] S4. Construct a comprehensive evaluation index of pattern shape complexity based on boundary amplitude index, outline squareness and shape convexity.
[0010] Furthermore: the number of vertices of the cultivated land vector map is obtained by traversing the vector data layer data.
[0011] Further: the calculated cultivated land vector map patch area S A The formula is:
[0012] S A =0.5*|(x 1 *y 2 + x 2 *y 3 + ... + x n *y 1 )-(y 1 *x 2 + y 2 *x 3 + ... +y n *x 1 )| (1)
[0013] Among them, S A Represents the area of cultivated land polygonal patch, x n Indicates the longitude coordinate, y n Represents the latitude coordinate.
[0014] Further: the calculated perimeter C of the cultivated land vector map patch A The formula is:
[0015]
[0016] Where: C A Indicates the perimeter of the cultivated land polygon, x i and i Respectively represent the longitude and latitude coordinate information.
[0017] Further: the boundary amplitude index calculation formula in S3 is:
[0018]
[0019] Where: A is a polygon, AP A is the vibration amplitude of the polygonal pattern contour, C A represents the perimeter of the polygonal patch, Represents the perimeter of the convex hull polygon.
[0020] Further: the squareness calculation formula in S3 is:
[0021]
[0022] Where: A represents polygon, CP A Represented as polygonal vector shape squareness, SA Represents the area of the polygonal patch, C A Indicates the perimeter of the polygonal pattern.
[0023] Further: the shape convexity calculation formula in S3 is:
[0024]
[0025] Where: A is a polygon, CV A is the convexity of the polygonal pattern, S A represents the area of the polygonal patch, Represents the area of the convex hull polygon.
[0026] Further: In said S4, the comprehensive evaluation index of the shape complexity of the pattern is constructed based on the boundary amplitude index, the outline squareness and the shape convexity as follows:
[0027] W=0.1*AP A +0.4*CP A +0.5*CV A (6)
[0028] Where: W represents the comprehensive index of polygon shape complexity, the domain value range is [0.5,1], AP A Represents the boundary amplitude index, CP A Indicates the shape compactness of polygonal vector pattern, CV A is the convexity of the polygonal pattern.
[0029] Beneficial effects of the present invention:
[0030] 1. The present invention obtains the area and perimeter of the corresponding convex hull polygon by utilizing the area, perimeter and number of vertices of the cultivated land vector patch, and constructs a comprehensive evaluation index of patch shape complexity by analyzing the boundary amplitude index, outline squareness and shape convexity of the cultivated land vector patch and the convex hull polygon; the method for obtaining the comprehensive evaluation index of complexity is simple and practical, and is not based on polygon triangulation, bending and fractal methods. The obtained comprehensive evaluation index of complexity has high accuracy, can perform quantitative analysis on the cultivated land vector patch, and can provide an effective reference basis for land planning and land rectification.
[0031] 2. The present invention analyzes the shape complexity of cultivated land patches through three indicators: boundary amplitude, outline squareness and shape convexity. The shape complexity of cultivated land patches can be analyzed from the changes in vertices, area and perimeter. The obtained quantitative data can vividly and intuitively reflect the changes in the complexity of cultivated land patches, and has high pertinence. At the same time, the shoelace theorem (Shoelaceformula) and GDAL are used to quickly obtain the area and perimeter of the cultivated land vector patch and the corresponding convex hull polygon. The acquisition speed is fast and the accuracy is high. The comprehensive evaluation index of complexity obtained by accurate quantification can be used to quantitatively analyze the cultivated land vector patch, and can provide an effective reference basis for land planning and land rectification. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 It is a schematic diagram of the flow of a method for calculating the shape complexity of a cultivated land patch according to the present invention;
[0033] Figure 2 This is a calculation result diagram of the shape complexity of the cultivated land vector map of the present invention;
[0034] Figure 3 For the present invention Figure 2 Schematic diagram of the structure of the No. 9 cultivated land patch and its corresponding convex hull polygon. DETAILED DESCRIPTION
[0035] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar symbols throughout represent the same or similar elements or elements with the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0036] like Figure 1-3 As shown, the present invention discloses a method for calculating the shape complexity of a cultivated land patch, comprising the following steps:
[0037] S1. Obtain the cultivated land vector patch data and calculate the area S of each cultivated land vector patch A , perimeter C A and the number of vertices;
[0038] S2. Construct the convex hull polygon corresponding to each cultivated land vector patch; traverse each convex hull polygon and calculate the area of each convex hull polygon and perimeter
[0039] S3, calculating the boundary amplitude index, squareness and shape convexity of each convex hull polygon contour;
[0040] S4. Construct a comprehensive evaluation index of pattern shape complexity based on boundary amplitude index, outline squareness and shape convexity.
[0041] According to the cultivated land vector patch data, the number of cultivated land vector patch vertices can be calculated. The number of vertices of each patch can be directly obtained by traversing the cultivated land vector patch data layer data. The GetPoint Count() function can be used in GDAL to calculate the number of patch vertices.
[0042] The longitude and latitude coordinate data can be obtained from the cultivated land vector map data. The area S of the cultivated land vector map can be calculated by using the shoelace formula (1).
[0043] S=0.5*|(x 1 *y 2 + x 2 *y 3 + ... + x n *y 1 )-(y 1 *x 2 + y 2 *x 3 + ... +y n *x 1 )| (1)
[0044] Among them, S represents the area of the cultivated land polygon, x n Indicates the longitude coordinate, y n Represents the latitude coordinate.
[0045] The perimeter C of the cultivated land vector map can be calculated by formula (2):
[0046]
[0047] Where: C represents the perimeter of the cultivated land polygon, x i and i In GDAL, the perimeter of a vector blob can be calculated by calling the Boundary().Length() function.
[0048] A convex hull polygon is a polygon whose connecting line between any two points does not include any point outside the polygon. Figure 3 A is Figure 2 The No. 9 cultivated land vector map, Figure 3 B is Figure 2 The convex hull polygon corresponding to the No. 9 cultivated land vector map can be obtained by using the Convex Hull function in GDAL to automatically generate the convex hull polygon corresponding to the cultivated land map patch. This can reflect the changes in the polygonal spatial morphology.
[0049] Based on the obtained convex hull polygon, call the Boundary().Length() function in GDAL to get the perimeter of the convex hull polygon Calling the GetArea function in GDAL can realize the area of the convex hull polygon calculate.
[0050] The complexity of a shape is perceived based on the length of its contour, its area, and the degree of familiarity with the shape. People believe that the smoother and fuller a shape is, the less complex it is. Smooth contours, smaller perimeters, and larger areas are manifestations of smoothness and fullness.
[0051] According to the perimeter C and area S of the cultivated land vector patch, and the perimeter of the convex hull polygon corresponding to the cultivated land vector patch area The comprehensive evaluation index of the shape complexity of cultivated land vector patches can be constructed through the boundary amplitude index, squareness and shape convexity of the convex hull polygon and the corresponding cultivated land vector patches.
[0052] Among them, the calculation formula of the contour boundary amplitude index is:
[0053]
[0054] Where: A is a polygon, AP A is the vibration amplitude of the polygonal pattern contour, C A represents the perimeter of the polygonal patch, Represents the perimeter of the convex hull polygon.
[0055] The squareness calculation formula is:
[0056]
[0057] Where: A represents polygon, CP A Represented as polygonal vector shape squareness, S A Represents the area of the polygonal patch, C A Indicates the perimeter of the polygonal pattern.
[0058] The shape convexity calculation formula is:
[0059]
[0060] Where: A is a polygon, CV A is the convexity of the polygonal pattern, S A represents the area of the polygonal patch, Represents the area of the convex hull polygon.
[0061] According to the obtained contour boundary amplitude index AP A , Squareness Index CP Aand shape convexity index CV A , using formula (6), calculate the shape complexity W of the cultivated land patch:
[0062] W=0.1*AP A +0.4*CP A +0.5*CV A (6)
[0063] Where: W represents the comprehensive index of polygon shape complexity, the domain value range is [0.5,1], AP A Represents the boundary amplitude index, CP A Indicates the shape compactness of polygonal vector pattern, CV A is the convexity of the polygonal pattern.
[0064] Taking the local area of Changfeng County, Hefei City as the study area, the high-resolution remote sensing images in 2022 were used to manually mark the cultivated land in the study area, and 9 cultivated land vector patch data were obtained. The shoelace formula was used to calculate the area S of each cultivated land vector patch, and the Get Point Count() function in GDAL was used to calculate the number of vertices of each patch, and the longitude and latitude coordinates of the vertices were obtained. The Boundary().Length() function in GDAL was used to calculate the perimeter of each vector patch; the Convex Hull function in GDAL was used to automatically generate the convex hull polygon corresponding to each cultivated land vector patch; for the convex hull polygon, the Boundary().Length() function in GDAL can be called to obtain the perimeter of the convex hull polygon. Calling the GetArea function in GDAL can realize the area of the convex hull polygon Calculation: Based on the perimeter C of the cultivated land vector map A , Area S A , and the perimeter of the convex hull polygon corresponding to the cultivated land vector patch area Calculate the contour boundary amplitude index AP A , Squareness Index CP A and shape convexity index CV A , according to the obtained contour boundary amplitude index AP A , Squareness Index CP A and shape convexity index CV A In the calculation process, Python language can be used to construct the calculation of the shape complexity of cultivated land vector map patches and study the shape complexity of cultivated land patches, such as Figure 2 A schematic diagram showing the calculation results of the shape complexity of cultivated land patches. The larger the value, the more complex the patch shape; the smaller the value, the closer the patch outline is to a square and the more regular the patch.
[0065] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
[0066] It should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as limiting the present invention.
[0067] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0068] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral one; it can be a mechanical connection, an electrical connection, or communication with each other; it can be a direct connection, or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0069] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may mean that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. Moreover, a first feature being "above", "above" or "above" a second feature may mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is higher in level than the second feature. A first feature being "below", "below" or "below" a second feature may mean that the first feature is directly below or obliquely below the second feature, or simply means that the first feature is lower in level than the second feature.
Claims
1. A method for calculating the shape complexity of cultivated land patches, characterized in that: The following steps are involved: S1. According to the cultivated land vector patch data, obtain the number of cultivated land vector patch vertices and calculate the area S of each cultivated land vector patch A and perimeter C A ; S2. Construct the convex hull polygon corresponding to each cultivated land vector patch; traverse each convex hull polygon and calculate the area of each convex hull polygon and perimeter S3, calculating the boundary amplitude index, squareness and shape convexity of each convex hull polygon contour; S4. Construct a comprehensive evaluation index of pattern shape complexity based on boundary amplitude index, outline squareness and shape convexity; The calculation formula of the boundary amplitude index in S3 is: Where: A is a polygon, AP A is the vibration amplitude of the polygonal pattern contour, C A represents the perimeter of the polygonal patch, Represents the perimeter of the convex hull polygon; The squareness calculation formula in S3 is: Where: A represents polygon, CP A Represented as polygonal vector shape squareness, S A Represents the area of the polygonal patch, C A Indicates the perimeter of the polygonal pattern; The shape convexity calculation formula in S3 is: Where: A is a polygon, CV A is the convexity of the polygonal pattern, S A represents the area of the polygonal patch, Represents the area of the convex hull polygon.
2. The method for calculating the shape complexity of cultivated land patches according to claim 1, characterized in that: The number of vertices of the cultivated land vector patch is obtained by traversing the vector data layer data.
3. The method for calculating the shape complexity of cultivated land patches according to claim 1, characterized in that: The calculated cultivated land vector map patch area S A The formula is: S A =0.5*|(x1*y2+x2*y3+...+x n *y1)-(y1*x2+y2*x3+...+y n *x1)| (1) Among them, S A Represents the area of cultivated land polygonal patch, x n Indicates the longitude coordinate, y n Represents the latitude coordinate.
4. The method for calculating the shape complexity of cultivated land patches according to claim 1, characterized in that: The calculation of the perimeter C of the cultivated land vector map patch A The formula is: Where: C A Indicates the perimeter of the cultivated land polygon, x i and i Respectively represent the longitude and latitude coordinate information.
5. The method for calculating the shape complexity of cultivated land patches according to claim 1, characterized in that: In S4, the comprehensive evaluation index of the shape complexity of the pattern is constructed based on the boundary amplitude index, the outline squareness and the shape convexity: W=0.1*AP A +0.4*CP A +0.5*CV A (6) Where: W represents the comprehensive index of polygon shape complexity, the domain value range is [0.5,1], AP A Represents the boundary amplitude index, CP A Represents the shape and squareness of the polygonal vector pattern, CV A is the convexity of the polygonal pattern.
