The state capital before 1790 was Charleston on the coast of the Atlantic Ocean. In 1786, the legislature decided to move the capital to the center of the state, and the site of Columbia was chosen for its location on the river just 13 miles (21 km) northwest of South Carolina's geographic center. The State Legislature first met there in 1790. After remaining under the direct government of the legislature for the first two decades of its existence, Columbia was incorporated as a village in 1805 and then as a city in 1854. Columbia received a large stimulus to development when it was connected in a direct water route to Charleston, by the Santee Canal. This canal connected the Santee and Cooper Rivers in a 22-mile (35 km) section. It was first chartered in 1786 and completed in 1800, making it one of the earliest canals in the United States. With increased railroad traffic, it ceased operation around 1850.