Skip to content

GeoStayGaps

roosit edited this page Nov 15, 2026 · 1 revision

GeoStayGaps

Up | Previous | Next | Русский

Full source with short explanations

Below is the full source of the class in documentation form. The comments inside the block explain the purpose of the parts of the class, but they are not stored in the working file GeoStayGaps.java: the production code stays clean and the explanations live in the wiki.

package com.velitask.plugin.official.processing.gaps;

import com.velitask.sdk.data.GeoSensorAtom;
import org.abricos.geo.GeoUtils;

/* Formula "Pauses at a stop: GPS": the distance between points is computed from the coordinates. */
public final class GeoStayGaps extends StayGaps<GeoSensorAtom> {

    /* Stable step name; localization keys Plugin.ImportStep.geoStayGaps.* */
    public static final String NAME = "geoStayGaps";

    public GeoStayGaps() {
        /* The formula works with atoms of the geosensor (GeoSensorAtom). */
        super(NAME, 1, GeoSensorAtom.class);
    }

    @Override
    /* Distance along the Earth's surface between two points, in metres. */
    protected double distanceMeters(GeoSensorAtom from, GeoSensorAtom to) {
        return GeoUtils.distance(from.lat, to.lat, from.lon, to.lon);
    }
}

Purpose

GeoStayGaps is the "Pauses at a stop: GPS" formula (geoStayGaps): it sets a pause while the coordinates stay within the given radius for longer than the given time. It is good for recordings where GPS keeps recording at a standstill and the file has no explicit pause. The formula is registered in BuiltinScenarios, but no built-in import scenario uses it: it is chosen in custom scenarios for the geosensor.

How it works

Data. The class is a subclass of StayGaps for GeoSensorAtom atoms. The distance between two points is GeoUtils.distance(from.lat, to.lat, from.lon, to.lon) from org.abricos.geo; the result is in metres.

Parameters. All parameters are inherited: "Stay radius, m", "Minimal stay time, s" (both 0 by default) and the common "Stood if moved less than, m" (stoodMeters, 30). The algorithm that looks for stays is described on the StayGaps page.

Features and limitations

  • With the defaults (radius 0) only points with exactly the same coordinates count as a stay; GPS noise hardly ever gives them, so the radius is usually set from a few metres.
  • Elevation does not take part in the distance, only latitude and longitude.
  • The stay radius and the "Stood if moved less than, m" parameter are different things: the first determines where the pauses are set, the second only marks an already found pause as a stop.

Clone this wiki locally