A GIS Open Source Software application for mapping solar energy resources in urban areas

This paper presents the development of an open source geographical information system (GIS) software module for mapping solar energy resources for urban areas. The main goal of this work is to demonstrate the potential use of the r.sun module, a component of GRASS software, in calculating real solar radiation for urban areas. Modelling of the spatial distribution of solar radiation is one of the program functions. The r.sun module is dedicated for that purpose; however, it can only generate the spatial distribution of potential solar radiation. To get the real solar radiation maps it is advisable to use meteorological data, that describe diminution of solar radiation caused by cloud cover. In order to facilitate the generation of maps a GRASS source code modification was made. As a result, the r.sun module used in this work generates the real spatial distribution of solar radiation. The results are shown to be comparable with solar radiation satellite data obtained from the HelioClim project.


Indroduction
Nowadays, the demand for energy is growing very fast, but at the same time global energy resources are running out. Energy demands are the biggest in cities where most people live. That is the reason why energy in cities is one of the biggest challenges for this era.
It became necessary to simplify the process of planning the location of energy sources, especially in city areas. There are results available for many projects dedicated to this specific issue, for instance, solar potential maps or reports [1][2][3][4][5][6][7].
Studies by Hofierka and Šúri presented methods of estimating solar radiation spatial distribution and potential solar energy production. Hofierka [8] presents a method for the assessment of photovoltaic potential in urban areas using an open source software GRASS (Geographic Resources Analysis Support System) and r.sun module dedicated to solar radiation estimation. He used a 3-D city model as input terrain data. The R.sun module [7] is a tool for the estimation of solar radiation for clear-sky conditions. It is possible to generate solar radiation maps in overcast conditions, but the user has to use coeff_bh and coeff_dh input raster maps defining the fraction of the respective clear-sky radiation reduced by atmospheric factors (e.g. cloudiness). These coefficients can be obtained from long-term meteorological measurements provided as raster maps with the spatial distribution of these coefficients separately for beam and diffuse radiation [9]. This could be problematic for users who have to obtain and analyse data from many meteorological stations. It also seems not to be necessary in cases when the user analyses the solar energy potential for a specific city. In such cases, the cloud cover meteorological data can be obtained from one meteorological station. But when the user has data form only one station, they could not generate a raster map. A better solution in this case is to use one parameter for the cloud cover.
In this study the r.sun module modification has been developed to generate the spatial distribution of real solar radiation easier and faster by using the cloud cover parameter, which was calculated for Wroclaw city based on daily synops data obtained from Ogimet services [8] for the time period of 2007-2016.

Methods and data
The spatial distribution of solar radiation is determined by numerous elements such as terrain, atmosphere, air pollutants, water and aerosol in the atmosphere, and cloud cover.
The key problem is the real solar radiation incident on a regional scale, i.e. urban area. In that case, the major factors modifying the distribution of the radiation are the cloud cover, terrain and air pollutants. The local shadowing effects of the terrain are also important.
An important element of the real solar analysis is the cloud cover parameter. Clouds constitute a barrier for solar radiation, but the solar radiation module (r.sun) does not include cloud cover in the analysis in a simple way. This problem was examined in numerous studies [10][11][12]. To generate real solar radiation maps some authors used data from local ground stations to determine the range of the clouds. Another way is to use satellite data to generate the cloud cover mask [13][14][15][16] or the fisheye camera. But those solutions are very time-consuming and there is no GIS model to make this work faster.
The solution proposed in this paper is a summary of the previous work described [17]. The authors proposed the r.sun module modification, which involves the cloud cover parameter calculated based on meteorological data for Wroclaw city and Linke turbidity factor, whose value was obtained from literature sources.

GRASS
To generate real solar radiation maps for Wroclaw, the GRASS software package was used [18]. GRASS is one of many GIS (Geographic Information System) applications. It is a set of commands (also called modules or simpler -executable programs) working in a common environment and using a GRASS dedicated spatial database. Because of such architecture, GRASS is used not only as a desktop GIS system; it works as the calculation engine in serverclient architecture, a cor of OGC WPS (Web Processing Service) server (pyWPS), and a spatial calculations library for other de Tako Laret Polka Dots sktop programs (QuantumGIS etc.).
GRASS is an example of the application called FOSS -Free Open Source Software. It is released with GNU GPL license and it is available for downloading form the GRASS internet website grass.osgeo.org.
Users can download the GRASS application in many versions, there is also GRASS source code available on the website. The GRASS license makes it possible to download and develop GRASS for non-commercial purposes.

r.sun
R.sun is a GRASS command dedicated to analyse the spatial distribution of solar radiation [12]. The parameters of r.sun used as input data for the r.sun module calculation (potential solar radiation) are discribed on GRASS user manual web side [19].
R.sun works on the basis of a terrain model and its derivatives: (slope, aspect, etc.), atmospheric parameters (Linke turbidity factor -LTF, cloud cover -Cc, etc.) and astronomical calculations (Sun azimuth and elevation or a given location on Earth, etc.).
As the result, the r.sun module computes direct, diffuse and reflected solar irradiation. It produces raster maps for a given day, latitude, terrain and the atmospheric conditions. The solar parameters (e.g. sunrise and sunset times, declination, extra-terrestrial irradiation, and daylight length) are saved in the map history file. The shadowing effect of the topography is also taken into consideration.
A big advantage of the r.sun module is that the user can edit the processing script. It allows calculations to be performed for a selected set of days to compute radiation for some time interval within the year (e.g. vegetation or winter period, and months). The module allows the shadowing effect of the local topography to be taken into consideration; the user can switch off this option with the use of the -p flag. R.sun works in two modes:  the first mode calculates a solar incidence angle [degrees] and solar irradiance values [W/m] for the set local time,  the other mode calculates daily sums of solar radiation [Wh/m 2 /day] for a given day. On the basis of clear-sky radiations, the user can generate the real-sky radiation (beam, diffuse) maps. For this purpose coeff_bh and coeff_dh input raster maps defining the fraction of the respective clear-sky radiations reduced by atmospheric factors (e.g. cloudiness) have to be used; the value is between 0-1. These coefficients are obtained most likely from long-term meteorological measurements. Coeff_bh and coeff_dh are the raster maps with the spatial distribution of these coefficients.

