North Yorkshire market town ranks highly for access to green space and community spirit.