Routing Engine on Terria #6771
Replies: 1 comment
-
Dear @HeadCoachy , this is a great idea, but doesnt fit well within the current setup of Terria. Terria is more a way to federate existing datasets. Terria is really mostly written in the front-end, and a pgrouting directions API is really a backend thing. For example, If you wanted routing in your Terria instance, you really need an API to which you can submit a start and end point, and get a route in geojson returned. You could certainly build this with a postgres database populated with OSM streets data, and the pgrouting extension, and use express or some other javascript web framework to handle the web requests . Here is a good example that is open source and you may be able to use as a starting point this: https://github.com/imran-5/pgRouting-Direction-API . If you do not have the time to build such an API yourself, then there are existing commercial routing APIs available at cost - you might be able to call the Mapbox Routing API for example - see https://docs.mapbox.com/help/tutorials/getting-started-directions-api/#build-a-directions-api-request . But of course we recommend building your own using the great open source tools available! To get Terria to talk to such an API (either your own pgRouting one or the Mapbox example), you could build a plugin for Terria where users could specify that start and end point, make the call to the routing API, and then handle the response, i.e. add it to the workbench. This would result in the returned route being added to your map. We would possibly be interested in adding such a plugin to open source Terriajs for others to benefit, so please keep in touch and let us know how you go with development! |
Beta Was this translation helpful? Give feedback.
-
I would like to be able to use the pgrouting engine (https://pgrouting.org/) in an instance of Terria. Has this been done, has anyone used any other routing engine/algorithm. I am non-technical but my team is building an instance and this functionality would be very welcome.
Beta Was this translation helpful? Give feedback.
All reactions