Michael Connelly interview: The modern Raymond Chandler on Bosch, The Long Goodbye, and LA's neighbourhoods

Edinburgh has Ian Rankin, Washington DC has George Pelecanos – and Los Angeles has Michael Connelly

Los Angeles in November is still hot and bright, and Michael Connelly is in shirtsleeves as he watches the latest scenes from his crime series Bosch being filmed in the plaza outside police headquarters. It's a rare privilege for a show to be permitted to shoot at the LAPD's downtown base, but Bosch is a special case: Connelly's novels are read and enjoyed by many of the officers who work inside.

Between takes, the author is greeted by Titus Welliver, the actor who plays his fictional gumshoe, the dogged and irascible Hieronymus "Harry" Bosch; and by LAPD homicide detective Tim Marcia, who has been a consultant on his novels for years and now acts as an adviser to the show. Marcia is one of a handful of real cops who frequently appear as characters in Connelly's books.

In fact, it's hard to tell who is real and who is fictional on set, particularly since several of the extras are in fact genuine uniformed officers, working as background actors in their off-hours. "I always wanted Harry to be the only thing in the books that's not real," Connelly says. "I think the best way to sell a made-up character is to plant his feet into the real earth."

When I moved to LA in 2012, I read a handful of books about its history and culture, but crime fiction can be one of the best ways to understand the true nature of a city. Edinburgh has Ian Rankin, Washington DC has George Pelecanos, LA has Michael Connelly. Connelly's best-known characters, Bosch and his half-brother, defence attorney Mickey Haller – aka "the Lincoln Lawyer" – might as well be living, breathing Angelenos.

LA has also provided the setting for countless TV cop shows, but few take the city seriously as a location. Bosch, by contrast, is set in a fully realised LA that features far more than just Hollywood and the beach. In that regard, it resembles a selection of other recent shows in different genres, such as Love, You're the Worst, Togetherness and Bosch's Amazon stablemate Transparent.

Connelly, who splits his time between LA and Tampa, recently bought a cottage in the Hollywood Hills, a few blocks below the imagined house where Harry lives. He's still moving in when I visit him there, days after production on Bosch Season 2 wraps. There's barely anything in the house besides boxes, a desk, two chairs and framed posters for Bosch and The Long Goodbye.

It was the latter, Robert Altman's loose, 1973 adaptation of Raymond Chandler's novel, which first turned Connelly on to LA's mid-century crime fiction laureate and his celebrated creation, private eye Philip Marlowe. Connelly, who is 59, saw and loved the film in college, which led him to Chandler's books. "I wasn't fitting in well at university, and here was this story about a classic outsider who's suspicious of authority," he says. "Marlowe is a tough guy but soft on the inside, a mix of hopeful and cynical. There's something addictive about that in a character."

Connelly grew up in Florida and first set foot in LA aged 30, when he became a crime reporter at the Los Angeles Times, but, he says, "My literary heroes all wrote about LA: Joseph Wambaugh, Ross Macdonald and Raymond Chandler were the three writers that made me want to be a writer. And probably my favourite movie of all time is [Roman Polanski's] Chinatown."

The author was also so enamoured of The Long Goodbye that, for a while, he even rented the same apartment in Hollywood's High Tower Court that Elliott Gould's Marlowe had occupied in Altman's movie. "It was a romantic notion that only lasted about two-and-a-half years," he says. "The apartment wasn't air-conditioned, so it was brutally hot in summer, and there was barely any parking. But I wrote The Lincoln Lawyer there, with that movie a heavy presence."

When he first lived in the city, Connelly made a point of moving house almost every year; he estimates that he has lived in almost 20 different LA neighbourhoods. Harry Bosch, though, has always lived in the same spot on Woodrow Wilson Drive, in a stilt house with an enviable view of the city below. Connelly says he found the location while covering a real murder as a reporter.

"It was about 1989," he recalls. "A woman had been shot and left in the middle of the street, right in front of David Hockney's house. I was cooling my heels, waiting for the cops to tell us what was going on, and I started walking around the neighbourhood. I was writing the first Bosch book at the time. I found a spot where a stilt house had burned down, and they'd cleared away the rubble so that all that was left was the stilts and a platform. I built Harry's house on that spot."

Bosch's dark backstory, it turns out, was informed by yet another LA crime fiction master, James Ellroy. Like Ellroy, Bosch was raised by a single mother who was murdered when he was a child. Before allowing Bosch to solve his mother's killing in The Reversal (2010), Connelly sought Ellroy's permission to plumb his real experiences for inspiration. Ellroy has written two memoirs about his own mother's murder, which remains unsolved.

The first Bosch novel, The Black Echo, was published in January 1992, months before the LA riots, and Bosch came of age amid LAPD scandals such as the OJ Simpson trial. With US police forces again under the spotlight in the era of the Black Lives Matter movement, Connelly says he still sees it as a duty to acknowledge the social climate in his novels.

"I haven't worked for a newspaper in 20 years, but in a way I still view myself as a journalist," he says. "I want to tell stories that reflect how people are feeling. Harry lives by the idea that either everybody counts or nobody counts, and I think that's at the core of what's going on: some police separate themselves from the rest of society and people stop counting – so somebody can flash a knife, and they'll shoot him 16 times. That would never happen to Harry."

One of Michael Connelly's most famous creations, Titus Welliver as Harry Bosch, right

Connelly's responsibilities as an executive producer on Bosch meant he blew through his self-imposed annual deadline to begin a new book, but he is now at work on his 21st Bosch title. One of his other characters, reporter Jack McEvoy, the protagonist of The Poet (1996) and The Scarecrow (2009), is also in development as a screen project.

The author spent years waiting to reclaim the screen rights to Bosch, who was trapped in development hell at Paramount from 1995 to 2010. He had a better experience with The Lincoln Lawyer, which became a film starring Matthew McConaughey as Mickey Haller in 2011. But he is soon due to regain the rights to Haller, too, which means the lawyer may soon overlap with Bosch onscreen, as he has in several books including Connelly's most recent, The Crossing.

It's a cliché but nonetheless true: if Bosch and Haller are Connelly's most famous creations, their key supporting character is LA itself. "Bosch has allowed me to chronicle the evolution of a city over 20 years," the author says. "Because it's an entertainment mecca, this town breeds the cynical hopefulness that you see in Marlowe. I hate people thinking their city is unique, but there is a certain aura about Los Angeles; it's not necessarily a beautiful thing, but it's part of Harry Bosch."

'Bosch' Season 2 will be released on Amazon Prime Video on 11 March