Question

OpenStreetMap PBF Reader: Get members of relation

  • 13 June 2017
  • 2 replies
  • 14 views

Hi all

I'm using the new OpenStreetMap PBF Reader of FME 2017 to process some public Transportation data. I managed to edit the configuration file (osmconf.ini) to get the attributes I need and to read the ways, nodes and relations.

Regarding the Relations, I encountered the following Problem: The relation is shown as a polyline (in my case a relation connecting different bus stops to a route). However, I need to know which nodes (bus stops) belong to which Relations (bus routes). By using the tool "Overpass Turbo" (https://overpass-turbo.osm.ch), I can query this Information with the following query:

relation(6794709);

 

out;

Is there any Chance to get the list of nodes belonging to a relation in FME? Preferably by using pbf-files, but the OpenStreetMap XML reader or using an HTTPcaller on a site like Overpass Tubo (but with an [REST?] API would also be a possibility.

Thanks a lot!

Greetings

André


2 replies

Badge

Presently we don't preserve that information, but that's a good idea. If you raise a case with our support, then that will help us track the priority of adding this feature.

 

 

As a workaround for now, I might do this:
  1. Read the OSM PBF nodes and relations
  2. Get a bounding box for your relation
  3. Use that bounding box as a filter for your nodes with a SpatialFilter transformer
  4. Explode your relation with a CoordinateExtractor
  5. Match your filtered nodes to relation coordinates with a Matcher or ChangeDetector
  6. Combine matched node ids with a ListBuilder
  7. Merge the list with the original relation with a FeatureMerger

Hopefully that would help for now!

Badge

Presently we don't preserve that information, but that's a good idea. If you raise a case with our support, then that will help us track the priority of adding this feature.

 

 

As a workaround for now, I might do this:
  1. Read the OSM PBF nodes and relations
  2. Get a bounding box for your relation
  3. Use that bounding box as a filter for your nodes with a SpatialFilter transformer
  4. Explode your relation with a CoordinateExtractor
  5. Match your filtered nodes to relation coordinates with a Matcher or ChangeDetector
  6. Combine matched node ids with a ListBuilder
  7. Merge the list with the original relation with a FeatureMerger

Hopefully that would help for now!

This workaround above wouldn't help with the "role" part though: hopefully you could still get that by looking at the node type

 

 

Reply