Skip to main content
Question

OpenStreetMap PBF Reader: Get members of relation

  • June 13, 2017
  • 2 replies
  • 79 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é

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

jakemolnar
Forum|alt.badge.img

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!


jakemolnar
Forum|alt.badge.img

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