Search in sources :

Example 16 with AvoidRoadInfo

use of net.osmand.plus.helpers.AvoidSpecificRoads.AvoidRoadInfo in project Osmand by osmandapp.

the class ImpassableRoadsStorage method getImpassableRoadsInfo.

public List<AvoidRoadInfo> getImpassableRoadsInfo() {
    List<LatLon> points = getPoints();
    List<Long> roadIds = getRoadIds(points.size());
    List<Double> directions = getDirections(points.size());
    List<String> appModeKeys = getAppModeKeys(points.size());
    List<String> descriptions = getPointDescriptions(points.size());
    List<AvoidRoadInfo> avoidRoadsInfo = new ArrayList<>();
    for (int i = 0; i < points.size(); i++) {
        LatLon latLon = points.get(i);
        PointDescription description = PointDescription.deserializeFromString(descriptions.get(i), null);
        AvoidRoadInfo avoidRoadInfo = new AvoidRoadInfo();
        avoidRoadInfo.id = roadIds.get(i);
        avoidRoadInfo.latitude = latLon.getLatitude();
        avoidRoadInfo.longitude = latLon.getLongitude();
        avoidRoadInfo.direction = directions.get(i);
        avoidRoadInfo.name = description.getName();
        avoidRoadInfo.appModeKey = appModeKeys.get(i);
        avoidRoadsInfo.add(avoidRoadInfo);
    }
    return avoidRoadsInfo;
}
Also used : ArrayList(java.util.ArrayList) AvoidRoadInfo(net.osmand.plus.helpers.AvoidSpecificRoads.AvoidRoadInfo) LatLon(net.osmand.data.LatLon) PointDescription(net.osmand.data.PointDescription)

Aggregations

AvoidRoadInfo (net.osmand.plus.helpers.AvoidSpecificRoads.AvoidRoadInfo)16 LatLon (net.osmand.data.LatLon)6 PoiUIFilter (net.osmand.plus.poi.PoiUIFilter)6 QuickAction (net.osmand.plus.quickaction.QuickAction)6 File (java.io.File)5 ArrayList (java.util.ArrayList)5 ITileSource (net.osmand.map.ITileSource)5 HistoryEntry (net.osmand.plus.helpers.SearchHistoryHelper.HistoryEntry)5 MapMarkersGroup (net.osmand.plus.mapmarkers.MapMarkersGroup)5 FavoriteGroup (net.osmand.plus.myplaces.FavoriteGroup)5 OnlineRoutingEngine (net.osmand.plus.onlinerouting.engine.OnlineRoutingEngine)5 ApplicationMode (net.osmand.plus.settings.backend.ApplicationMode)5 ApplicationModeBean (net.osmand.plus.settings.backend.ApplicationMode.ApplicationModeBean)5 OpenstreetmapPoint (net.osmand.plus.plugins.osmedit.data.OpenstreetmapPoint)4 OsmNotesPoint (net.osmand.plus.plugins.osmedit.data.OsmNotesPoint)4 GlobalSettingsItem (net.osmand.plus.settings.backend.backup.items.GlobalSettingsItem)4 OsmandApplication (net.osmand.plus.OsmandApplication)3 MapMarker (net.osmand.plus.mapmarkers.MapMarker)3 List (java.util.List)2 Map (java.util.Map)2