pt = new GPSPoint(lat,lng,northing,easting,userid,datetime,name,desc);
pt.comparePrePoint(lastPt);
Episode lastEpisode = trj.getLastEpisode();
if(tag.equalsIgnoreCase("B") || tag.equalsIgnoreCase("S")){
if(lastEpisode != null && lastEpisode instanceof Move){
lastEpisode.merge(new Move(pt));
}
newEpisode = new Stop(pt);
}
else{
if(lastEpisode != null && lastEpisode instanceof Stop){
newEpisode = new Move(lastPt);
newEpisode.merge(new Move(pt));
}
else newEpisode = new Move(pt);
}
trj.addEpisode(newEpisode);
i++;
}
}