The balance between environmental impacts and traffic safety on roads