mbasa / pgrServer

Routing service that uses pgRouting topologies and is loaded to a JGraphT graph for fast searches even with very dense networks such as OpenStreetMap (OSM) dataset.
GNU General Public License v3.0
26 stars 11 forks source link

Add network changes to the network #4

Closed EPajares closed 3 years ago

EPajares commented 3 years ago

Hi,

thanks a lot for this interesting project. I was wondering if it would be very difficult to implement a user-based network change capability into the project.

e.g. imagine one user would like to add a new network link to the graph and wants to perform routing operations with this changed graph. However, at the same time other users which are using the same graph should not be affected by this network change. Instead, their routing operation should use no changes or their own changes.

I was wondering if there is any direction you could point me in. As we are currently using a pgRouting for this but we would favor a solution loading the network in memory due to performance.

Cheers,

Elias

mbasa commented 3 years ago

Greetings,

This is a very interesting request and I willl think about it. This might entail an overhaul though since:

  1. there will be a need to list the additional table(s) that should be loaded into a graph during startup.
  2. and there should be a way to know which graph to use when making a routing request.

In the mean time, what can be done now is to create a new service: copy pgrServer.war into secondaryRoutingServer.war for example, drop it into Tomcat, and configure it to use the view/table that contains the user changes. Then, you can just point your specific users to the new routing service, while the rest can still access the original.

Regards,

Mario.

EPajares commented 3 years ago

Thanks Mario for getting back to this request. I understand. I was wondering if it could be implemented in a way that the same graph is used by several users but maybe a userid could tells us which links should be loaded for the particular user. As currently, we use such functionality for our application GOAT where several users can access the same graph which is in fact a database table as we use the pgrouting approach. As I am not familiar with JGraphT structure I am not aware if something like this could be implemented.

mbasa commented 3 years ago

From your description, pgRouting will be the best suited for your use-case because of its dynamic functionality in graph creation. Loading the entire graph into memory at startup makes pgrServer less flexible.

EPajares commented 3 years ago

Yes pgRouting is definitely the king concerning flexibility. I will explore a bit more possibilities of loading the graph in memory while allowing flexible "network patches".

Thanks in any case!

mbasa commented 3 years ago

Hello. Ok to close this issue already? Let me know if there's anything I can do to help.

EPajares commented 3 years ago

Thanks @mbasa! We can close this issue.

mbasa commented 2 years ago

Hello @EPajares. I know this is not your requested use-case, but I am able now to change route costs dynamically without having to reload the entire graph for every request, very much similar to car, bicycle, foot profiles of other routing engines. The requested cost can of course come from PostgreSQL. Just in case this might be useful for your project.

EPajares commented 2 years ago

This sounds great! Thank you for the update. I will have a closer look at it.