Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get elevation for points of a route created by form #86

Open
PabloCanalSuarez opened this issue Mar 31, 2020 · 5 comments
Open

Get elevation for points of a route created by form #86

PabloCanalSuarez opened this issue Mar 31, 2020 · 5 comments
Labels
feature New feature to be developed Small funtionality Funtionality that needs moderate time to get done

Comments

@PabloCanalSuarez
Copy link
Contributor

When a user creates a route through the app's form, the trackpoints selected in the Leaflet map doesn't have any kind of elevation data. To obtain that, in case we need it, we will probably have to use an API.

I've done some research, and I found mainly two APIs that work to suffice our need of elevation data:

The MapQuest one will give us the opportunity to obtain an elevation chart, which will be useful in the future. I haven't studied a lot of the Google Maps one, but this one won't be free.

@PabloCanalSuarez PabloCanalSuarez added bug Something isn't working PRIO: Medium labels Mar 31, 2020
@PabloCanalSuarez PabloCanalSuarez added this to the Prototype version 1.0 + Documentation 1.0 milestone Mar 31, 2020
@PabloCanalSuarez PabloCanalSuarez self-assigned this Mar 31, 2020
@PabloCanalSuarez
Copy link
Contributor Author

Also, the MapQuest one gives us up to 15.000 free requests each month, so this is a good option.

@PabloCanalSuarez
Copy link
Contributor Author

All this data was obtained from the National Geographic Institute (IGN) of Spain and its manual.

@ElenaRodriguezRio
Copy link
Contributor

Leaflet has some plugins to represent elevation:

I think they would be an alternative worth exploring even though they don't have components for react

@PabloCanalSuarez
Copy link
Contributor Author

PabloCanalSuarez commented Apr 1, 2020

Those proposals doesn't work in our case. As this post in StackOverflow says, Leaflet is a map display library, not a data API, which means we cannot obtain this kind of elevation data from the markers in the map itself.

As some user posted in that forum, one solution is using the library MapBox, which would give us the elevation of any point by simply providing the latitude and longitude of that point. One example of use would be this one:

var MapboxElevation = require('mapbox-elevation');
var getElevation('YOUR-MAPBOX-TOKEN');

getElevation([86.925313, 27.988730], function(err, elevation) {
  console.log('elevation at the summit of everest', elevation);
});

@PabloCanalSuarez PabloCanalSuarez removed their assignment Apr 3, 2020
@ElenaRodriguezRio ElenaRodriguezRio added Small funtionality Funtionality that needs moderate time to get done and removed PRIO: Medium bug Something isn't working labels Apr 3, 2020
@ElenaRodriguezRio ElenaRodriguezRio modified the milestones: Prototype version 1.0 + Documentation 1.0 , Prototype version 1.1 + Documentation 1.1 (Presentation) Apr 3, 2020
@ElenaRodriguezRio ElenaRodriguezRio added the feature New feature to be developed label Apr 3, 2020
@ElenaRodriguezRio
Copy link
Contributor

This issue is part of #99

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature to be developed Small funtionality Funtionality that needs moderate time to get done
Projects
None yet
Development

No branches or pull requests

2 participants