City officials and advocates for the homeless had spent much of Thursday urging people in encampments to go to shelters.