Abstract:With the development of locationaware technology, the requirement of indoor localization becomes stronger. Indoor localization technology is rarely used under the linear environment so far. The SPMWKNN algorithm (weighted K nearest neighbor of short time path memory) is proposed to improve the efficiency of positioning in linear unstable environment. And in order to solve the problem of large variation of the wireless AP (access point), a wireless AP clustering mechanism is proposed which based on wireless AP correlation coefficient. The results of theoretical analysis and simulation show that the SPMWKNN algorithm aroused in this article effectively reduced the positioning time and improved the positioning accuracy in the linear unstable environment.