public static String geoHash(double longitude,double latitude,int precision){
		String[] base32 ={"0","1","2","3","4","5","6","7","8","9","b","c","d","e","f","g","h",
				"j","k","m","n","p","q","r","s","t","u","v","w","x","y","z"};
		int[] bits = {16,8,4,2,1};
		double[] long_interval = {-180,180};
		double[] lat_interval = {-90,90};
		int count=0;
		String geocode = new String();
		double latmid =0;
		double longmid =0;
		int bit =0;
		boolean even = true;
		while (precision> geocode.length()){

			if (even){ //if bit is even 
				//System.out.println(long_interval[0]+" "+longmid+" "+long_interval[1] );
				if (longmid < longitude){
					long_interval[0]=longmid;
					count+=bits[bit];

				}
				else{
					long_interval[1]=longmid;

				}
				longmid = (long_interval[0]+long_interval[1])/2;
			}
			else{
				if (latmid < latitude){
					lat_interval[0]=latmid;
					count+=bits[bit];
				}
				else{
					lat_interval[1]=latmid;

				}
				latmid = (lat_interval[0]+lat_interval[1])/2;
			}
			//After 5 bits find the base 32 
			if(bit%4==0 && bit !=0){
				geocode = geocode+base32[count];
				count =0;
				bit =0;
			}
			else{
				bit++;
			}
			even= !even;

		}

		return  geocode;
	}