The article introduces a method of finding optimal routes on raster planes. The method presented takes advantage of a new algorithm that tends to minimize a number of direction changes within a route, while steering clear of the obstacles. Two different schemes, suitable for restricted area Vessel Traffic Service (VTS) system and collision avoidance system located on the own ship are described. The VTS-oriented scheme supports VTS priority policy that may extend or override international give-way regulations. The own-ship routing scheme in a give-way situation is capable of determining the shortest safe path to the destination point. The method takes into account own ship dynamics. It has linear time and space complexities and therefore is sufficiently fast to perform real-time routing on the raster grids. Both the general method and the algorithm it uses are presented in detail in the paper. Implementation issues are also discussed.