Spatial data
Spatial data, describing the geometry of buildings, necessary for analyses were obtained from the Central Documentation Centre of Geodesy and Cartography. The orthophotomap is registered in the index of numerical elevation data as M-33-35-Ca-3-3. The orthophoto map used in previous analysis is shared in a digital form in GeoTIFF format and in field physical pixel size of 0.10 metre. Figure 1 presents parts of the mapthe area in the centre of Wroclaw.

Linke Turbidity Factor
The Linke turbidity factor describes the weakening of solar radiation due to the presence of aerosols and water vapour in the atmosphere. The value of LTF factor depends on the solar elevation angle, the water vapour and the contents of the aerosols in the atmosphere.
There are several methods of calculating LTF in solar radiation modelling. One of them is to use the SoDA project [20]. Soda maps of LTF are created for each cell every 5 minutes of arc angle per month. Another way is to use the empirical formula and meteorological measurements [21,22]. The empirical model was used in calculation in the majority of previous works on the spatial distribution of spatial solar radiation [23]. Meteorological data are available on https://aeronet.gsfc.nasa.gov [24]. The LTE coefficient medium value in temperate latitudes is 3.0 [12].

Cloud cover data
The cloud cover parameters were calculated by the empirical formula proposed by Kasten and Czeplak [25]: where N is a parameter describing the daily average cloudiness of the sky (Cc). The Cc value was calculated on the basis of the synoptic telegram data. The synoptic data were obtained from the Ogimet service. Based on daily synops for 2007 to 2016 the medium daily value of the cloud cover parameter (Cc) for Wroclaw were calculated.

R.sun modification
The R.sun module was modified to generate the spatial distribution of real solar radiation. On the basis of the r.sun source code an addition to the code was made. The new code modified r.sun by expanding the r.sun features for posibility to generate real solar radiation maps. The new feature uses parameter that was called the cloud cover parameter (Cc). Cc parameter has values from 0 to 1 (where 0 is a lack of the cloud cover and 1 is the maximum cloud cover). The new output map generatet by r.sun was called real_rad.: cloud cover parameter = floata single value of the cloud cover parameter, real_rad = stringoutput real sky condition irradiation raster map [Wh/m-2.day-1].

Results
The cloud cover parameter of r.sun, described in subsection 2.5, was used to calculate the daily sum of real solar radiation. Daily Cc data were applied for that purpose. The possibility of using data in the form of a parameter makes the analysis easier and faster. Another advantage is that it was not necessary to obtain the data from many meteorological stations to build raster data (radiation coefficient raster map). The map presented in Figures  2 and 3 ware generated with the use of the real_rad parameter.  Raster maps of the daily solar radiation sum for 1 January and 1 June were generated for part of the city of Wroclaw with the use of the real_rad parameter. This part of the r.suncommand is the alternative to a raster map with the radiation coefficient.
The conducted analyses of the spatial distribution of solar radiation for a part of Wroclaw with the use of the cloud cover parameter and the comparison with the values obtained from the Helioclim database give results closer to the real values of solar irradiation (Figs. 4 and 5). The R. sun module, when working in mode 2, calculates the daily sum of solar radiation in clear sky conditions. The daily value of solar radiation given in Wh/m 2 is bigger than the real value measured at meteorological stations. The biggest differences are observed in the warm part of the year. Another characteristic feature is the lack of daily variability, which is determined by the cloud cover [26]. The use of the cloud cover (Cc) parameter caused the daily data of solar radiation to be closer to the measured data and varied daily. Figure 4 shows the daily sum of solar radiation (Wh/m 2 ) for a part of Wroclaw. The blue line on the graph presents the r.sun module with the use of the

Conclusions
The increase in the demand for energy production and the costs of energy are important factors. Forasmuch as most energy is consumed in the city, it seems to be rational to produce energy there. This solution can help to reduce the costs of energy production; it is possible because costs will be lowered by transmission and land costs.
Another advantage of the energy production in the city is increasing energy safety and the use of a renewable energy source (solar energy) that can help to reduce the use of coal in individual households. The increase in the use of renewable energy sources is very important, especially for big cities where air quality is now a problem.
By having a simple and user-friendly application and data sources, the cost of the design of solar energy use in the city can be decreased and it will make solar energy production more feasible and decreae the dependency on conventional energy resources in the future.
The R.sun module presented in this paper is a part of 'free' software, thanks to which every new solution based on GRASS software can be used by every user in the world. The source code modifications and the sources of data are also free for each user. That is why, making a solar energy resource map for a given city can be done without extra costs for data and software license.