leaflet-routing icon indicating copy to clipboard operation
leaflet-routing copied to clipboard

Routes on Ocean

Open vladejs opened this issue 8 years ago • 5 comments

Is there a way to calculate route for ships? I mean, given two points on map, calculate shortest (not mandatory) path without touching ground.

vladejs avatar Mar 13 '17 18:03 vladejs

Yes, absolutely, but you need to find/make a router backend in order for this to work. I suggest you take a look at https://github.com/pgRouting/pgrouting.

Starefossen avatar Mar 14 '17 09:03 Starefossen

So, is not possible by only using Leaflet to detect ground between two points? Maybe by calculating intercepting geometries on the path?

I don't care about route restrictions, what I only need to know is if there is a way using Leaflet to draw a path between 2 points without touching Ground. Doesn't matter if the calculated path is conceptually wrong for a ship travel, I just need to solve the problem: "Given two points on sea, draw a path wich doesn't touch ground"

vladejs avatar Mar 14 '17 13:03 vladejs

No, Leaflet itself does not know what is land and what is water on the map. It only knows about coordinates and how to display items within the grid.

Starefossen avatar Mar 14 '17 19:03 Starefossen

But, is it possible somehow to know given a polygon (a straight line for example, or a triangle), if it has intercepting features?

For example, I could detect geometries that intercepts the line, get their bounds, and re-draw the line so it pass through those bounds.

Is that doable with Leaflet? Thanx in advance.

vladejs avatar Mar 14 '17 20:03 vladejs

https://github.com/mehmetalpsumer/leaflet-sea-routes

miromel avatar Aug 04 '19 21:08 miromel