The Taliban has vowed to disrupt elections in Afghanistan on 20 August and insurgent activity continues to take its toll on civilians and national and international forces.
This map is based on a confidential threat assessment map produced by the Afghan government and obtained by Reuters news agency.
The "areas of militant control" indicate Taliban strongholds; "high risk areas" where there has been major clashes with insurgents; and "medium" or "low risk" are where there has been some or little violence.
Although the map was produced in April, before an escalation of pre-election violence, much of it still corresponds with the latest updates gathered by BBC Afghan reporters and contacts in the country.
But the latest information gathered by the BBC indicate some subtle shifts in power. For example, the southern parts of Helmand are not now as insecure. Since April, the province has seen a major offensive by international and Afghan forces.
The BBC Afghan service suggests 234 out of the 368 districts are totally secure, nine totally insecure.
AREAS OF MILITANT CONTROL
Helmand is notorious for being the most violent and dangerous province of them all, where electors may be prevented from going to polling stations. With a number of districts under Taliban control some polling stations may not be operating.
Small Hindu and Sikh communities live in the province, many of which are likely to throw support behind Hamid Karzai.
Candidates likely to lead: Karzai, Ashraf Ghani, and some people see anti-drugs minister Merwais Yasini as a contender.
Kandahar remains one of the least secure regions
Kandahar is the home of Shahla Atta, one of two female candidates for presidential elections, as well as being home to current President Hamid Karzai.
It is not clear whether polling stations will be readily available in districts under Taliban control.
Candidates likely to lead: Karzai, Ghani, very little support for Dr Abdullah.
Zabul is often seen as neglected by the government and elections are expected to be problematic. The region is very dangerous with Taliban presence where undisturbed border crossings to Pakistan have caused problems.
Candidates likely to lead: Karzai, Mullah Rakiti (former Taliban)
Paktika is a remote area that has also suffered some neglect from the government which has allowed Taliban activity to flourish.
It is unclear whether polling stations will be readily available but candidates likely to lead there are: Karzai, Abduljabar Sabit, Ashraf Ghani.
As well as the other areas of Taliban dominance, including parts of Daykindi and Farah, the security situation in the mountainous Nuristan region is expected cause problems in getting registered voters to the polls.
Female candidates have been attacked whilst campaigning in the province.
Candidates likely to lead: Karzai, Ashraf Ghani, Merwais Yasini
HIGH RISK AREAS
Logar is home of presidential candidate Dr Ashraf Ghani, one of the three main contenders for the presidency.
Candidates have experienced threats from Taliban officials and the province is reported to be a high risk area with a Taliban presence.
Paktia, mountainous and very remote, can experience problems enabling registered voters to cast their votes.
It borders other neighbouring states that allows undisturbed border crossings for the Taliban with Pakistan, which may cause problems for elections.
A number of cases of election law violations by presidential and provincial council candidates reported in province.
Wardak is the home of Karim Khalili, one of two vice presidents to Hamid Karzai, also head of the Hesb-i-Wahdat party that enjoys strong support from Hazara communities.
Violence has been reported with some candidates attacked, making some districts high risk areas.
Local government has neglected the area, prompting a possible shift of support to Ashraf Ghani.
Some candidates in Khost have been attacked and one killed.
Seven cases of election law violations by presidential and provincial council candidates reported in province.
Other high risk areas include Uruzgan and Kunar.
The Taliban influence is not as strong in some provinces and although there have been some acts of violence, less disruption is expected.
In Laghman, a campaign manager for presidential candidate Dr Abdullah Abdullah was shot. Four cases of election law violations by presidential and provincial council candidates have been reported in province.
In Kunduz, one of vice president Mohammed Qasim Fahim's convoy was attacked with heavy weapons in northern Kunduz province.
A ceasefire was reached between local Taliban and Afghan elders in a troubled district of northwestern Badghis province.
However security remains high with some attacks on government officials in other districts.
Herat is considered a medium risk area for elections but due to recent surge in attacks in the build up to the elections, the province is looking vulnerable.
Kabul has suffered attacks in the lead-up to th election
Despite heightened security, there have been a number of attacks in Kabul in the run up to the elections. On Tuesday, 10 people were killed in a suicide car bomb attack.
The capital is the birthplace of Dr Abdullah Abdullah, one of three main candidates for the presidential elections, although the main candidates are all contenders here.
The very remote and mountainous Badakhshan region has recently experienced road blocks and has few major roads. This may cause problems with voters heading to polls. Elections commission has said they are working on the problem.
In Takhar, the province where Ahmad Shah Masoud was killed elections expected to run smoothly, although some violence has been reported.
While in Jowzjan, elections expected to run smoothly with wide support for Karzai due to General Rashid Dostum's influence in the region.
Hundreds of donkeys have helped carry election material to remote areas
Elections expected to run smoothly, but some violence has been reported in areas of Kunduz, Faryab, Baghlan and Nangarhar.
Fifteen cases of cases of election law violations by presidential and provincial council candidates were reported in Parwan.
Few problems have been reported in Samangam, Sar-e Pol, Balkh, Nimruz and Ghowr, although not many people are said to be very aware of the elections in that province.
Panjshir, home of Ahmed Shah Masoud, has strong support for Dr Abdullah, while the Hazara dominated areas of Bamian area are likely to throw support behind Karzai's vice president Khalili (who is also Hazara).