Skip to content

Smoothing of elevation #517

Closed
Closed

Description

@karussell

Discussed in #209 but should happen on import and GPL code is really a no go and we cannot reuse the core method from this issue - we cannot even look into it.

The smoothing should happen on import e.g. could be here #507

Relates to #384

Activity

  1. karussell commented on Sep 15, 2015

    @karussell
    MemberAuthor

    As noted from @ratrun the GPL code was replaced with his own smoothing method - feel free to submit this here as separate issue.

  2. ratrun commented on Sep 15, 2015

    @ratrun
    Contributor

    I don't think that it is good idea to generally include my smoothing algorithm, which improved the calculation of the total ascend and the total descend. The reason is that it also changes the value of the start and the end point. This is totally fine for the computation of the total ascend/descend, because the absolute values are of no importance, but I don't think that it is a good idea to use it in general. The algortihm I used basically comes from here: http://phrogz.net/js/framerate-independent-low-pass-filter.html. I run it twice: once forward and once backward and then I take the mean average for each single point.

  3. boldtrn commented on Nov 6, 2016

    @boldtrn
    Member

    Maybe it would also make sense to switch the elevation data source? It is possible to switch to 1 arc second data instead of 3 arc seconds, which might improve the data. For example there is the SRTMV3 data that is available in 1 arc second with filled holes. Also there are other sources like http://www.viewfinderpanoramas.org/ which is considered a high quality resource for dems.

    Maybe it would make sense to host our own smoothed version of e.g. the SRTMV3 data. AFAIK, the best smoothing can be done with mdenoise. The smoothing process is very hardware intensive, smoothing the SRTM data of the whole world, might take weeks, depending on the input parameters of mdenoise. See for example this paget that shows the impact of iterations. However we have to test if smoothing solves our dem related issues.

  4. karussell commented on Nov 6, 2016

    @karussell
    MemberAuthor

    Maybe it would also make sense to switch the elevation data source?

    This is another issue: #384 and the mentioned link uses stuff where the license is not clear for all areas.

    Maybe it would make sense to host our own smoothed version of e.g. the SRTMV3 data.

    Yes, would love to see this (probably in the other issue) and we could provide processing power (for hosting I'm unsure as this requires other stuff). And then we can see if this helps improving here too.

  5. boldtrn commented on Nov 6, 2016

    @boldtrn
    Member

    This is another issue: #384

    I found that issue after I commented here, sorry :).

    mentioned link uses stuff where the license is not clear for all areas.

    Ah, you are right. I forgot about that.

    However, some of the data was obtained from Soviet topographical maps that is not available for licensing, according to a blog post comment. Please use with caution. -- From https://wiki.openstreetmap.org/wiki/SRTM

    for hosting I'm unsure as this requires other stuff

    I could also host these on srtm.kurviger.de. I think the biggest problem here is to setup a workflow that does not run forever, but still provides better results than CGIAR and is repeatable (some sort of automation would be great).

  6. boldtrn commented on Aug 14, 2017

    @boldtrn
    Member

    I am not sure if this belongs here or into a new issue, but I think the reason for the following observations happens because of the missing smoothing.

    Currently the ascend and descend are incorrect. Have a look at this route.

    GraphHopper - ↗598m ↘316m, Google Maps - ↗296m ↘14m

    I have ridden this road many times, I don't know the exact ascend/descent, but there is not much descent if any (so Google Maps looks more correct to me).

    The same is true for this road: GH GM.

    In both cases the overall ascent-descent are pretty much the same, but the actual numbers differ. I am not sure if we actually need to smooth the elevation, but this would probably make the most sense?

    BTW: I have also seen the parameter calc_mean, however, It doesn't seem to fix the issue if I understand this correctly?

  7. karussell commented on Aug 15, 2017

    @karussell
    MemberAuthor

    I think the problem is not the smoothing it is more the precision of the elevation data which means that a cell of the higher areas overlaps the road and causes a big increase, see #384 for the related issue IMO.

  8. boldtrn commented on Aug 25, 2017

    @boldtrn
    Member

    I think the problem is not the smoothing it is more the precision of the elevation data which means that a cell of the higher areas overlaps the road and causes a big increase, see #384 for the related issue IMO.

    But this would be also fixed if we smooth the elevation for every way? For example we could define a maximum steepness per vehicle profile. When calculating the ascend and descend in the PathMerger we could "smooth" the elevation data, which could remove the spikes.

  9. karussell commented on Sep 2, 2017

    @karussell
    MemberAuthor

    There are three problems: gaps in the data (this is the reason we use CGIAR and not SRTM ala 90m), lack of precision (reason we should use SRTM ala 30m but there might be gaps although some sources say they are void filled, see #384) and lack of smoothing. I do not think that smoothing alone solves all issues but will help a lot. Also there is smoothing as a preprocessing step (will improve routing too) and smoothing per response (will be just cosmetic & improves the ascent&descent value but I do not like it much as it will make debugging harder)

  10. boldtrn commented on Sep 5, 2017

    @boldtrn
    Member

    smoothing per response

    Is this included in the current master? I have seen an approach by @ratrun, but I think we didn't merge it into the master, right?

    BTW: I also replied in #384 about the high precision data.

  11. karussell commented on Sep 5, 2017

    @karussell
    MemberAuthor

    smoothing per response

    Is this included in the current master?

    no, see his comment: #517 (comment)

  12. boldtrn commented on Nov 20, 2017

    @boldtrn
    Member

    I recently had a nice discussion with @dhowden and @tbillington regarding elevation smoothing. In contrast to the calcAverage method we currently use in the HeightTile we could try to create a Bézier surface (also see this link) from the hgt/tiff files.

    The HeightTile would contain a formula (surface formula) that would return the height of a point for a given lat/lon instead of storing the height information for each cell of the grid.

    The implementation is probably not straightforward and probably a solution like #1220 might be easier.

  13. boldtrn commented on Jan 7, 2018

    @boldtrn
    Member

    This should be close with #1220.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions