com.supermap.track

Class Track

  • java.lang.Object
    • com.supermap.track.Track


  • public class Track
    extends java.lang.Object
    Provides the function of the automatic recording track; the tracked records can be corrected according to the road, to ensure that the record points are on the road; it can set the record time interval or distance interval. It also supports automatically removing the abnormal position coordinates. The track record supports the back-end operation, which is convenient for the record collection in the field.
    • Constructor Detail

      • Track

        public Track(android.content.Context context)
        Constructor.
        Parameters:
        context - Context passed from the outside.
    • Method Detail

      • setCustomLocation

        public void setCustomLocation(boolean bCustomLocation)
        Sets whether to use the user-customized location point. and the default is true. If set to false, it will get the location point by the GPS module on the device.
        Parameters:
        bCustomLocation - Whether to use the user-customized location point.
      • getCustomLocation

        public boolean getCustomLocation()
        Gets whether to use the user-customized location point.
        Returns:
        Whether to use the user-customized location point.
      • setGPSData

        public void setGPSData(LocationManagePlugin.GPSData gpsdata)
        Sets GPSData data. Only when set setCustomLocation(boolean bCustomLocation) to true, the interface is valid.
        Parameters:
        gpsdata - gpsdata set by the user.
      • createDataset

        public DatasetVector createDataset(Datasource datasource,
                                           java.lang.String strName)
        Creates a trace dataset, which is a point dataset.
        Parameters:
        datasource - The datasource the trace dataset is in.
        strName - The name of the dataset.
        Returns:
        The trace dataset,
      • setDataset

        public void setDataset(Dataset dataset)
        Sets the trace dataset, Firstly creates the trace dataset, then sets it.
        Parameters:
        dataset - The track dataset.
      • getDataset

        public Dataset getDataset()
        Gets the trace dataset,
        Returns:
        The trace dataset,
      • setMatchDatasets

        public void setMatchDatasets(Datasets datasets)
        Sets the matched road line dataset.
        Parameters:
        datasets - Sets the matched road line dataset.
      • getMatchDatasets

        public Datasets getMatchDatasets()
        Gets the matched road line dataset.
        Returns:
        The matched road line dataset.
      • startTrack

        public boolean startTrack()
        Start tracking.
        Returns:
        Whether to enable it successfully.
      • stopTrack

        public void stopTrack()
        Close tracking.
      • setTimeInterval

        public void setTimeInterval(int interval)
        Sets the time interval, the unit is second. The interval must be larger than 20 seconds, otherwise it is invalid.
        Parameters:
        interval - time interval.
      • getTimeInterval

        public int getTimeInterval()
        Gets the time interval.
        Returns:
        The time interval.
      • setDistanceInterval

        public void setDistanceInterval(double interval)
        Sets the distance interval, the unit is meter. The distance interval must be larger than or equal to 3 meters, otherwise it will be set to 3 meters.
        Parameters:
        interval - time interval.
      • getDistanceInterval

        public double getDistanceInterval()
        Gets the distance interval, the unit is meter, and the default is 5 meters.
        Returns:
        The time interval.
      • setSpeedDirectionEnable

        public void setSpeedDirectionEnable(boolean enable)
        Sets the speed and azimuth mode, which supports increasing or decreasing the trace points in the turning, high speed, low speed.
        Parameters:
        enable - True means to enable; otherwise false
      • isSpeedDirectionEnable

        public boolean isSpeedDirectionEnable()
        Gets whether it uses speed and azimuth mode
        Returns:
        True means it uses speed and azimuth mode; false means not.