# Addressing Gaps in Small-Scale Fisheries: A Low-Cost Tracking System +
## 2 Materials and Methods
### Data Structure and Processing  
GPS positions are progressively ingested according to the data structure reported in Appendix A (Table A1), where _ld_ is the progressive serial number, and _deviceld_ plays the same role of the Maritime Mobile Service Identities (MMSI) in uniquely identifying vessels. Other fields store position coordinates, timestamps (_deviceTime_), dynamic information relating to the ship's _course_ and _speed_, and system parameters (_sat_, _power_). Geofencing (_type_) registers in real-time when the vessel leaves the harbor and when it enters, while _sensor_ is 0 when the hauler is active (and 1 otherwise).  
A custom routine was developed in R [45] to partition sequences of consecutive GPS records into individual trips, which starts when the vessel turns on its power and leaves the port and ends on arrival in port (power off). The routine is applied in post processing and implemented in the Amazon Web Services (AWS) architecture. It takes advantage of the events that register the switching on and off of the device as sequences of few subsequent pings with no satellite connection and no battery power. The rationale is to detect trips' start and end points, by using the over-mentioned zero _sat_ and zero _power_--that occurs during device initialization/booting--pings and setting a minimum interval between a shutdown and the subsequent startup of the system. When the boat is stopped for more then a certain amount of time (here 45 min, but it will vary with the fishery), a new trip would start.  
The reliability of the system was evaluated for one month (November 2021) in terms of stability of the ping rate and the possible presence of outliers due to errors in data acquisition and transmission (i.e., speed values over 35 km/h and course values not within the range 0-360\({}^{\circ}\)).  
The geofence (Figure 3) was instead used to validate estimated trips, assuming that two geofence events (one _geofenceExit_ and one _geofenceEnter_) could define each single trip.  
Fishing behavior was investigated in terms of speed values, timestamps, and hauler operations.  
Figure 3: The Web interface of the Sencha ExtJS framework, the equipped small vessel (green point), and the geofence of its homeport (Ancona, Italy). The geofence was defined in Traccar and used in post processing to validate the estimated trips.  
Fishing events when the static gear is being recovered are identified using the signal of sensor attached to the hauler, and excluding steaming (i.e., speed values above the 75 th quantile). Related fishing positions are plotted to describe the spatial distribution of fishing activity.  
Further, as a preliminary investigation of the spatio-temporal behaviour of the vessel, we explore the speed values during the retrieving and setting activities and the amount of time that is spent in the retrieving of the passive gear (i.e., when the hauler is in operation) with respect to the time of day.  
GPS sample data and resource code developed for its processing, as well as all the other scripts needed to reproduce the results presented in this article, were written in R and shared [46].