Keywords

1 Introduction

With the increase of labor costs and the scale of agricultural operations under the land transfer, the urgent need for agricultural production to mechanization and even mechanized operation service is becoming increasingly apparent in China [1,2,3]. The operation area is the core index of planting production. It is the foundation of the cost settlement between supply and demand in the context of agricultural market service. In addition, the operation area is also the basis of agricultural policy subsidy settlement [4, 5]. In recent years, the subsidies are gradually paid according to operation area instead of machine to be purchased, under the background of improvement of supervision technique on agricultural manchine and marketization of agricultural machine service. All of these changes are focusing on the scientific management and precision subsidization on the whole process of planting industry including cultivation, seeding, crop management and harvest [6, 7]. Therefore, it is essential to have a method of real-time accurate area measurement to calculate the cost of agricultural operations services and subsidy. It is order to reduce the contradictions between employers and workers as well as to ensure the effective payment of subsidies.

The traditional method to calculate area use the tape to measure. It is a static measurement method, consuming labor and time. With the continuous development of Global Positioning System (GPS), the method of measuring the operation area of agricultural machinery based on GPS could save manpower and realize dynamic measurement [8, 9]. There are 2 categories of GPS based area measure method, which are based on the boundary of agricultural machinery operating and the trajectory of agricultural machinery operating, respectively. The method of area measurement based on the boundary can calculate the area of irregular fields. The larger the field areas are, the higher the accuracy of the measurement results become. However, the method cannot measure the operation area in real time and is less efficient to measure [10,11,12,13,14,15,16,17]. Trajectory based area measurement presents the real-time advantage. The keypoints are trajectory identification and area algorithms [18,19,20]. Operation trajectory data is essential to identify trajectory of agricultural machinery. As the agricultural machineries have different operating status, the data obtained is not all the operation trajectory data generated by working in the field. It will lead to the result that the error of calculation of operation area increases. Therefore, it is of great significance to accurately determine the track points of agricultural machinery operating in the field. Although the method of area measurement based on the trajectory realizes real-time measurement for the operation area, the measurement accuracy is greatly affected in the case of overlapping operation without navigation [20,21,22,23,24,25]. The buffer algorithm based on the trajectory of agricultural machinery proposed by Liu et al. [26] can effectively solve the problem of overlapping. But the actual situation of agricultural machinery operating has not been considered to determine the trajectory of agricultural machinery.

Therefore, in order to measure the operation area of agricultural machinery in real time, this paper filters the operation trajectory data based on the actual situation of agricultural machinery. It can identify the track points and the non-track points. It is used to generate the trajectory of agricultural machinery. Referring to the buffer analysis method of geographic information system [27,28,29], the improved algorithm of line feature based on the curve topology [30] is applied to the calculation of the area based on the trajectory of agricultural machinery. Finally, the method is validated by the field test.

2 Data Filtering

2.1 Data Definition

The accurate identification of the operation trajectory points is the key to identify the trajectory of agricultural machinery. The GPS installed in agricultural machinery can provide data in real time. According to the different operation of agricultural machinery, such as operating, transfering, turning round and so on, the data obtained by GPS can be defined as four categories, which are track point, drift point, move point and interval point.

  1. (1)

    Track Point

When the agricultural machinery operate in the field, the obtained data is defined as track point. This data include both position and operation information is the key to identify the track points, and contribute to generate a complete trajectory of agricultural machinery.

  1. (2)

    Drift Point

The drift point is the data that deviates from the trajectory. Due to the GPS positioning error, some of the data received by GPS drifts and deviates from the normal operating trajectory, which results in increasing calculation error of the operation area.

  1. (3)

    Move Point

The move point is the data without the operation attribute information. When the agricultural machinery is in a state of parallel transfer, such as driving on the road, turning on the ground and so on, the acquired data does not have operation attribute information.

  1. (4)

    Interval Point

The interval point is the key point to determine whether the agricultural machinery into the next work area. It also belong to the track point. During the process of operating, the agricultural machinery is likely to bypass obstacles or park to check. When the agricultural machineries work again, it is necessary to determine whether the agricultural machineries enter the next operation area according to the interval point, and then a new operation trajectory is recorded with the interval point as the starting point.

2.2 Discriminant Method

The data obtained by GPS installed in agricultural machinery contains basic attribute information such as position coordinates and reception time. Aiming at the characteristics of four kinds of points such as drift point, move point, track point and interval point, the data discrimination method is proposed as follows.

  1. (1)

    Drift Point

The drift point generated by the GPS positioning error can be filtered by designing the corresponding algorithm. The method of filtering algorithm is as follows:

  1. â‘ 

    Set a distance threshold value D;

  2. â‘¡

    Take two adjacent points Pi−1, Pi, and then calculate the distance d between these two points;

  3. â‘¢

    If d > D, it is determined that \( P_{i} \) is the drift point.

  1. (2)

    Move Point

