private String int2str(int value){
        if(value==512) return "N";
        if(value==1536) return "S";
        StringBuilder sb = new StringBuilder();
        int baseValue = value>>9;
        char base='E';
        char base2='N';
        switch (baseValue){
            case 0:
                base='E';
                base2='N';
                sb.append(base);
                break;
            case 1:
                base='N';
                base2='W';
                value -= 1024;
                sb.append(base2);
                break;
            case 2:
                base='W';
                base2='S';
                value -= 1024;
                sb.append(base);
                break;
            case 3:
                base='S';
                base2='E';
                value -= 2048;
                sb.append(base2);
                break;
            default:
                break;
        }
        for (int i=8;i>=0;i--){
            if(value==0) break;
            if(value>0){
                value -= (1<<i);
                sb.insert(0,base2);
            }else{
                value += (1<<i);
                sb.insert(0,base);
            }
        }

        return sb.toString();
    }