Minimalistic new routing profiles not based on highways (for rail or boat)

Hello to everyone,

I built a RailFlagEncoder suposed like here for my tracking usecases.

I would like to use different vehicles(trains and cars) to show tracking on the map.
It worked properly with a single profile, but when i use a combination of both rail and car profile in the same map matching application (graph.flag_encoders=rail,car), I got the problem shown in the picture. here visualised by graphhopper maps(GraphHopper Web)

rail routing bug on rail- and car profile gh

I would like to know:
Is it possible to have one graph-cache for car and rail at the same time?
can I use different customised FlagEncoders for railway or highway osm-tags in the same graph-cache?

thank you in advance for your help.

Is it possible to have one graph-cache for car and rail at the same time?

In your case this should be possible. E.g. foot and car is possible at the same time but still foot does not go on a motorway. So you somehow allow the rail going on highway type of “Straße 6”

btw: for GTFS & car: this is currently not possible:

building graph-cache without car is working fine…
may I somehow allow the rail going on highway type, but i can not see it.

I also add this :

        String highwayValue = way.getTag("highway");
        if (highwayValue != null) {//prevent routing over highway
            //LOG.warn("highway in railway " + way.toString());
            return 0;

with with no success after rebuilding the cache.

in the thread linked above you propose:

I did this by overriding isBackward and isForward to return always true. is that the right way to do?

btw: i using 0.9