The method of discriminating the move point is mainly based on its attribute information. Set the operation attribute of \( P_{i} \) to be represented by r. If \( {\text{r}} \in\Phi \), then \( P_{i} \) is the move point.

  1. (3)

    Track Point

The data containing the operation attribute information other than the drift point and the move point are the track point.

  1. (4)

    Interval Point

The interval point is determined based on the reception time information of the data. The specific method of discrimination is as follows:

  1. â‘ 

    Set a time threshold value T;

  2. â‘¡

    Take two adjacent points \( P_{i - 1} \), \( P_{i} \), and then calculate the time difference t between these two points;

  3. â‘¢

    If t > T, it is determined that \( P_{i} \) is the interval point. Record a new operation trajectory with \( P_{i} \) as the starting point.

The specific flow chart of the track point screening is shown in Fig. 1. All of the points are stored as time information and 2 adjacent points are selected. Based on the screening process, all the track points are obtained. The exact trajectory of agricultural machinery operating is generated according to the operation trajectory point. It is useful to calculate the operation area of agricultural machinery.

Fig. 1.
figure 1

Process of screening operation trajectory point

2.3 Simulate the Screening Process

As shown in Fig. 2, according to the method of data filtering, the process of screening operation trajectory points is illustrated in a schematic diagram. Figure 2a shows the original dataset, which contains the track point and the non-track point. As shown in Fig. 2b, by using the above methods of screening different points, the original data is determinated into four categories, which are drift point, move point, interval point and track point. As shown in Fig. 2c, the operation trajectory points obtained after the screening is connected into a line that is the accurate operation trajectory of the agricultural machinery.

Fig. 2.
figure 2

Schematic diagram of generating operation trajectory

3 Buffer Algorithm for Area Measurement Based on Curve Topology

Due to the characteristics of agricultural machinery operation, the operation trajectory consists of several trajectory segments. When the agricultural machinery at both ends of the track, it does not operate. Therefore, this paper improve the buffer algorithm based on the curve topology. Excepting the start point of the first trajectory segment and the end point of the last trajectory segment, the rest of the points construct buffer. The basic algorithm is as follows: The operation trajectory is divided into a number of basic trajectory segments. Then each trajectory segments constructs an external rectangle. What’s more, excepting the start point of the first trajectory segment and the end point of the last trajectory segment, the rest of the points construct buffer. Finally, the external rectangle of the trajectory segments is intersected and merged with the point buffer to get the complete buffer of the agricultural machinery operation trajectory.

As shown in Fig. 3, the operation trajectory of agricultural machinery can be regarded as a set of end-to-line segments. Assume that the operation trajectory of agricultural machinery consists of n + 1 track points which are \( P_{1} ,P_{2} , \cdots ,P_{n + 1} \). Trajectory segments \( L_{1} ,L_{2} , \cdots ,L_{n} \) are generated by connecting all track points in chronological order. The trajectory segment set L of the operation trajectory of agricultural machinery is:

$$ {\text{L}} = \bigcup\nolimits_{i = 1}^{n} {L_{i} } $$
(1)
Fig. 3.
figure 3

Improved buffer algorithm based on curve topology

The track point set P of the operation trajectory of agricultural machinery is:

$$ {\text{P}} = \bigcup\nolimits_{i = 1}^{n + 1} {P_{i} } $$
(2)

The trajectory segment L is used as the central axis for constructing the external rectangle. The buffer distance R is translated in the vertical direction on both sides of the central axis to obtain the outer rectangle. With each track point P as the center and the buffer distance R as the radius, the track point buffer is generated by rotating for one week. The buffer distance R is:

$$ {\text{R}} = \frac{1}{2}w $$
(3)

In formula (3): \( w \) is the width of the agricultural machinery operating. The external rectangle of the trajectory segments is intersected and merged with the point buffer to get the complete buffer of the agricultural machinery operation trajectory. Based on this, the mathematical expression of the buffer B (L, R) of the operation trajectory of agricultural machinery is:

$$ \left\{ {\begin{array}{*{20}l} {B\left( {L,R} \right) = T\left( {L_{1} ,R} \right),} \hfill & {\left( {n = 1} \right)} \hfill \\ {B\left( {L,R} \right) = \left\{ {T\left( {\bigcup\nolimits_{i = 1}^{n} {L_{i} } ,R} \right)} \right\}{\bigcup }\left\{ {B\left( {\bigcup\nolimits_{j = 2}^{n} {P_{j} } ,R} \right)} \right\},} \hfill & {(n > 1)} \hfill \\ \end{array} } \right. $$
(4)

In formula (4): \( T\left( {L_{i} ,R} \right) \) is the external rectangle of trajectory segments \( L_{i} \), \( B\left( {P_{j} ,R} \right) \) is the buffer of the track points. Excepting the start point of the first trajectory segment and the end point of the last trajectory segment, the rest of the points construct buffers. Then the external rectangle of the trajectory segments is intersected and merged with the point buffer to get the complete buffer of the agricultural machinery operation trajectory.

Assuming that the complete buffer generated is an irregular polygon, the area of the buffer can be calculated by the Simpson formula [31]. As shown in Fig. 4, according to the vertex order of the polygon, the trapezoidal area that consist of all sides of the polygons and the x-axis or y-axis is obtained individually and then calculate the algebraic sum of each trapezoidal area. A Simpson area of a polygon consisting of n vertices is calculated as follows:

$$ {\text{S}} = \frac{1}{2} \times \sum\nolimits_{i = 1}^{n} {x_{i} } \left( {y_{i + 1} - y_{i - 1} } \right)\left| {\begin{array}{*{20}c} {y_{0} = y_{n} } \\ {y_{n + 1} = y_{1} } \\ \end{array} } \right. $$
(5)
Fig. 4.
figure 4

The illustration of Simpson formula

When the vertices of the polygons are arranged in the clockwise direction, the Simpson area is positive. When the vertices of the polygons are arranged in a counterclockwise direction, the Simpson area is negative. So the area A of buffer polygon is the absolute value of its Simpson area S. The expression is as follows:

$$ {\text{A}} = \left| S \right| $$
(6)

4 Method Validation and Discussion

The subsoiling operations were carried out at Qipanjin town OtogBanner in Inner Mongolia in April 2017. The GPS receiver installed in agricultural machinery can provide the position data of agricultural machinery in real time. The position accuracy of GPS can reach centimeter level. The subsoiling-depth sensor can be used to obtain tillage information as a basis for data screening. Finally, all data is transmitted to the monitoring terminal, the agricultural cloud service platform. In this platform, the results of data screening and the statistical subsoil area can be visually displayed.

4.1 The Validation of Data Filtering Method

The time difference used to determine the interval points is set to 20 s. The minimum drift distance is set to 20 m. The tillage information is used as attribute information to determine the trajectory data of agricultural machinery. Agricultural cloud service platform is shown in Fig. 5. The green point represents the track points. Click the icon to view images of agricultural machinery operating captured in real time. As shown in Fig. 5a, the point marked with a red circle is the drift point. It does not count on the trajectory of agricultural machinery. As shown in Fig. 5b, The gray point represents the move point. When the agricultural machinery is in a state of parallel transfer, the trajectory formed by these points are generated. As shown in Fig. 5c, the point marked with a red circle is the interval point. A new operation trajectory is recorded with the interval point as the starting point.

Fig. 5.
figure 5

Agricultural cloud service platform (Color figure online)

In summary, the drift point and move point are not recorded in the track. The interval point becomes the key point to divide the operation area of agricultural machinery. Therefore, the accurate trajectories of agricultural machinery operating are generated after the data screening, which is very important to calculate the operation area of agricultural machinery.

4.2 The Validation of Buffer Algorithm for Area Measurement

In this experiment, the subsoiling operation area of agricultural machinery is calculated by the improved buffer algorithm for area measurement based on curve topology. As shown in Table 1, the algorithm validation was performed 10 times. According to the actual operation area of agricultural machinery, the measurement error of the buffer algorithm for area is obtained. Error results is not more than 1.3%. It can meet the needs of the measurement accuracy for the operation area of agricultural machinery. In addition, that is to verify the accuracy of the improved algorithm based on the curve topology.

Table 1. Measurement error of buffer algorithm based on curve topology

Therefore, the operation area calculated by the improved buffer algorithm for area measurement based on curve topology corresponds to actual situation of agricultural machinery operating. It can be used as a basis for calculating the service fees of agricultural machinery and the subsidies of agricultural machinery operating. So the operation area is significant to guide operation of agricultural machinery efficiently and adjust the inputs in real time.

5 Conclusion

Data filtering according to the different operation conditions of agricultural machinery is the key to calculate the operation area of agricultural machinery accurately. The track points obtained by filtering are connected to generate accurate operation trajectory of agricultural machinery. On this basis, the improved algorithm of line feature based on the curve topology is applied to the calculation of the area based on the trajectory of agricultural machinery. It not only overcomes the problem of various parallel line distortion caused by constructing the buffer of line feature, but also the operation area calculated by the improved algorithm corresponds to actual situation of agricultural machinery operating. Measurement error of buffer algorithm based on curve topology is less than 1.3%. It can meet the needs of the measurement accuracy for the operation area of agricultural machinery. In summary, the operation area calculated by this improved algorithm can be used as a basis for calculating the service fees of agricultural machinery and the subsidies of agricultural machinery operating. So it is significant to guide operation of agricultural machinery efficiently and adjust the inputs in real time.