I'm trying to identify the mountain roads in a route, and I've thought that a good approach could be get the paths with a very closed curve (like a U turn), but now I can not find any documentation about.

Do you know any idea, approx or some documentation or article where this topic has been covered?

The main idea is only know if a route has curve like the image below, or not. For this in my app I'm using PostGIS and Python and data (route path) comes from OSM.

enter image description here

  • 1
    What format is your data in? Do you have any kind of heading/direction information for points along the route? If so, you could define a U curve as a change in direction of ~180 degrees in less than some relatively short distance. If heading data isn't already available maybe you could work some basic geometry into your code that calculates this based on the x and y coordinates of the current point and the previous (or next) point. Feb 18, 2021 at 15:48
  • 1
    thanks @ycartwhelen, this is how I am approaching, I've segmented the line with shapely, iterate it, and compute if there is a radical change of bearing in the previous 10 segments (and 100meters) by the moment the results seem to be ok. Feb 18, 2021 at 15:55
  • Download ASTER Global Digital Elevation Model V003 from search.earthdata.nasa.gov Drape the road network on this. Find roads with steep slopes and/or high elevation
    – BERA
    Mar 5, 2022 at 18:09
  • This post may be of use to future readers of this question
    – Matt
    Mar 5, 2022 at 19:10


Browse other questions tagged or ask your own question.