First, I apologize if this is very basic, but I can't seem to find out how to make this work. Additionally, I'm very new to FME so I'm learning as I'm going. This data is about a bike sharing program.
I have two CSVs, one contains the station IDs with Lat / Long, the other contains the trip information. Here are some of the columns (I've removed all the others for this question)
Station File:
station_id
latitude
longitude
Trip File:
trip_id
from_station_id
to_station_id
What I would like to go is add them to a (Geo?)JSON file, so each TRIP_ID contains a polyline geometry of the FROM and TO locations.
How would I got about doing this?
Best answer by daveatsafe
Hi @misterpoints,
This is definitely a case for the FeatureMerger transformer. This transformer will let you merge the locations from the stations file to the from/to stations in the trips file. You can then use a LineCombiner to combine the trip segments into a single line.
Two FeatureMergers are used in a row - one for the from points and one for the to points. You can set a different prefix in each merger to prevent overwriting the attributes.
The VertexCreators are used to turn the from/to location attributes into a line geometry.
Set the Group By in the LineCombiner to trip_id to create separate lines for each trip.
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.
This is definitely a case for the FeatureMerger transformer. This transformer will let you merge the locations from the stations file to the from/to stations in the trips file. You can then use a LineCombiner to combine the trip segments into a single line.
Two FeatureMergers are used in a row - one for the from points and one for the to points. You can set a different prefix in each merger to prevent overwriting the attributes.
The VertexCreators are used to turn the from/to location attributes into a line geometry.
Set the Group By in the LineCombiner to trip_id to create separate lines for each trip.
This is definitely a case for the FeatureMerger transformer. This transformer will let you merge the locations from the stations file to the from/to stations in the trips file. You can then use a LineCombiner to combine the trip segments into a single line.
Two FeatureMergers are used in a row - one for the from points and one for the to points. You can set a different prefix in each merger to prevent overwriting the attributes.
The VertexCreators are used to turn the from/to location attributes into a line geometry.
Set the Group By in the LineCombiner to trip_id to create separate lines for each trip.
This is definitely a case for the FeatureMerger transformer. This transformer will let you merge the locations from the stations file to the from/to stations in the trips file. You can then use a LineCombiner to combine the trip segments into a single line.
Two FeatureMergers are used in a row - one for the from points and one for the to points. You can set a different prefix in each merger to prevent overwriting the attributes.
The VertexCreators are used to turn the from/to location attributes into a line geometry.
Set the Group By in the LineCombiner to trip_id to create separate lines for each trip.
Wow thank you very much for your help, I didn't expect that much. I'm happy to see I was on the right path with my workflow, but I left out a second feature merger and I was using a wrong line transformer.
I got the output I wanted. If I use your model and connect up the Line Combiner to a reject and "accept" writer, it rejects 2000 of them, why I'm not sure, but that's not important at this point.
Now, I just have to put this file to use. Thank you very much.