Menu

Slope Analysis of Roads

  • Data Analysis
  • Algorithm
  • Geodata
  • GIS
  • Python
  • GDAL
  • CLI

In 2018 year, we helped our client from the micro-mobility industry analyze American and European city roads for the least amount of obstacles for their e-scooters.

We began by building a proof of concept in QGIS. It alowed us to find the best approach to solve the problem and demonstrate what kind of insights the business can get out of it.

Next, we developed a command-line tool to analyze the slopes of city roads. The tool processes SHP files (road data) with TIF files (digital elevation models) to produce CSV files with slope values and statistics for every road within a city.

Roads and Elevation
of San Francisco

In the example above, we used the following data sources:

Using these inputs, we were able to calculate slope values at every road point, taking into account the road directions (bearing values) and the slope directions (aspect values).

Lastly, we implemented the resulting algorithm in Python using common libraries such as GDAL, numpy, pandas, scipy. We applied a smoothing algorithm to reduce noise in the elevation data. The output of the algorithm includes two CSV files:

Slopes of San Francisco