This paper analyzed the spatial characteristics of tree-like river networks, and built vector model based on graph theory. The orientation of river was discriminated according to the angle of main and branch river, and the main stream and branch stream in the river networks were identified by the length of the main stream and the direction of the higher level main stream along the lower level main stream. The paper put forward the method of identifying the main and branch river and establishing Horton code of treelike river networks based on branch stream automatically, whi...