A lot of farmland near or in heavily populated areas are there because they were there before those areas became heavily populated. Most recently, though I've had MANY experiences like this, I lived on the outskirts of a city. For simplicity, if my house were on the "border" then everything south of me was city and it was all farmland to the north. The farmland outside my back door went up for sale at a very high price per acre (and no, you couldn't buy some of it, only all of it) in the hopes that it would attract a developer. It did eventually but we moved before that happened, thankfully. I can recount many stories like this from my past since I always preferred living in the country or as close to it as possible when that wasn't a real option for me.
Anyway, cities end up surrounding farmland all the time until the price of the land goes up so high that the farmers sell out because it makes no sense not to.
No point from me, really, just sharing something that is probably obvious to some of you. Carry on.