My novel Spanish Lavender is about the Spanish civil war, but because I am focusing on the exodus of people from the city of Malaga in 1937, the action could only take place in that city. More than that - the location is the reason I am writing it. When a friend told me about her parents and what they went through at the time, I was driven to find out more, not about the civil war in general, but about what happened in Málaga, the place where I was living. I could have set my novel in Madrid, Seville, Guernica or many other prominent places during the war, but it would have had to be a different story.
It was different when I wrote the al-Andalus trilogy. It was after visiting Córdoba in the year 2000 and seeing the ruins of Madinat al-Zahra that I decided to write a novel about that particular city. The action, the characters, the structure of the story all followed from that first desire to recreate life in that ruined 10th century city.
Location is particularly important in historical fiction, but in contemporary fiction, the author has much more lee-way. In some of my books the location is immaterial. In Palette of Secrets, set partly in England and partly in Marbella, Spain, I could change the locations without affecting the plot. Nancy’s early life could have been in Scotland, or the north of England instead of Kingston-on-Thames. Instead of running away to Spain she could just as easily have made her escape to France or Portugal. I chose Marbella because it’s on my doorstep and therefore I could write about it more convincingly.
Likewise in my forthcoming novel, a specific location is not that important. A woman who has been living in exile for twenty years decides to return to Spain after the death of Franco. Whether she chooses to return to Málaga or Madrid, Barcelona or Seville will not really affect the story’s structure, although it will of course affect the details and my research. More on this later, when I have a clearer idea of how her journey will turn out.
So next time you pick up a book, ask yourself what role the location plays in its construction. If it's Dan Brown's The De Vinci Code, could it be set anywhere but Paris? Did Hilary Mantel's books about Thomas Cromwell have to be in London? Is the author attracted by the location or is it immaterial?