A COSMOS study of the structure and content of NGC 6822