Context: I'm building a WebApp with OpenLayers that allows users to represent on a map their commuting trips by selecting a bus stop, choosing a bus line and finally selecting where they get off the bus.
My data consists of a Shapefile with Points (bus stops) and another Shapefile with MultiLineStrings representing every allowed segment between two bus stops. They contain information about bus lines, starting and ending stops, direction, etc. All this data is served from a GeoServer and retrieved through WFS to OpenLayers.
I've made an algorithm to get all the MultiLineStrings needed to represent user's commute and it works fine. So, if user travels from stop 0 to stop 4, my trip data consists in 4 MultiLineString Features.
Problem: I'd like to merge the n MultiLineStrings of a trip into a new single one Feature that represents the whole trip from end to end (because later I need the user to rate it and stuff...)
I've looked for some feature merging method in OpenLayers' API but I didn't find anything that helps me...
So, in short, is it possible to merge two or more features in a new one?