Find nearest point on each near by way

I have a requirement which I could do with overpass , if I ever get a local instance to run, but I am sure graphhopper could do this with not too much effort and would then mean I dont need to run a vast overpass instance.
I am using graphopepr extensively to calculate railway maps. To do this I need the nearest point on all ways within a given radius/bbox, i.e. the cloud of “platforms”, the nearest point on each of the ways near the station location. I then have to test all platform to platform distances between stations, then execute a simple algorithm I wrote to work out the best overall way (it will fail if we have to go more than 2 stations forward to work out the best route, but very few railways I have ever seen, and I’ve seen a few , would need that).
This process runs “offline” upon ingesting a new railway timetable. Requesting graphhopper for every platform to platform route between each station in what can be hundreds of stations is going to perform awfully on demand obviously,
I just want the genuine map-generated shape. In India for instance I have one service with over 400 stops!. I store all the platform to platform results for reuse. Next time we go between two previously analysed stations we will have all the platform to platform data ready. .
I need to do all this not just to ensure that we dont do crazy things like shunting back out of termini with a through platform we could have used, which will obviously happen if you just take a single point as the station, but more critically to cope with multiple gauges. There’s nothing in GTFS to say what gauge this is and it would be unreliable anyway. Stations with multiple gauges do not generally have sub stations for the different gauges encoded… I have to treat all metal as one. All the gauges are obviously independent networks, it works. Right now I am fetching all appropriate nodes from OSM and storing them in a Nodes table and querying that myself. Its simply not sustainable. Overpass will do but means renting an extra box just to be able to have it available, and I havent even managed to build it, it crashed when I gave it a decent lump of data despite hiring a 32 gig box and it spending hours starting up. If it needs more than that it can stay at home, and graphopper can load a massive OSM file much quicker than overpass anyway.
I will need to hire someone to do this, see previous post about failing to do simple stuff merging two encoders and adding a third trivial ferry one. If there’s an example of an extended API endpoint where someone has added their own service to do something like this, it would be a useful template. If I hire someone and we cant work out where the internal “get me nearby stuff” call is, we will ask.

doh, i meant to put those in dev, not api, if it matters please feel free to reassign this and the encoder post.

Powered by Discourse