reinterpretcat / vrp

A Vehicle Routing Problem solver
https://reinterpretcat.github.io/vrp/
Apache License 2.0
331 stars 68 forks source link

Geojson in py_bindings #106

Closed blaggacao closed 10 months ago

blaggacao commented 1 year ago

If this would hypothetically be an accepted feature...

Can you give me a couple of hints on how to implement and expose a conversion function from the solution returned by vrp_cli.solve_pragmatic to GEOJson format?

I'd be happy to give it a try and implement something (and do a PR, ofc).

reinterpretcat commented 1 year ago

Hi,

the new function should be added in this module:

https://github.com/reinterpretcat/vrp/blob/master/vrp-cli/src/lib.rs#L341

Example of geojson writing logic:

https://github.com/reinterpretcat/vrp/blob/master/vrp-cli/src/commands/solve.rs#L151

I think the main reason why it is not included it into interop API is that I haven't decided how API should look like for it.

reinterpretcat commented 11 months ago

This should allow to get geojson output from py binding in next version after 1.21.1: https://github.com/reinterpretcat/vrp/commit/d4aa289c7fb637ffe1f17c48f393ee2a572e09a4