SegmentDataLoader (API Reference)
Class SegmentDataLoader
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 Summary
ConstructorsConstructorDescriptionCreates a new instance of this class.SegmentDataLoader(SDKNativeEngine sdkEngine) Creates a new instance of this class. -
Method Summary
Modifier and TypeMethodDescriptionList<byte[]>downloadFile(List<FileReference> fileReferences, DownloadingFileOptions downloadingOptions) Synchronously load the optional image providing guidance of a directed or non directed segment.getSegmentsAroundCoordinates(GeoCoordinates coordinates, double radiusInMeters) Loads the segments around a certain coordinates.loadData(OCMSegmentId segment, SegmentDataLoaderOptions options) Synchronously load the data for the given map segment.loadDirectedSegmentData(DirectedOCMSegmentId segment, SegmentDataLoaderOptions options) Synchronously load the data for the given map directed segment.
-
Constructor Details
-
SegmentDataLoader
Creates a new instance of this class.
- Throws:
InstantiationErrorException-Indicates what went wrong when the instantiation was attempted.
-
SegmentDataLoader
Creates a new instance of this class.
- Parameters:
sdkEngine-A SDKEngine instance.
- Throws:
InstantiationErrorException-Indicates what went wrong when the instantiation was attempted.
-
-
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.
-