Madrid is divided into 131 barrios (neighborhoods) which in turn are grouped into 21 distritos (
districts).
This type of dataset are very useful for spatial analyzes.
We organized the geographical information in geojson format.
You can download these files here
visit the page of this dataset in the Madrid open data portal.
We suggest also to enrich this dataset by using the socio-demographic indicators
The data is open data and is licensed under these conditions
The general conditions allow the reuse of data for commercial and non-commercial purposes. You have to cite the origin of the data as Madrid City Council and not suggest the Madrid City Council supports your work
Please read the complete license here in particular the section relative to the *Condiciones generales para la reutilización*