convert the location into hash