THE past few years have been a golden age for street food in New York City. You could get just about anything from a food truck in Midtown Manhattan — from waffles and schnitzel to halal chicken and lamb over rice — despite the fact that street vending is for all intents and purposes illegal there.

Last month police officers in Midtown cracked down and asked many trucks to leave their spots. Everyone is blaming a court case in May, in which a New York State Supreme Court justice reinforced a regulation saying that no “vendor, hawker or huckster” can sell merchandise from a vehicle parked in a metered space. But although enforcement was scattershot, that regulation has been used against Midtown food trucks for decades.

The crackdown’s real catalyst was the recent explosion of high-end food trucks in Midtown. For the first time, blocks were host to three or four trucks at once. And instead of the old-school food vendors, who are often immigrants used to navigating the gray areas of the business, most of these trucks were operated by a new breed of entrepreneur looking to capitalize on what (falsely) appeared to be the hippest, most profitable trend in the food business.

Food truck regulations have always been purposefully vague and selectively enforced in New York City. The government does not want to strip the city of one of its treasures (can you imagine a New York without hot dogs?) nor can it fully legalize street vending, because opening up hundreds of rent-free spots would damage the real estate economy.