Skip to main content

Exploring routing with 3D data in FME 2024: A Practical Tutorial.

Returning from a recent holiday in Ylläs, Finland, I decided to explore the latest features of FME 2024, specifically focusing on 3D and routing capabilities. Given my limited cross-country skiing proficiency, the idea for the routing project arose after spending a week attempting to minimize steep ascents and descents while navigating with two children in tow in the ski trailer. In this article, I’ll provide an overview of my initial impressions on the latest FME version and offer a straightforward tutorial on using FME for routing in a 3D environment.


Routing between 2 points in Ylläs area using only open data and FME.


Main steps and key issues :


      • Collect and visualize huge point clouds from NLS,


      • Create an FME-compatible network out of OSM data,


      • Drape the OSM data on the surface obtained from the point clouds to get 3D length,


    • Use ShortestPathFinder with weights based on slope.



Play with NLS point clouds of the area


This data is easily available through the NLS portal. Once the data is collected, FME 2024 is really faster to load the laz compared to just a year or 2 before.


Still, 4 tricks helped:


      • Filtering the ground points, for example with PointCloudFilter (ground is classified with class 2)


      • Clipping points to the specific area of interest with the Clipper


      • Addressing coordinate system discrepancies promptly. (warning new to FME2024 btw, thanks Hans van der Maarel )


    • Using PointCloudExpressionEvaluator creatively to simulate bigger elevation variations.

Play with OSM data

Next, I explored OSM data, a widely-used open-source mapping resource. One of its key features is the use of various tags. Despite its complexity, FME’s features helped streamline the process:

  • Envelope search : This allows to read only the data inside a rectangle you specified, saving a lot of time when you start with a file containing the whole country…
  • Feature caching + AttributeExposer : Leveraging Feature caching and AttributeExposer to handle dynamic attribute variations effectively. Here it helps a lot as OSM XML tags are flattened into attributes. A neat trick from 2024 for data validation, you can use the loaded data to import not only attribute names but their types.
  • GeometryPartExtractor : This little-used transformer allows to extract sub geometries of a certain kind. In this case, we are interested in the lines.
  • Ensuring topological integrity using LineOnLineOverlayer, with awareness of 2D data limitations.

Drape the OSM data on the surface obtained from the point clouds

With both datasets acquired, I draped OSM data onto the surface derived from the point clouds using SurfaceDraper, seamlessly blending 2D data with elevation information.

Use the new ShortestPathFinder with customized weights.

This transformer has come a long way with many performance improvements in the last few years and is now very handy. For very big datasets, I would still use pgRouting or a routing API if one is available.

The usage of this transformer is quite straightforward at first. Just provide a line made of your start and your end points, input the network, and pray..

In our case, to take into account the difficulty of the travel based on elevation, we created an attribute where length is modified in relation with how big the difference is between 2D and 3D length. OSM also provides a tag for this but it is not present all the time…

Side note : In 2024, there is a 3D mode for routing. This is useful if your data is really 3D like Digiroad data in Finland. In this case, when there is a way in a tunnel crossing another way a few meters higher, the 3D mode will make sure you are not “jumping” from one to the other during the routing. Of course, it does not really matter if you have good topological data to begin with. The other limitation comes from the lack of 3D snapping in FME.

Validity Check

By incorporating additional transformers and utilizing NLS ortho imagery, we can effortlessly compare our routing outcomes based on two criteria: shortest distance versus elevation-weighted routes. Personally, I lean towards the “green” option, prioritizing ease of travel, although I acknowledge that the scenic allure of the “red” route may appeal to more adventurous individuals.

Conclusion

The recent performance enhancements across all aspects of FME have significantly expedited the development and execution of 3D-aware routing tasks. This not only accelerates the process of building these automations but also improves their efficiency during runtime. If you’re interested in accessing the workspace used in this tutorial, feel free to reach out to us via our contact page at Spatial World.