Sunday, March 20, 2011

distance calculation between two ports with PostgreSQL and Postgis

I'm using PostgreSQL with PostGis and have shapes of all countries loaded.

How can I calculate the shortes sea route between two ports (without intersecting a country shape)

is there a 'standard solution'?

From stackoverflow
  • you could use graph theory so long as you have a set of sea-lane type way-points defined. these would be points along the ship travel lanes with maybe nautical miles between each one indicated. then use a min path algorithm to find the best travel lane.

    of course inreal life this problem has many more variables than just distance i would think.

    dodiddone : hmm, I thought about this but it would require a sheer endless amount of connections
    Randy : so how do you envision the calculation? it can't be the great circle distance, because land masses are in the way. Where should the ship go if it encounters a land mass? tightly follow the coast?

0 comments:

Post a Comment