Spatial analysis of the rural-urban structure of the Spanish municipalities

: The rural–urban dichotomy is one of the most debated topics by the scientific community in territorial issues. In addition, many public entities and scientific studies have established the distinctive elements of rural and urban spaces by relating the decline of the rural ones with factors such as aging, low birthrate, the primary sector, unemployment, or poverty, among others. Therefore, the purpose of this paper is to spatially study the current model of territorial organization of Spanish urban and rural municipalities as well as their demographic and socioeconomic characteristics. To this end, GIS (Geographic Information System) tools were used to carry out a spatial autocorrelation (SA) analysis and to identify homogeneous groups of the variables considered. In conclusion, there are different demographic and socioeconomic realities in Spain, an urban one located on the coast with a positive situation and, on the other hand, a regressive reality composed of rural municipalities, among which there are villages whose situation is worrying, mainly located in the north of Spain.


Introduction
The depopulation of European rural areas, and more specifically in our case study, Spain, is a huge challenge and constitutes one of the most current issues of numerous disciplines [1]. The rural exodus has taken place in Europe since the early decades of the second half of the twentieth century. Many people, especially younger people, have migrated to the cities looking for job opportunities, improved quality of life, and higher wages than in the countryside. Over the years, the exodus to the urban in combination with the negative natural growth has led to an unstoppable dynamic of population decline in many EU regions, which, in addition, generates substantial gaps between regions of the same country [2]. As a result, Europe is currently facing a scenario of demographic deserts, with predominantly rural regions that house 28% of the population and just over 90% of Europe's territory [3]. The problems of exodus, aging, remoteness, lack of educational facilities, labor market problems, decline in the number of young people, access to public services, lack of competitiveness, and economic innovation have been identified as the main elements of poverty in rural areas [4]. All of these negative shortcomings define regions located mainly in Eastern European areas, the Baltic States, and Southern Mediterranean countries (Greece, Portugal, Bulgaria, Romania, Spain, and Southern Italy) [5]. In this way, it is clear that if current economic and demographic trends continue, an increasing number of regions can be expected to be classified as "less developed" [6,7].
There are numerous papers and reports that have analyzed the phenomenon of rural-urban migration and rural depopulation in Europe [7][8][9][10] and different theories abound, but they all have a common denominator: the causes of depopulation are not natural, but political and economic [11]. There is a great number of the population that leaves rural areas due to the poor economic resources of the agricultural sector [12] and goes to urban and industrial territories with more opportunities of employment, better quality of life, leisure, and educational and sanitary public resources [13]. The population emigrates from the rural areas furthest from the urban spaces, since those who live in towns near the main communication routes and dynamic urban centers [14] continue to live in their hometowns and travel daily to work. This emigration is more pronounced in the young and female population groups [15][16][17], which produces the aging of agricultural spaces [18], masculinization, and a tendency for them to disappear because achieving generational replacement is difficult due to low birth rates [19][20][21].
In Spain, authors such as Camarero [22], Collantes et al [23], Pla and Cos [24], Hoggart and Paniagua [20], Del Molino [25], Gozálvez and Valero [26], Roquer and Blay [27], or Nieto and Gurría [28] have determined that the main Spanish cities have been nourished by the surplus population of rural areas since the mid-twentieth century as has been the case in other regions of Europe. This has led to increasing demographic contrasts with a growing duality between rural and urban spaces. In this way, in Spain, the most ruralized spaces have been located mainly in regions of the interior of the country (in Castilla y León, north of Castilla-La Mancha, Galicia, and Aragón) [29]. In addition, the main urban centers are concentrated in the coastal areas and in the industrial centers enhanced by the development plans of the Franco dictatorship [30,31]. The causes of demographic emptying have been fundamentally economic: there is a large population that leaves rural areas due to the low economic profitability of these spaces because of the crisis of traditional agriculture [32] and goes to urban territories that offer them employment and better living conditions [33,34]. The population emigrates from the rural areas furthest from the urban spaces, since those who live in towns near the main communication routes and dynamic urban centers [14] continue to live in their hometowns and travel daily to work. This emigration, mainly of young people and women [15], has produced masculinization, aging, and low birth rates in Spanish rural areas, a trend that if it continues in the next decades, could lead to the disappearance of these areas because there is no generational replacement [20].
In the past century in Spain, the first rural exodus was due to the economic crisis of the rural spaces in which the agrarian structures were not modernized, maintaining in them the traditional exploitation model. This was between 1960 and the end of the 70s, a period in which the highest volumes of field-city migration occurred, especially from the regions of the Spanish Plateau (both Castillas, Extremadura, and Aragon), whose population moved abroad or to more industrialized Spanish regions such as País Vasco, Cataluña, or Madrid [35]. The second period runs between the 1980s and 2000 due to the late effects of the oil crisis of 1973 and the industrial reconversions in the northern regions of Spain such as the País Vasco or Asturias in the early 1980s, urban areas entered a certain period of economic crisis and could no longer accommodate a more agrarian population [36], so rural spaces continued to lose population, but at a slower pace. This loss of population was more pronounced in areas of the interior of the north and Plateau. During the first decade of the 21st century, all Spanish provinces earned or maintained their population due to Spanish economic growth, favored by positive international migratory movements, except the more rural areas (less than 500 inhabitants) that continue to lose significant volumes of population. This is a demographic and economic growth period that lasts until the last world economic crisis of 2008, in which Spain reached its maximum population (more than 47 million inhabitants [34]). In the current decade (2011-2019), most of the Spanish provinces had lost population due to the drastic reduction in the number of immigrants and a very sharp negative vegetative growth in the regions with the most rural population [14].
Since the entry of Spain into the EU, and especially in recent decades, various policies and strategies have been designed to alleviate the depopulation process in rural areas such as the Common Agricultural Policy (CAP) [37], the Rural Development Policy [38], or the European Structural and Cohesion Funds. These European aids have been complemented with state economic development plans (for example, agricultural subsidy) as well as regional ones, in order to try to increase employment opportunities and improve living conditions in the rural spaces, preventing young people from leaving their home regions [39,40]. Specifically, the Community Agricultural Policy and agricultural subsidy intend to increase the income of small farmers; the rural development aims to introduce complementary economic activities related to tourism, heritage, and crafts, etc. Finally, structural and cohesion funds seek to improve infrastructure (road network in spaces that were practically inaccessible before the 80s such as mountain areas) [41] or create public resources such as networks of rural schools or health and dependency centers, so that the rural population can have the same living conditions as the urban population [42].
Additionally, the European Committee of the Regions has proposed a series of measures that should be promoted within both European aid and national public policies in one of its latest reports (2017), in order to reduce the imbalances between rural and urban areas and provide a boost to prevent the depopulation of rural areas. These measures are actions to encourage productive activities and employment, policies to support families and measures to reconcile work and family life, aid for the maintenance of schools, facilitating the emancipation and permanence of young people; integration measures for the immigrant population and equality between men and women, support for the maintenance of health services as a particular means of supporting independent living, ensuring mobility through the so-called {"transport on demand" approach. Furthermore, it is important to take into account the European Territorial Strategy [43], which bets on the creation of first level interconnected cities and on the cooperation between cities and countryside, in order to reinforce those areas that act as functional focal points of the rural environment and to correct territorial and environmental imbalances [44].
In this way, the hypothesis of this work is that during the last two decades in Spain, the various European and National policies and initiatives have contributed to improve the living conditions of the more ruralized spaces and, consequently to reduce its regressive demographic trends, especially in the interior areas.
The main objective is to analyze whether the process of the depopulation of the interior Spanish rural areas has decelerated and study to what extent variables such as aging, negative population growth, accessibility, employment, and wealth characterize them, because the generally accepted causal factors that explain the depopulation processes include these variables [11].
To this end, Spanish municipalities and their demographic and socioeconomic characteristics have been studied in a GIS in order to verify which elements define rural and urban spaces. The spatial autocorrelation (SA) index was calculated to check if there were spatial associations of municipalities with the same trends. This index has been used in numerous and varied studies such as those that investigate the development of the concept from a geographical perspective [27] and in different scientific areas of social [45] or environmental sciences [46][47][48][49][50]. In addition, using this type of analysis, there have been studies by Nieto and Cárdenas [40] and Nieto et al. [51], in which they analyze the socio-sanitary offer in regions of low population density and the distribution of the investments of the LEADER approach. Furthermore, bivariate correlations were calculated to establish relationships between pairs of variables without taking into account the spatial location. With the results obtained, it will be possible to determine the current situation of rural and urban municipalities in Spain, check if the trend toward depopulation is maintained by locating the territories with the most worrying situations, and what variables are conditioning it by the different methodologies employed.
The importance of this research lies in the fact that Spanish rural areas are located and characterized, which have worrying data in terms of demography and economy and are, therefore, areas in which more political, economic, and social resources must be invested, since they cover a large part of the Spanish territory. As for the novelty of the paper, interesting and useful GIS techniques such as spatial autocorrelation, accessibility analysis, and interpolation were used, which have been little used in the social sciences.
Hereafter, the materials and methods of this paper are presented, followed by Section 3 where the results obtained are shown. Then, the results are discussed in Section 4, where our conclusions are presented.

Characteristics of the Spanish Territory
Geographical factors, especially the relief and climate, have been composing landscapes, resources, lifestyles, social, and political organizations in Spain over time, affecting the conformation of their territories, which are different from each other according to their stage of development.
Thus, during the last 40 years, the differences between regions have been shortened, especially thanks to the financial assistance received since Spain entered the EEC (European Economic Community) (EU (European Union) currently). However, the economic data continue to reveal a significant delay in Spain with respect to European socio-economic averages as well as regional differences. In Spain, territorial and economic development is concentrated in traditional industrial development hubs, mainly in northern coastal regions (Cantabria, País Vasco, and Navarra) and in commercial areas of the Spanish east, especially in Catalonia. Moreover, in the last few decades, the urban development of the Spanish coast in relation to tourism activity seems to have been encouraged either with private or public investment. Furthermore, regional disparities are increasing again due to the current economic crisis and restrictions on public and private investments. Those regions with a less diversified and active economy such as Andalucía, Extremadura, Castilla-La Mancha, Castilla y León, and Galicia are becoming impoverished [52].
From the physics and socioeconomic points of view, the following Spanish regions ( Figure 1) were identified, depending on their different growth [53][54][55][56]:  Cantabrian coast. This is a space with an oceanic climate, abundant vegetation, and wide coastline that presents a diminished productive homogeneity. In this region, the cities form three subsystems (Gijón-Oviedo-Avilés, Santander, and Bilbao-Vitoria-San Sebastián) with great economic development related with an industrial and tertiary sector.  Ebro Valley. It is located diagonally between País Vasco and Cataluña, centered in Zaragoza, and well connected with Madrid, so it benefits from this unbeatable location. This region has good road infrastructure with the largest flows of goods and travelers from the Spanish State. Its productive composition is characterized by intensive agriculture, an outstanding industry, and services focused mainly on transport. The great urban center is Zaragoza and the GDP (Gross Domestic Product) is higher than the national average.  Mediterranean axis. This axis extends from Cataluña to Almería. Development levels clearly descend from north to south. It is an axis linked to the great axis of southern Europe or the Mediterranean with good infrastructure, high flows of goods, and travelers, powerful cities, and metropolitan areas (Barcelona, Valencia, Alicante-Elche, etc.), high population density, and diversified productive structure (agriculture in Almeria, Murcia, and Valencia with agroindustry supported by SMEs (Small and medium-sized enterprises), important export economy, tourism, etc.).  Andalucía. Some authors include it in the Mediterranean axis [57]. It is a space with great possibilities because it is a connection land between Europe and North Africa. However, political strategies are not aimed at this. For example, the construction of the A92 highway, which is the backbone of the community but inside, leaving the Mediterranean coast off the hook despite its urban, tourist, and agricultural importance. Thus, Andalucía shows signs of being the periphery of the periphery (of Spain and Europe) in all socioeconomic variables.  The Plateau. This is a space formed by the plateaus of Castilla-La Mancha, Castilla y León, and Extremadura. These regions present the worst socioeconomic perspectives: low population densities, production and incomes below average, high agricultural rates, little industry, and public services that do not reach 30%.
 Madrid. This is a small territory in the middle of the Plateau that has grown thanks to being the capital of the country, thus has received strong investments, agglutinating a large part of the officials, strengthening infrastructure, leisure and cultural equipment, industrializing and accumulating advanced services and headquarters of large financial, commercial, and technological companies. It exerts a great power of attraction of the main business movements and is an obligatory knot of communication (especially aerial) as well as having great influence on the entire Plateau and even Andalucía.  Archipelagos. They constitute their own spaces with characteristics closely linked to tourism. Baleares (in the Mediterranean Sea) stands out for its high socioeconomic power linked to tourism with high purchasing power.

General demographic characteristics of the Spanish Regions and Municipalities
In Figure 2, the evolution of Spanish population growth can be seen in four fundamental historical moments (1960-1980, 1980-2000, 2000-2011, and 2011-2017) that have been commented on in the introduction. The regions surrounding the capital of Spain (Madrid), located in the Plateau (Extremadura and both Castillas), have lost more than 20% of their population over the last 20 years. In contrast, regions on the Mediterranean coast or in the north have gained more than 40% (in some cases such as Barcelona, Valencia, Madrid, or Bilbao, it has been more than 50%). The migrations that took place during these decades were mostly inland and involved a considerable transfer of the population from inland areas to the coast.
In the second period, the migratory processes slowed down. Cities no longer needed so many workers because the Spanish economy underwent a hard adjustment after the world oil crisis in the 1970s that produced an increase in urban unemployment levels [58]. In this way, in these 20 years, the demographic losses have been reduced and the highest values are located in Galicia, Castilla y León, Aragón (Huesca and Teruel), and in the north of Extremadura, with losses mostly between 5 and 10%. In the previous period, the losses were over 20-30% in most of these regions.
During the first decade of the 21st century, depopulation in rural Spain slowed down, especially in the eastern half of Spain (Castilla La Mancha and Extremadura) due to the very fast economic growth of the Spanish economy (which meant the massive arrival of immigrants to Spain during these years of economic boom). In contrast, in much of the western half of Spain, the rural areas continued to lose population in absolute terms, although at a slightly lower rate (less than 5%) and more markedly in four provinces of Castilla y León and two in Galicia. Then, in the current decade (2011-2019), most of the Spanish provinces lost population due to the drastic reduction in the number of immigrants and a very sharp negative vegetative growth in the regions with the most rural population (the most negative values were in both Castillas, Galicia, and Aragón, with losses exceeding 5%). This was mainly due to the consequences of the last world economic crisis of 2008. Following the rural-urban delimitation established by the NSI (National Statistics Institute), Spanish municipalities, which coincide with the European delimitation of local administrative unit (LAU) 1, are classified as rural (less than 2000 inhabitants), intermediate (2000-10,000 inhabitants) and urban (more than 10,000 inhabitants). The population statistics for the last 17 years are shown in Table 1: In Table 1, it can be noted how the number of municipalities with less than 2000 inhabitants in 2018 decreased when compared to 2001, and 1.59% of rural municipalities became intermediate (2000-10,000 inhabitants) in 2018, which can be considered as an achievement. However, these numbers reflect an illusory situation, since, although the number of rural municipalities is smaller, they have also decreased their demographic weight compared to the Spanish total (in 2018, they had 5.7% of the total population and 7.3% in 2011). They also had the highest negative population growth statistics, since they have lost 15% of their population from three million inhabitants who have lived in rural municipalities from 2001 to 2.7 million in 2018.
It can be seen in the previous table (Table 1) how in 2011, the effects of the economic crisis in Spain were not very hard yet, since both intermediate and urban municipalities showed population growth when compared to 2001. In 2018, all three municipal typologies presented demographic losses, much more pronounced in rural areas (with a loss of 15 %) Spain has lost population in the last three years, something that had not happened since the middle of the last century during the Civil War and the first post-war years. The population debility is because the natural balance was negative due to the low birthrate and the high rate of aging. In addition, for the first time, the migratory balance was also negative (Spain received fewer immigrants than in previous years and there were more people who had left the country, especially qualified young people, according to the NSI data). These problems are more pronounced in rural areas. Figure 3 shows where, at the municipal level, the largest volumes of rural population are concentrated and the unequal distribution of the population at present (2018). With the data obtained from this map, it was obtained that 87.8% of the Spanish population is concentrated in 1300 municipalities, which occupy 30% of the territory (municipalities with more than 5000 inhabitants); the remaining 30% of the territory is inhabited by the remaining 12.2% of Spaniards, with 5.7 million people in municipalities with less than 5000 inhabitants.
The rural municipalities (less than 2000 inhabitants) are mainly located in Castilla y León, Castilla-La Mancha, Galicia, Asturias, North of Extremadura, Teruel, and La Rioja in the areas of the interior of Spain, located mainly in the Plateau (more than 5900 municipalities). In these regions, more than 1400 municipalities have less than 100 inhabitants, which are those that present the greatest tendency to disappear. In contrast, in the coastal areas of the Mediterranean (Cataluña, Valencian Community, and Murcia), the capital of Spain, and the most industrialized areas of northern Spain (País Vasco, Cantabria) have the highest concentrations of population and only 63 municipalities have over 100,000 inhabitants (40% of the population).

Methods
In this paper, the databases were first developed with the variables considered as defining the rural areas such as unemployment rates and agrarian unemployment rates, per capita incomes, population aging, geographic isolation, and communication system, given that, as has been commented in previous paragraphs and with the numerous papers reviewed, these variables may be conditioning the existence of a concentration of very ruralized municipalities with a tendency to disappear in certain Spanish territories. Second, the spatial autocorrelation was calculated with the Local Moran's I statistic to locate spatial clusters with the same values. Finally, bivariate correlations were calculated to establish relationships between pairs of variables without taking into account the spatial location. This statistic is calculated to know which variables have the highest degree of codependence with each other and to ascertain if municipalities with less population (rural areas) are more characterized by related variables such as old age, poor accessibility, and worse economic conditions (higher unemployment and lower income) than areas with more population (urban areas).

Alphanumeric and Cartographic Dataset
First, an alphanumeric and cartographic database involving the variables chosen to be analyzed on the demographic, economic, and social situations of the Spanish municipalities was constructed. These variables were:  Demographic data obtained from the different population registers of the years 2001, 2011, and 2018 of the NSI. In addition, the old age index, the percentage of population growth, and population density were calculated with these population data.  Data of job seekers. These were obtained from the Public State Employment Service (PSSE) for 2018. The unemployment rate was calculated taking into account the possible active population (population between 16 and 64 years old) because the data of the active population at the municipal level were not available. The percentage of job seekers by activity sectors was also calculated to study that corresponding to the primary sector.
 Economic variables published in the Experimental Atlas of the National Statistics Institute. The average income per capita of 2016 was the chosen variable to be analyzed.  The national roads and the main road network of Spain were obtained from the National Download Center (NDC) of the National Geographic Institute (NGI) cartographic information on transport networks in 2019. Then, the database, which was created with five demographic and socioeconomic variables, was assigned to a cartographic database in a polygonal shape of the municipalities of Spain from the National Topographic Base at the scale of 1:100,000. Errors in the morphology and structure of the polygons that refer to the administrative limit of each municipality were adjusted, since spaces without information were found throughout the Spanish territory. The resulting final layer, with 8205 municipalities, was used as a cartographic base to perform geostatistical analysis and show the results through a GIS. With a GIS, the alphanumeric information is associated to a set of graphical information in maps, being able to visualize the data or variables "on the territory" [38]. A GIS is one of the most appropriate information management tools, since it allows for the association of alphanumeric variables to a set of cartographic information, and is a perfect tool to study the spatial location [59][60][61], distribution, association, interaction, and evolution [62,63] of the Spanish population as well as a suitable multiple conditions analysis tool [40,64].

Accessibility Calculation
In order to obtain the accessibility, we calculated the time taken from the rural municipalities (less than 10,000 inhabitants) to the main urban areas (more than 10,000 inhabitants). For this, it was necessary to transform the polygonal layer of the rural population centers of the municipalities, without taking into account those disseminated, to a dot layer that represents the centroids to later calculate their distance to the closest urban center (using the vertices generated).
It is necessary to note that the study of accessibility is based on graph theory (these are a collection of nodes) [65,66]. The nodes correspond to the centroids of the rural and urban population centers, which are connected by edges that are all communication paths. Thus, it is possible to know which node is attached to each edge to calculate the travel time between both nodes. Considering this, the minimum travel time of each population center to the nearest point of the urban centers was calculated in this paper. For this, it is necessary to know the hierarchy of the network and rely on impedance, since it is a fundamental element in the study of accessibility [67].
The impedance is calculated knowing the length (km) and the way speed (the maximum allowed in each type of road), in the following expression (1) The impedance is obtained in minutes and the minimum time for a vehicle (in this case, a car) from a population center to the nearest urban center is then obtained with network analyst tools from a GIS.
Subsequently, the IDW (inverse distance weight) method was used to capture the minimum travel time on a map, which allows interpolating the cell values by combining a set of points to determine the inverse distance of these values. The IDW equation or "Shepard method" is Equation (2) ( , ) = (2) where n is the number of dispersion points in the set; fi is the values of the functions established at the dispersion points; and wi is the weighting functions designated to each dispersion point [68]. The weight formula is Equation where p is an arbitrary positive real number named as a power parameter (typically, p = 2) and hj is the distance from the dispersion point to the interpolation point, given by Equation (4) where x and y are the coordinates of the interpolation point and xi and yi are the coordinates of each dispersion point [51,69].
The interpolated surface has to represent a location dependent variable. In this way, this method tolerates that the variable represented cartographically has a decrease in its influence, according to the location of the sample at greater distance. Therefore, the best results of the IDW method are obtained when the sample is dense with respect to the local variation, so the samples of points that are dispersed will not represent the desired surface. For this reason, the IDW method is suitable in this research.

Spatial autocorrelation analysis
To determine the SA of the different structural variables of Spanish municipalities and the existence, or not, of clusters or concentration patterns in terms of homogeneous or opposite values, the Global Moran's I statistic was used [70,71] and the Local Moran's I [72,73] for spatial representation.
Moran's I is a statistic that can analyze the existence of concentrations (cluster) and outliers in a set of entities (in this case, Spanish municipalities) and in an analysis field (in this case, the different demographic and socioeconomic variables). However, in order to know the existence of correlations between groups of territorial units, first, it must be evaluated whether the expressed pattern is clustered, dispersed, or random by calculating the Global Moran's I. This statistic is defined as [70] Equations (5) where zi is the average deviation of an attribute for the feature i; wi,j is the spatial weighting between i and j; n is equal to the total number of features; and S0 is the aggregate of all spatial weights The zI score is calculated as Equation (7): where Equations (8) and (9) are This test is a deductive statistic that is always based on the null hypothesis. To reject the null hypothesis, Global Moran's I reports z scores and p values, this being a probability. When the p value is very small, it means that the spatial pattern is unlikely to present random results, so the null hypothesis is rejected. The z scores are standard deviations that can be very high or very low and are normally associated with very small p values found in the extremities of the normal distribution. Thus, if the results obtained in Global Moran's I are small p values and very high or very low z scores, the null hypothesis is rejected. In short, the Global Moran's I represents the intensity of autocorrelations between the groups of territorial units, but does not identify the pattern. To identify the existing correlations, the Local Moran's I must be used and calculated with the Equation (10) where xi is the attribute analyzed for each entity i; is the mean that corresponds to the attribute; wi, j is the spatial weight between entities i and j, and Equation (11) = ∑ , , where n is the total number of entities considered.
As the result of Moran's I is specified in obtaining zIi scores (standard deviation), these are obtained in Equation (12) = where Equation (13) is This geostatistical analysis calculates a SA value capable of specifying whether the sectors with high proportions of a group are located near other sectors with high proportions within that group. In the case that concerns us here, it was determined that the type of distance relationship would be Euclidean and the distance criterion would be inverse squared, since it was previously estimated that the relationship capacity decays rapidly with distance.
Thus, p values were obtained in the clustered areas that represent the statistical significance according to the following code:  High-High (areas with high presence surrounded by areas with high presence).  High-Low (areas with high presence surrounded by units with low presence).  Low-High (low presence areas surrounded by units with high presence).  Low-Low (areas with low presence surrounded by units with low presence). This indicator shows whether there are clusters with extreme values in both positive (High) and negative (Low) data.

Pearson's Bivariate Correlations
Finally, bivariate correlations were calculated with the Pearson Coefficient to determine the degree of correlation. Bivariate correlations are used to determine the degree of quantitative relationship of two in two variables as well as which group of the analyzed variables has the highest degree of co-dependence with each other. Thus, this index measures the degree of covariation between different linearly related variables and values ranging between −1 and +1 are obtained. This is calculated with Equation (14): The magnitude of the relationship is specified by the numerical value obtained from the coefficient, reflecting the sign of such value in the direction. When +1 is obtained, the relationship is a perfect positive, when one of the variables increases, the other increases. On the other hand, when −1 is obtained, the relation is a perfect negative, when one variable increases the other decreases. These values are frequent in the physical sciences, where the phenomena conform to known laws [74], for example, the relationship between space and time for a mobile that travels at a constant speed. However, in social and human sciences, where the phenomena are complex, it is established that values from ±0.3 are representative and from 0.5 highly representative [75,76].

Results
In order to clarify whether there were spatial concentrations of the chosen variables, the Moran`s I statistic was calculated. The results obtained are shown in Table 2 and Figure 4. The rural municipalities (with less than 2000 inhabitants) are mainly located in the regions of Castilla y León, Aragón (both with more than 60% of their territory), Galicia, and north of Extremadura and Castilla-La Mancha. These regions resulted in a Local Moran's I with 3874 municipalities with low values. In addition, the largest number of municipalities with less than 500 inhabitants appeared in both Castillas and Aragon (Castilla y León has one third of them, a large part with less than 100 inhabitants). In contrast, there were 686 municipalities with high values around Madrid and in coastal areas of eastern Spain. These high values also corresponded to the urban centers of Extremadura, Aragón, and both Castillas. With non-significant values, there were 3122 municipalities in the other regions of Northern Spain and in the interior areas of Castilla-La Mancha and Andalucía, therefore, in these areas of Spain, there are municipalities with population values around the average (5700 inhabitants) and there are neither urban nor rural clusters. Another of the most relevant indicators is population density. In Figure 5, it can be observed how this variable presents an important variation, going from a minimum of 0 inhab/km 2 to a maximum of 21,233.33 inhab/km 2 . The average was 95.3 inhab/km 2 and there was a high deviation level (765.50). In the period analyzed (2001-2018), there has been a 0.9% increase in the number of municipalities with a population density less than five inhabitants per km 2 and 11% in the number of those with less than 30 inhabitants/km 2 . The municipalities with the highest population density were located in the coastal areas, in the capital of Spain, and in the Ebro Valley with average values exceeding 500 inhab/km 2 .
Regarding population density, there were 5602 municipalities with low values (LL). Their locations coincided with the previous case (size of population). They consisted of 70% of all of the Spanish municipalities, and had more extreme values of low concentrations than in the case of the population size. These data are very worrisome because they show that highly depopulated areas exist in Spain with numerous villages with less than 2000 inhabitants and that population density is very low. The municipalities occupy the Spanish Plateau (the two Castillas and Extremadura) and Aragon, part of Galicia and Asturias, in the north of the country. With high concentrations of population density, there were 794 municipalities on the Levantine coast, south of Andalucía, north of País Vasco, and around Madrid (just 10% of the total municipalities of Spain). If the population growth is studied (Figure 6), it can be observed that the areas located on the coast, the capital of Spain, and in the Ebro Valley are those that host municipalities with a positive population growth in the last 17 years, in total, 3004 municipalities (36% of the total). These municipalities are considered urban and 770 of them have experienced a population growth greater than 30% (mainly in the community of Madrid and on the Catalan coast).
In contrast, in Castilla-La Mancha, Castilla y León, Galicia, interior areas of Extremadura, and Aragón, there are municipalities that have lost populations in the last 17 years. The most significant cases were those of municipalities located in the innermost areas, with negative values above 25%.
Values ranged between losses greater than 30% and increases of 100%. The general average value was negative (−13%) and the standard deviation was 37. Due to this, the concentration of low values (LL) in the population growth variable also occurred in the regions of Castilla y León, Aragón, part of Extremadura ,and Castilla-La Mancha, with worrying negative values (3497 municipalities, 43% of the national total). In contrast, there were numerous municipalities (3847) in high value clusters (HH) that were located mostly on the east coast of the country, around the capital, and around urban municipalities of the previous classification (the other 47%). Thus, one-half of Spain is dynamic and increases its population, and the other one loses population and has municipalities at risk of disappearance. The old age index (population over 65 years of age among the total population) (Figure 7) has an average of 28% and a standard deviation of 157. Its values comprise between 3% and 78%. There were 3295 municipalities with more than 30% of its population over 65 years (40% of Spanish municipalities) located in interior spaces in the north of the Peninsula with a high number of people in situations of dependency and whose demographic regeneration is compromised. Clusters of high extreme values (HH) appeared, but the spatial distribution was different because it was more pronounced since a great north-south dichotomy was observed. Clusters with high values were placed from Madrid to northern Spain including the provinces of northern Extremadura and Castilla-La Mancha, with 3511 municipalities (43% of the total). In contrast, in the south of Spain (Extremadura, Castilla-La Mancha, Andalucía), on the east coast, and in the regions of Cantabria, País Vasco, La Rioja, and Navarra, clusters of low values (4098 municipalities) were located (51%). The unemployment rate (Figure 8), which was calculated with job seekers in 2018, experienced similar patterns with a very different distribution between the municipalities of the northern Plateau and those of the southern one. In northern Spain, the highest unemployment rates ranged between 10% and 15% in small areas of Galicia, Asturias, Cantabria, and part of the Ebro Axis, where the primary sector stands out as the main economic activity. On the other hand, on the Catalan coast, there were also significantly high values related to population accumulation. However, the highest unemployment rates, between 15% and 25%, were experienced in Extremadura, Castilla-La Mancha, Murcia, and in the western Andalusian provinces, with values ranging between 20% and 77% in the smallest municipalities and in extreme cases. The average national unemployment rate was 9.5%, with a standard deviation of 4.8. The existence of high unemployment rates is a negative characteristic of the economy of many Spanish municipalities (more pronounced since the economic crisis of the past decade). In the analysis of this variable, differences between some spaces and others can be appreciated: there were concentrations of high values in the regions of Andalucía, Extremadura, Castilla-La Mancha, Murcia and south of Valencia, and on the western border of Spain with Portugal (2521 municipalities, 31% of the total). The low values, in opposition, were located in the community of Madrid and on the Mediterranean coast (4191 municipalities, 51%). There was a north-south dichotomy that was totally in contrast to the old age index case. In rural areas, the older areas that appeared in the previous analysis, located in the north of Spain, had low unemployment rates, while in contrast, less aged areas, located south of Madrid, had high concentrations of unemployment.
The same two realities described above were perceived again in the case of unemployed people in the primary sector ( Figure 9). Areas with the highest number of unemployed in the agricultural sector with values above 20% were in Andalucía, Extremadura, and southern Castilla-La Mancha. Conversely, territories with values below 5% were located on the coast of northern and eastern Spain, in Madrid, and in some areas of northern Castilla y León and Aragón, which are regions where the primary sector has poor representation today. The average was 12%, with values from 0.3% to 90%, and a standard deviation of 14.1. There were spatial clusters, but with less intensity than in variables such as population growth or old age index. Thus, there were clusters with high values in regions with a traditional agrarian sector oriented to large landowners with dry-land farming systems that, in most cases, are unprofitable. These 1924 municipalities occupy the entire region of Andalucía, most of Extremadura (except a small strip of the north), and the southern provinces of Castilla-La Mancha. In contrast, 4088 municipalities had low values. These were placed in the rural areas of northern Spain such as Castilla y León, Galicia, and northern Castilla-La Mancha. In addition, there were concentrations of low values in regions (in the northern coast areas and Catalonia) where the agricultural sector is residual, since industry, tourism, or the services sector (administration) are the main economic activity.
The per capita income ( Figure 10) had values between 5200 Euros and 25,600 Euros, with an average of 10,359 Euros and a standard deviation of 2244 Euros. In this case, the existence of a double reality according to the generation of wealth was identified like with the old age index and unemployment with one reality that belongs to northern Spain and the other one to the south. The areas with the greatest wealth are located in northern Spain, Madrid, and in the northeastern coastal areas where municipalities with incomes exceeding 11,000 Euros are located. In contrast, most of the municipalities with incomes below 9000 Euros per inhabitant are in the South Plateau and on the southern coasts. Taking into account the spatial concentrations, the per capita income (the average income at the municipal level has been calculated), there were 4552 municipalities with high values (HH) in northern Spain, on the east coast, and in urban municipalities and their hinterlands, which are the provincial capitals of regions in the south (56% of the total). On the other hand, there are groups with low values with 2600 municipalities located in southern Spain in Extremadura, south of Castilla-La Mancha, and Andalucía (32%).  Analyzing accessibility of rural municipalities to urban centers ( Figure 11, the Spanish communication route system is designed around a central pole from which they depart, which is Madrid, the state capital, and is directed toward the main urban centers or industrial poles. In Figure  11, five ranges of access times can be seen and considering them, 2240 municipalities (43%) around the main roads have access times between 0 and 10 minutes with regard to urban centers. These municipalities are situated in the community of Madrid and in the surrounding areas of the main Spanish cities located on the Ebro Axis (from Logroño and Zaragoza to the Catalan coast with Barcelona), on the Cantabrian Axis (Bilbao), on the Mediterranean coast (Valencia and Murcia), and in some industrial centers such as Valladolid, Huelva, Cádiz, or Sevilla. Then, the population centers located in more remote areas and with longer access times (1818 municipalities with more than 30 minutes to the nearest urban) are on the border of Portugal with the regions of Castilla y León, Extremadura, and Andalucía, on the border with France (in the mountainous areas of the Aragonese Community), and in interior areas of Castilla-La Mancha. There are extreme cases in which the access times to the nearest urban centers are longer than 60 minutes and can even be 90 minutes.
There were many concentrations of high values (HH) in areas in interior Spain that account for practically much of the surface of Castilla y León, Extremadura, Aragón, Asturias, and NE of Castilla-La Mancha and Galicia (2487 municipalities, 30%). In contrast, there were municipalities with low values (LL), which are situated in the influence area or hinterland of urban centers (2680, municipalities, 33%) on the Mediterranean coast, Andalucía, around Madrid, and in the north of Spain (País Vasco, Cantabria, and Navarra).
In addition, there were intermediate spaces (LH values) in areas near urban centers in the interior of the Peninsula, which mostly coincide with the surroundings of provincial capitals. Finally, the results obtained in the calculation of Pearson's bivariate correlations are presented in order to establish the relationship between the exposed variables and determine whether there is a homogeneous behavior in the demographic structures of urban and rural spaces. Table 3 shows that there were not many highly significant correlations between some of the variables used. Only the relationships between population growth with the old age index and accessibility to urban centers, which were both negative, were significant, with values below −0.5. To a lesser extent, population growth had a positive relationship of 0.4 with per capita income.
That is to say, municipalities that have increased their population in the last 17 years are those with low age values, because the relationship is significant with negative value. These are urban centers or municipalities around them. In 40% of cases, they also had high incomes per capita.
The population variable correlates with population density, although with a value that is not excessively high (0.3). There were urban municipalities in certain Spanish regions such as Extremadura or Andalucía, in agrarian territories, and with a landowner's vocation where its municipal limit is very extensive, so the population density variable would not be a good indicator to differentiate between rural and urban.
The other relationships were significant, but not with such defining values. The unemployment variable was circumstantial in both rural and urban spaces, still due to the negative effects of the global economic crisis of 2008. Agricultural job seekers were mostly in large landowner regions such as Andalusia, southern Extremadura, and Castilla La Mancha (with a more traditional economic system and linked to the primary sector) in both rural areas with less than 2000 inhabitants and in large intermediate areas with municipalities with a population between 2000 and 10,000 inhabitants.

Discussion
Based on the results presented, there are different demographic behaviors in Spanish municipalities and the reality of the Spanish rural can be considered complex. The most ruralized spaces (with less than 2000 inhabitants) are located in the interior areas of the Spanish North Plateau [11] and in its extension to the south of Ebro Valley (Aragón) [77] as well as in Galicia and Asturias [58,78]. In these territories, most of their municipalities have experienced little population growth in the last 25 years (they have lost more than 30% of their population) as well as lower population densities (most of them with less of 10 inhabitants per km 2 ), the highest rates of old age (over 40%), and are isolated compared to urban municipalities.
Therefore, these areas, both in the descriptive maps and in the results of the spatial autocorrelation, have concentrations of high aging values, low population growth, and low access times to urban centers as well as concentrations of low values of population density. However, they do not have high concentrations of unemployment rates and that of agricultural unemployment and low values per capita income. These areas with greater risk of depopulation still maintain higher incomes than other rural Spanish spaces that do not have such extreme demographic characteristics, as in the case of the southern part of the Peninsula (Andalucía and Extremadura) [79]. This is due to the fact that most of the population of the municipalities with the highest risk of depopulation are retired (they do not demand employment) and have higher pensions than in the rural areas of the south, in which there is still no such aged people, but there is population of working age dedicated to an agricultural sector that is not very productive [80] and maintained with aid such as the agricultural subsidy or those of the CAP.
On the other hand, the rural areas of the south (Andalucía and much of Extremadura and Castilla-La Mancha) do not have so many concentrations of municipalities with smaller populations (a high percentage of these municipalities is in the range between 1000 and 2000 inhabitants) nor high concentrations of aging or population loss, so the tendency to disappear or for depopulation is less worrisome [80]. However, in the long term, the disappearance may occur because they have concentrations of low incomes per inhabitant, high unemployment, and agricultural unemployment rates. These are rural spaces whose regressive demographic trends are beginning to cause negative population growth of more than 10% and increments in the old age index.
Finally, there is a spatial concentration of homogeneous variables that define urban areas. Clustered with higher values in population growth, population density, income levels, and low old age rates, and unemployment rates are located in the coastal areas of the Mediterranean Sea (Cataluña, Valencia, Murcia, and Islas Baleares), in the metropolitan area of Madrid [78], and in certain Spanish functional areas that coincide with the provincial capitals where there are nuclei, in most cases, with more than 500,000 inhabitants.
This reality is also present in other EU countries, for example, in Italy, where, since the end of the 20th century, there has been a process of emptying rural areas with a clear differentiation between the north, which has greater economic development and serves as a pole of attraction, and the south, with important demographic challenges [81]. Italian rural areas with the most regressive demographic indicators are located in southern regions and are characterized by low population density, remoteness from urban centers, a high level of marginality [82], internal migration, and aging [83]. Another case is Portugal, a territory where the fall in the birth rate, the increase in life expectancy, and the emigration caused by urbanization processes have contributed to the demographic decline in rural areas, but there are also differences between some areas. These processes are much more pronounced in the rural areas bordering Portugal with Castilla y León and Extremadura (Central and Alentejo regions), than in other rural areas in the south in the Algarve (benefiting from tourism) or in the north (proximity to more industrial areas such as Oporto) [84,85].
On the other hand, in France, in the past decades, its rural areas had presented a favorable evolution with the return or settlement of new populations due to a change in the dynamics with a greater development of tourism or administrative decentralization [79,86]. However, the existence of problems such as a lower quality of public services or the decline of rural tourism [87,88] is causing some territories of central France to start losing population [89] and show high rates of aging and their young and dynamic population moving to the coast, which presents new activities such as services, tourism, scientific research, and new industrial technologies [90]. This phenomenon is not as pronounced as in the rural territories of Mediterranean countries, but it is beginning to present figures of aging and depopulation that are also worrying.
At this point, and based on the results obtained, the hypothesis presented in the introductory section of this paper cannot be accepted: the spatial organization model of Spanish municipalities and public investments intended to generate demographic and socioeconomic improvements was not confirmed in the two last decades.

Conclusions
Through the compilation of demographic and socioeconomic variables of Spain at the national level and their analysis through the Local Moran's I geostatistical method, the existence of a complex model in the distribution of the Spanish population was appreciated. On one hand, there is a reality characterized by the existence of large concentrations of population (urban municipalities) in the coastal areas of the country (around the Mediterranean Sea and the Cantabrian Sea) and around the capital Madrid as well as in the metropolitan areas from Valladolid and Zaragoza, where 87.8% of the Spanish population is concentrated in 1300 municipalities, which occupy 30% of the territory.
On the other hand, there is another reality in an unpopulated Spain (with little population and low population density) that exists in the interior of the Peninsula, on the great Spanish Plateau, and in its extension to Aragón, Galicia, and Asturias in the North of Spain. In these areas, more than 5000 municipalities with less than 2000 inhabitants (rural municipalities according to the classification of the NSI) are located and there are more than 1400 municipalities with less than 100 inhabitants. In addition, an intermediate reality formed by ruralized municipalities, but with a not very serious demographic situation, can be identified. This reality is seen in municipalities in the southern Peninsula (Andalucía, Southern Extremadura, and Castilla-La Mancha).
With the spatial analyst method used and taking into account the results of the bivariate correlation analysis, we studied whether the same variables conditioned the depopulation process throughout the Spanish territory in the same way. Thus, according to the results obtained, there were different behaviors regarding the variables analyzed. The most depopulated rural areas were located in the north of Spain and were characterized, above all, by high population aging, low population density, negative population growth, and low volume of inhabitants. In these areas, there were concentrations above 43% of the total with low values in the population growth and high values of old age index (3500 municipalities approximately). Additionally, the population density and the size of the population showed more than 60% of the low values (6000 municipalities with most cases of populations below 500 inhabitants and densities below 10 inhabitants/km 2 ). In other variables such as unemployment rates and specifically in the agricultural sector, there was no presence of high concentrations (because there are many old people that can no longer work) and they had incomes above the national average.
In contrast, the rural areas of southern Spain were not as aged nor did they have such a regressive population growth nor a low population density (there were no high values concentrations in the Local Moran's I analysis), but the unemployment rates and agrarian unemployment had a high average (with more of the 30% of the municipalities with high values) and the incomes were below the national average (with more of 32% of low values). At this point, it seems that an imaginary line exists around the capital, Madrid, which divides depopulated Spain into two: on one hand, there is a higher risk of depopulation in the north, which is conditioned by the lack of young people in particular. Then, there is a lower risk in the south, but with regressive economic conditions (high unemployment rates, excessive dependence on a low-productive agricultural sector, and lower economic income) that may cause them to lose young people in the future.
On the other hand, there was a concentration of urban areas on the coast with high values in terms of population size and population density (10% of the municipalities had the most extreme values in the country), population growth (36%), and income (56%) as well as low values of population density, old age, and job seekers (with approximately 50% of all Spanish municipalities in these three variables).
Accessibility is also a problem in Spanish rural areas since not all municipalities have the same access times that allows them to communicate with the main cities of the country. It is clear that greater accessibility in rural areas would guarantee a greater flow of people who have the right to benefit from equipment and services with the same opportunities as the rest of society.
Although the problem of depopulation is common in much of the Spanish territory, there are two parallel realities in the country with inherent problems to its geographical characteristics. Thus, in the north, the lack of a young population is the most worrisome. This population has left their hometowns looking for better opportunities and the elderly with the greatest economic resources because of their high retirement income and savings are the ones who stay. Thus, it is necessary to implement political measures so that the young population return to northern Spanish territories. For example, actions that improve the conditions of access to housing and others with which to introduce complementary income through activities related to rural tourism can be carried out.
In the south, although there is more of a young population, the low standard of living is worrying as well as the high unemployment rates. These problems could result in even younger people deciding to emigrate. In this case, it would be appropriate to propose policies with which to retain young people, for example, through economic incentives in the agricultural sector or aid for the creation of new companies, modernization of the agribusiness structure, etc. Therefore, in this paper, it is proposed that the Government of Spain design its public policies and action measures against depopulation in a different manner from the current one, taking into account the diverse realities that all Spanish municipalities have. Certainly, the design of a more sustainable, articulated, and functional territorial organization model around medium-sized cities (acting as county towns) that provide all necessary public services (health, education, administration, commerce, etc.) is necessary in Spain. The purpose is that all Spanish citizens have their needs covered and certain groups do not have to emigrate outside their hometowns, thus reducing the serious problem of depopulation.