Class SegmentDataLoader

java.lang.Object
com.here.NativeBase
com.here.sdk.mapdata.SegmentDataLoader

public final class SegmentDataLoader extends NativeBase

Provides the interface for the access to the segments data available in the local OCM map. Please be aware that the methods within this class load map data synchronously. In the event of absent data in the disk cache, the data will be retrieved from the remote server. To mitigate the potential freezing of the calling thread, it is advisable to proactively prefetch map data around the working area.

Note: This is a beta release of this feature, so there could be a few bugs and unexpected behaviors. Related APIs may change for new releases without a deprecation process.

  • Constructor Details

  • Method Details

    • getSegmentsAroundCoordinates

      @NonNull public List<OCMSegmentId> getSegmentsAroundCoordinates(@NonNull GeoCoordinates coordinates, double radiusInMeters) throws MapDataLoaderException

      Loads the segments around a certain coordinates. Returns an empty list in case no segments could be found around the coordinates.

      Parameters:
      coordinates -

      The location to explore

      radiusInMeters -

      The radius of the search. Only values between 1m and 5000m are accepted.

      Returns:

      The list of segments around the given position. The segments are sorted by distance from the point. Throws if it's not possible to return list of a list of segments.

      Throws:
      MapDataLoaderException -

      Specifies reason, why list of a list of segments is not returned.

    • loadData

      @NonNull public SegmentData loadData(@NonNull OCMSegmentId segment, @NonNull SegmentDataLoaderOptions options) throws MapDataLoaderException

      Synchronously load the data for the given map segment.

      Parameters:
      segment -

      The segment to load.

      options -

      Request options

      Returns:

      Requested data of a segment.

      Throws:
      MapDataLoaderException -

      Specifies reason, why list of data of a segment is not returned.

    • loadDirectedSegmentData

      @NonNull public SegmentData loadDirectedSegmentData(@NonNull DirectedOCMSegmentId segment, @NonNull SegmentDataLoaderOptions options) throws MapDataLoaderException

      Synchronously load the data for the given map directed segment.

      Parameters:
      segment -

      The directed segment to load.

      options -

      Request options

      Returns:

      Requested data of a segment.

      Throws:
      MapDataLoaderException -

      Specifies reason, why list of data of a segment is not returned.

    • downloadFile

      @NonNull public List<byte[]> downloadFile(@NonNull List<FileReference> fileReferences, @NonNull DownloadingFileOptions downloadingOptions) throws MapDataLoaderException

      Synchronously load the optional image providing guidance of a directed or non directed segment.

      Parameters:
      fileReferences -

      Provides information for a file reference.

      downloadingOptions -

      Provides information regarding downloading configuration.

      Returns:

      Requested data of a segment.

      Throws:
      MapDataLoaderException -

      Specifies reason, why list of data of a segment is not returned.