 During this period, the courses of the Shinano and Agano rivers gradually changed until they poured into the Sea of Japan at the same location.As a result, Niigata prospered as a port town, serving as a port of call for Japanese trade ships traversing the Sea of Japan.The Matsugasaki Canal was constructed in 1730 to drain the Agano River area, but in 1731, flooding destroyed the canal and caused it to become the main current of the Agano River.