Essex, sweet Essex, most maligned of English counties. Keenly loved by most who live there, keenly loathed by most who don't. You might remember a Spitting Image song on the subject. "Essex, Essex, Essex is crap, / It's an absolute abomination", ran the chorus – like John Betjeman after too many cognacs – "Essex, may it fall off the map, it's a boil on the bum of the nation." That was 1986, and the county still struggles to shuck its shocking reputation. The Essex-girl-joke genre turns 30 this year and shows no sign of flagging (which sounds like the punch-line to an Essex-girl joke). In a 2005 newspaper poll asking readers to mark English counties out of 10 for landscape beauty, Essex scored zero. The county still gets disdainfully reduced to a handful of signifiers: stone-cladding and Tudorbethan mansions, heavy industry and light entertainment, the A13 and Southend Pier.

Here's an alternative account of the Essex landscape. At 350 miles, its coastline is the longest of any English county. Its medieval field systems, grazing marshes and ancient woodlands are among the best-preserved in Britain. Marsh harriers cruise its skies on the look-out for lunch, and bitterns pick their way through its reed-beds, placing their feet with the exaggerated care of mime artists. In Epping Forest, stags bell and rut within a few hundred yards of the M25. The Essex shoreline is an archive of defensive military history, on which Martello towers and second world war sea-forts survey each other. Out on the Dengie marshes – a vast coastal prairie of sea-lavender and glasswort – there is a powerful sense of openness, which is sharpened rather than blunted by the industrial horizon of Tilbury docks away to the south.

I know this, because last autumn I finished a year of filming in Essex with the BBC. The outcome of that work, which screens on Wednesday next week, is a film based on a book I wrote called The Wild Places. The book explores how and where wildness still survives in contemporary Britain and Ireland – and why we still need it. When it came to translating it to television, my director decided to keep much of the book's argument and language, but to compress its geographical focus to a single English county.

So began my Essex year. Nights spent at the location house in the piratically named village of Black ­Notley. Early morning starts to catch the sunrise, or the snowfall, or the dawn mist. My dreams of film-making glamour were quickly dispelled by the graft involved.

Lunch on a natural-history set, the dream: champagne and raspberries under a golden sun, on a beach in the Galápagos Islands.

Lunch on a natural-history set, the reality: part-frozen cream-cheese and oatcakes under a puddle-grey sky, in a lay-by near Basildon.

There were long days, starting at 5am and finishing after midnight. There were afternoons spent trucking up and down Essex A-roads under cold-tea skies, waiting for the light to break through. One day we went up in a helicopter to get aerial shots of the county. The helicopter – a Squirrel – resembled a transparent ping-pong ball mounted on a pair of chopsticks. Neither my safety anxieties nor my nausea were allayed by our cavalier pilot, who spoke of the helicopter as his "bird", and flew it as if he were auditioning for a Casevac role in M*A*S*H.

The biggest problem in Essex, we quickly discovered, was finding anywhere quiet to do my "sync" (pieces to camera). At one point, filming a sequence in a bluebell wood on the outskirts of Billericay, I found myself competing with a chainsaw, a motorbike, a van and an Easyjet flight. It took 23 takes to get a minute of clean sync in the can.

But there were compensatory excitements. There was the feeling of getting slowly under the skin of Essex, of starting to understand its charismatic contradictions and juxtapositions as a terrain. There were also incidents of startling beauty. Silver flocks of knots shimmering around the massive ­container ships that ply the upper Thames, peregrines soaring over power stations, and a day spent kayaking and swimming with the rust-coloured seals that live in the Walton-on-the-Naze backwaters.

The film was made with what's known in the trade as the Red One, a revolutionary high-definition camera whose latitude-tolerance and depth of field allow it to shoot cinema-quality images. This meant that we could never count on cutting away to archive footage, as the resolution discrepancy would be too obvious. So everything had to be filmed afresh. The team spent more than 100 days on location, watching and waiting for the county to reveal itself. Six days crouched in a marsh filming water voles. Four days in a hide filming deer. Five nights filming badgers in a wood, hoping the wind wouldn't swing round and reveal their position (it did, repeatedly).

We spent one November afternoon pursuing the vast flocks of Brent geese that over-winter on the Essex coast. Our aim was to get the elusive "two-shot" (natural-history-speak for when both presenter and creature are in the same frame). But the birds were easily spooked. Time and again the flock would take flight, before settling back down on a distant field. And so the wild-goose chase would begin again. For six hours, I lived in a cliché.

"Asphalt's parakeet" was Vladimir Nabokov's flamboyant description for an oil-rainbow in a pavement puddle. I kept recalling that phrase as we filmed in Essex, with its tight weavings of the human and the natural, the industrial and the wild. As the historian and writer Ken Worpole finely puts it, Essex is "memorable for its obstinate refusal to conform to conventional notions of what is beautiful . . . it is full of layered meanings and visual pleasures to those who give it the time and attention it deserves." And nowhere in England could better exemplify what Derek ­Jarman once called "modern nature": the mixed-up, messed-up, post-pastoral landscape in which most of us now live.