If the city used eminent domain to snatch it away from the farmer this wouldnt even be news.
If the farmer deeded it to someone else, like a neighbor, and said they could only use it to build a park, no one would expect that to apply once the government had yoinked it by eminent domain.
It follows then, that government entities really aren't bound by deeded restrictions. If you made them jump through some hoop, where they had to gift the land and then eminent domain it back, that would probably be more wasteful than just letting them do whatever they think is best.
The oddest outcome I can imagine is the government being able to compulsorily acquire other peoples property, but being permanently stuck with a fixed use asset that they cant do anything with that they actually own. Thats bonkers.