I am trying to create a hill finder application
Like this
The user enters a starting location, and an end location. With the end goal of displaying a chart with the elevations of the road in the trip
Currently, I have managed to get it to create a route between point A and point B. I needed to use routing, since in my use case, the user has to stay on the road and can't just draw a straight line
code so far:
RoadManager roadManager = new OSRMRoadManager(requireContext(), "MY_USER_AGENT");
ArrayList<GeoPoint> waypoints = new ArrayList<>();
waypoints.add(startPoint);
GeoPoint endPoint = new GeoPoint(48.069842, -1.712637);
waypoints.add(endPoint);
Road road = roadManager.getRoad(waypoints);
Polyline roadOverlay = RoadManager.buildRoadOverlay(road);
map.getOverlays().add(roadOverlay);
map.invalidate();
Drawable nodeIcon = getResources().getDrawable(R.drawable.ic_baseline_location_on_24);
for (int i=0; i<road.mNodes.size(); i++){
RoadNode node = road.mNodes.get(i);
Marker nodeMarker = new Marker(map);
nodeMarker.setPosition(node.mLocation);
nodeMarker.setIcon(nodeIcon);
nodeMarker.setTitle("Step "+i);
map.getOverlays().add(nodeMarker);
}
Took this from the guide on the osmdroid bonus pack github page
I already have a system in place to load elevations from coordinates elsewhere in the app. I just need to get the coordinates from the route. At least every 10 feet or so, not just the intersections
I'm hoping this is possible with osmdroid, especially since this has been done with google's apis. However, that code was not open, and I don't want to be charged per usage
My best guess was something with projection(), but I barely know how to use it
NOTE: I won't be using this for long distances, probably at most a mile is what the user would need