Input : A GPS log P ,a distance threshold distThreh and time span threshold timeThreh
Output: A set of stay points SP={S}
i=0;pointNum=|P|; //the numner of GPS points
while i<pointNum do
j:=i+1;Token:=0;
while j<pointNum do
dist:=Distance(Pi,Pj); //calculate the distance between points
if dist>distThreh then
ΔT:=Pj.T-Pi.T //calculate the time span between two points
if ΔT>timeThreh then
S.coord:=ComputMeanCoord({Pk|i<=k<=j})
S.arvT:=Pi.T;S.levT=Pj.T;
SP.insert(S);
i:=j;Token=1;
break;
j:j+1
if Token!=1 then i=i+1;
return SP.