Open micrtoeq opened 5 months ago
@micrtoeq,
DGF are changes made by me, the rest is the original
Appreciated. I will look in to this.
Joe
Originally discussed here. My thoughts:
I’m not sure what the best way to deal with this will be honestly. The ascent/descent values in question were added in a recent Pull Request and were pulled over from the Leaflet Elevation plugin that Waymark uses… but is not using the most recent version (I believe because of some conflicts I was not able to resolve a long time ago… but can’t quite remember).
So this is quite messy already and any other edits may compound the problem. I agree though that these values should be accurate and that user control over the measurement “frequency” (there is probably a more accurate term) would be a good solution.
Introduced in PR by @MaximeChallon.
Input/help welcome! This may have been discussed/addressed in the source project already so that's worth checking.
Hi
Ascent and descent values are too high, because they are calculated every 1 to 4 meters. They should be calculated in bigger walking distances. My suggestion is 10 meters.
I have adjusted the source code, which is pasted at the end of this message. Only what I have marked with DGF are changes made by me, the rest is the original. There are two functions in leaflet-elevation.js that are affected: _addData and _addPoint.
Best regards. Daniel.
/*
Parsing data either from GPX or GeoJSON and update the diagram data */ _addData: function(d) { let geom = d && d.geometry; let feat = d && d.type === "FeatureCollection"; let gpx = d && d._latlngs;
/*
Parse and push a single (x, y, z) point to current elevation profile. */ _addPoint: function(x, y, z) { if (this.options.reverseCoords) { [x, y] = [y, x]; }