On Wednesday, as many as 1.6 million Catalans formed a 250-mile-long human chain stretching from Catalonia's northern border with France to its southern periphery.

Large swathes of Barcelona were flooded in the red, yellow and blue of the estelada - the Catalan independence flag.

The event was designed to express the strength of Catalan nationalist ­sentiment, which has grown steadily since 2010, when the Spanish Supreme Court struck down the Catalan Statute of Autonomy - a document asserting Catalonia's right to determine its own constitutional future.

It is difficult to imagine a similar outpouring on the streets of Edinburgh or Glasgow, but in some respects ­Catalonia and Scotland are on parallel political journeys.

In November 2012, just over a month after Alex Salmond and David Cameron signed the Edinburgh Agreement granting Holyrood the power to stage a referendum on Scottish independence, Catalonia held an election to its devolved national legislature that returned a ­separatist majority.

This January, the Catalan parliament passed a second declaration of sovereignty and is now in the process of negotiating a referendum on independence from Spain.

As the debates over Scottish and Catalan self-government have developed, so too has the relationship between the Scottish and Catalan nationalist movements.

Over the last few months and years, a series of networks has emerged linking activists and politicians across Scotland and Catalonia. These networks share information and campaigning techniques, organise joint public events and lobby for greater autonomy alongside various national and sub-national groups throughout Europe.

One person who has been instrumental in this is Xavier Solano. Formerly head of the Catalan government's delegation to the UK and Ireland, Solano now works as an adviser to the SNP at Westminster.

His influence on the party has been significant. In 2008, he helped arrange a visit for Alex Salmond to Barcelona. In addition to meeting Jose Montilla, Catalonia's unionist president at the time, Salmond held discussions with Catalan nationalist leaders, including Josep-Lluis Carod-Rovira of the Republican Left of Catalonia (ERC) - a sister party of the SNP.

Since then, senior figures in the SNP have visited Catalonia on a semi-regular basis. Last year, Humza Yousaf, the Scottish Government's Minister for External Affairs, attended (albeit in an unofficial capacity) a summer school in northern Catalonia organised by pro-independence activists.

More recently, MPs Pete Wishart and Angus MacNeil have addressed nationalist seminars in Barcelona, while Angus Robertson, the party's Westminster leader and 2014 campaign director, has met Catalan politicians, think tanks and grass-roots organisations on a pre-referendum fact-finding mission.

As well as working within the SNP, Solano has tried to build broader cultural and political links between Scottish and Catalan independence supporters. "I have done my best to make sure the Scots know more about Catalonia and the Catalans have a clear idea of what's happening in 21st-century Scotland", he told me when we met recently in London. "Ties between pro-independence Scots and Catalans are increasing because the independence movements in both countries have become more mainstream."

A number of leading Catalan separatists have called for a referendum to be held as close to September 18, 2014 as possible. As Alfred Bosch, leader of the ERC in the Spanish congress, told me earlier this month: "It would be useful for us if the world could see both referendums at the same time - one conducted in a peaceful, legal way in the UK, the other in Spain being opposed by the Spanish government. That [contrast of] attitudes would really benefit us."

Bosch's attitude echoes that of the Council for National Transition, a body of experts and academics close to the Catalan Government, which has ­identified September 14, 2014 as its preferred referendum date.

Things may not work out according to this timetable. There is a growing concern among some Catalans that the commitment of their president, Artur Mas, to full political separation is weakening as negotiations drag on.

Nonetheless, given the current groundswell of pro-independence ­opinion across Catalonia, the possibility of a referendum over the next 12 months cannot be dismissed.

The grass roots of the Scottish and Catalan independence movements have grown more ever entwined.

Three years ago, in response to the Supreme Court's decision, a group of Catalans decided to stage a series of popular independence plebiscites. One of the groups invited to oversee the conduct of these was the Scottish ­Independence Convention (SIC).

In Catalonia, representatives from the SIC met with Anna Arque, the international co-ordinator of the referendum programme, and - together with nationalists from Flanders and the Basque Country - agreed to establish a pan-European platform to promote national self-determination. A year later, the European Partnership for Independence (EPI) was launched.

According to Chris White, SIC's ­European liaison officer, the driving purpose of the EPI is to "share good practice between organisations and exchange practical ideas".

Since 2011, the EPI has presented itself at the Catalan, Flemish and Belgian parliaments, as well as having organised meetings at Holyrood. Although most of its activity is focused at the European parliamentary level, it has facilitated a number of research trips for Scottish activists to Catalonia.

The SNP's landslide election victory in May 2011 was an important moment. "That was a game-changer," White says. "Suddenly other nations looked to Scotland to see what was possible."

Andrew Barr, a founding member of National Collective, the pro-independence group set-up by Scottish artists and writers, was in Barcelona last week and participated in the human chain. He believes the creativity and energy on display in Catalonia holds a lesson for the Scottish Yes campaign. "The Catalan independence movement is very visible on the streets," he says. "Supporters hang flags from their windows. There are frequent public gatherings … I'd like to see the Yes campaign in Scotland put more focus on cultural as opposed to economic arguments."

Barr is one of a new generation of independence activists keen to enhance Scotland's relationship with Catalonia. Another is Jonathon Shafi, a leading member of the Radical Independence Convention (RIC), the left-wing group responsible for last November's 800-strong conference in Glasgow.

Earlier this year, Shafi travelled to Barcelona to help establish a Catalan equivalent of RIC. "Over my three-day trip I held extensive meetings with left-wing activists and politicians," he says. "The idea was to build a working relationship with the Catalan movement."

In November, a Catalan delegation will fly to Glasgow to attend the second gathering of RIC and, after that, RIC activists will return to Barcelona for further discussions: "It's exciting," Shafi says. "We are trading ideas and strategies. We have a lot to learn from the Catalan left. Hopefully, co-operation will extend beyond the referendum."