A new scan matching method for mobile robot localization is presented, which takes line segment as the feature and matches the real scans in the given reference map by relationships of the directional-defined line segments. The alignment was done by hierarchically identifying the multiple relationships and the result was recorded in a correspondence matrix, where the best match is defined and selected for localization. It is indicated that the searching algorithm of the best match can find the ambiguities and get rid of them. This method with less computational cost works well in occluded environment, and can correct the error in pose estimation without the need for the estimation itself. The efficiency, accuracy and robustness of this method were verified by experiments of localization in an occluded environment and a long-distance indoor navigation.