Open Access
This article is

- freely available
- re-usable

*ISPRS Int. J. Geo-Inf.*
**2018**,
*7*(8),
301;
https://doi.org/10.3390/ijgi7080301

Article

Automatic Parametrization and Shadow Analysis of Roofs in Urban Areas from ALS Point Clouds with Solar Energy Purposes

^{1}

Department of Materials Engineering, Applied Mechanics and Construction, School of Industrial Engineering, University of Vigo, 36310 Pontevedra, Spain

^{2}

Department of Natural Resources and Environmental Engineering, School of Mining Engineering, University of Vigo, 36310 Pontevedra, Spain

^{*}

Author to whom correspondence should be addressed.

Received: 19 June 2018 / Accepted: 25 July 2018 / Published: 28 July 2018

## Abstract

**:**

A basic feature of modern and smart cities is their energetic sustainability, using clean and renewable energies and, therefore, reducing the carbon emissions, especially in large cities. Solar energy is one of the most important renewable energy sources, being more significant in sunny climate areas such as the South of Europe. However, the installation of solar panels should be carried out carefully, being necessary to collect information about building roofs, regarding its surface and orientation. This paper proposes a methodology aiming to automatically parametrize building roofs employing point cloud data from an Aerial Laser Scanner (ALS) source. This parametrization consists of extracting not only the area and orientation of the roofs in an urban environment, but also of studying the shading of the roofs, given a date and time of the day. This methodology has been validated using 3D point cloud data of the city of Santiago de Compostela (Spain), achieving roof area measurement errors in the range of $\pm 3\%$, showing that even low-density ALS data can be useful in order to carry out further analysis with energetic perspective.

Keywords:

Aerial Laser Scanner; point cloud processing; segmentation; roof parametrization; roof shading## 1. Introduction

Nowadays, buildings are responsible of the 36% of CO

_{2}emissions and 40% of the energy consumption in the European Union (EU), according to the European Commission. To improve the efficiency and sustainability of the energy consumed within buildings is important not only for reducing the carbon footprint but also for generating economic and social benefits related with the wellbeing of the building inhabitants and reducing the energy poverty. That is why the Energy Performance of Buildings Directive [1] is aiming at nearly zero-energy standards, requiring all public buildings to satisfy this energetic efficiency by 2018 and all buildings by the end of 2020. Specifically, photovoltaic solar energy is widely used in urban environments, as it is a clean and silent source of energy, and it accounted for a 11.6% of the total quantity of electricity generated from renewable energy sources in the EU—that is, 28 countries in 2016 [2]. Generally, there are three steps that are taken to estimate the solar potential: (1) Collection of input data (cartography, Light Detection and Ranging (LiDAR), or photogrammetry among others), (2) Development of a solar radiation model, and (3) Definition of an interface for the interaction with the end user [3]. This work is entirely focused on the first step and its connection with the second, as identifying which areas are suitable for the use of solar energy is essential for the determination of the solar potential [4], meaning that it is necessary to measure position, size, inclination and azimuth of the areas of installation of solar panels, which, in an urban environment, are typically the roofs of the buildings.As it has been mentioned, there are different sources for the input data that can be used for energy applications. For instance, Nex and Ramondino [5] generate DSM models from aerial images in order to reconstruct roof outlines. Similarly, Ahmadi et al. [6] extract building boundaries also using imagery, being their research based on a model of active contours. The literature, however, has been more focused on employing data from ALS sources, which allow to collect accurate and dense 3D representations of the environment. Laser scanner data has been widely used in the last decade for a huge variety of applications. On one side, Terrestrial Laser Scanners (TLS) are typically employed for the detection and classification of objects at street level [7,8,9], and for road and railway infrastructure analysis [10,11,12]. Although TLS data is much denser than ALS and therefore the potential of this data source to capture small features with high resolution is higher, a terrestrial scan cannot collect geometric information about the building roofs as they will be always occluded. Therefore, Aerial data has to be employed, whose densities typically vary between 1–30 points per m

^{2}to higher densities such as the ALS dataset presented in [13], which averages 200 points per m^{2}by maximizing data coverage on building facades, flying at a low altitude and orientating flight paths at 45° with the major axes of the city streets, making possible a precise segmentation of building facades and roofs [14,15]. Other applications of ALS data are the extraction of the road network centerlines [16,17] or terrain recognition [18,19]. Regarding the extraction of building roofs with ALS data, there also exist several related works that should be remarked. Yan et al. [20] present a roof segmentation method based on a global plane fitting approach that achieves great accuracy results for point densities between 1.5 and 4 points per m^{2}. Vosselman et al. [21] propose a point cloud classification framework that integrates a set of segmentation approaches based on segments and context, selecting features based on local analysis for the classification. With an energetic perspective, Lukač et al. [22] present a photovoltaic estimation of building roofs, considering all the necessary parameters of a photovoltaic module and, on data collected with aerial LiDAR data. Finally, Lingfors et al. [23] compare the performance of low-resolution and high-resolution airborne LiDAR data in order to automatically create a 2.5D building model of a neighborhood, while categorizing the buildings to perform a solar resource assessment.The main contribution of this work is twofold: First, it presents a fully automatic methodology that segments ALS point clouds in order to extract building roofs and accurately measure several of their geometric features, all of them related with the determination of the solar potential. Furthermore, a shading analysis is proposed where the usable area of those roofs with the most suitable orientation for the installation of solar panels can be computed given any date and time of the day. The novelty of the work is also twofold: On one side, the methodological approach as a whole (although employing already existing techniques in some of its stages, such as triangulation). On the other side, this approach was developed with a focus on the case of the Spanish National Plan of Aerial Ortophotography, which provides aerial point clouds of the Spanish territory with known specifications.

This paper is structured as follows. The proposed methodology is depicted in Section 2. The case study data employed for the validation of the methodology is shown in Section 3. Then, Section 4 shows and discuss the results that have been obtained after the application of the methodology on the case study data. Finally, Section 5 outlines the conclusions of this work.

## 2. Methodology

The presented methodological approach consists of a number of sequential processing blocks as depicted in Figure 1. It inputs urban point cloud data acquired from an aerial laser scanner, and aims for the automatic characterization of the roofs with an energetic perspective, extracting information regarding the orientation, surface and shadows on the extracted roofs. These processing blocks have been defined as (1) Data preprocessing, (2) Point cloud classification, (3) Roof parametrization, and (4) shadow analysis.

#### 2.1. Data Preprocessing

Let

**P**= (**x**,**y**,**z**) be a 3D point cloud that consists of an unorganized set of 3D coordinates representing the aerial scan of an urban area. As roofs are the only elements that have to be extracted, a preliminary filtering is performed in order to reduce the amount of data to process, hence saving resources in terms of memory and execution time. A visual analysis of an aerial point cloud from an urban area shows that there are three large groups of points: Ground, facades and roofs. The data processing step consists of filtering out one of these groups, specifically the facades. For that purpose, a saliency analysis is applied to the point cloud**P**. This analysis is based on the algorithm by Wang et al. [24], which aims to classify the road boundaries in an urban point cloud. Here, the aim is to define whether or not a point belongs to an approximately horizontal plane. Such point will be subsequently defined as a non-salient point, while the rest of the points in the cloud will be defined as salient points. First, this algorithm computes the normal vector of each point within**P**, and separates all the normals in five clusters using k-means. A dominant normal vector is selected as the cluster whose normals are closer to the z-axis, and the distance of every other normal with respect that dominant normal vector is computed. The distances are mapped to a hyperbolic tangent space and classified in two classes: One class will contain non-salient points (roofs and ground), while the second one will contain salient points (facades, noise and other objects such as poles) (Figure 2). This way, a non-salient point cloud can be defined. Let $\mathcal{S}=\left(\mathit{P},\mathit{i}\right)$ be a function that selects a subset $\mathit{i}$ of points (being $\mathit{i}$ a list of indices) within a point cloud $\mathit{P}$, as defined originally in [15]. Thus, given the indices of non-salient points ${\mathit{i}}_{\mathit{ns}}$, the point cloud that will be processed in the following steps will be ${\mathit{P}}_{ns}=\mathcal{S}\left(\mathit{P},{\mathit{i}}_{ns}\right)$.#### 2.2. Point Cloud Classification

Once the point cloud has been preprocessed and facade points have been filtered out, there are two principal elements on the remaining point cloud ${\mathit{P}}_{ns}$, namely ground points and roof points. This step implements a classification process that aims for the definition of one class of points for each of the aforementioned elements. Due to the low density of the point cloud (details are described in Section 3) this process can be carried out using triangulation methods that would be unfeasible in a denser point cloud (e.g., a TLS or MLS acquired point cloud). Here, a Delaunay Triangulation [25] ${\mathcal{T}}_{\mathit{P}ns}$ is computed on ${\mathit{P}}_{ns}$ (Figure 3a). Generalizing, a Delaunay Triangulation ${\mathcal{T}}_{\mathit{P}}$ outputs a N-by-3 array (being N the number of points in $\mathit{P}$) where each row contains the point indices of a triangle such that its circumcircle does not contain any other point in its interior.

Considering that facade points have been removed in a previous step, a number of triangles in ${\mathcal{T}}_{\mathit{P}ns}$ will represent connections between roofs and ground. Detecting those triangles is the first step of the classification. For that purpose, the normal vector to the plane defined by each triangle is computed in first place. The normal vector of a triangle that connects roof and ground should have an inclination $\alpha $ with respect to the z-axis close to 90 degrees, so a soft threshold $\beta =55$ degrees is defined to select a group of potential triangles where $\alpha >\beta $. Another parameter that allows the identification of connections is the height of the triangle, so a threshold $h=3$ m is defined such that only triangles higher than $h$ are considered. Then, for each triangle that complies with both thresholds, the point with highest z is labeled as a roof point, and the point with lowest z as ground point, leaving unlabeled the third point of the triangle (Figure 3b).

These labeled points will be used as seeds for a region growing algorithm aiming to assign labels to the whole point cloud. First, the triangles that were identified as connections are removed from ${\mathcal{T}}_{\mathit{P}ns}$. Then, in order to avoid spurious triangles due to the presence of noisy, isolated points or in the limits of the point cloud, an area filter is applied such that triangles whose area is more than $1.5\text{}{\mathrm{m}}^{2}$ are also removed (let ${\mathcal{T}}_{f}$ be the triangulation resulting after the removal). This ensures the correct performance of the aforementioned region growing, which consists of the following two steps: (1) Define regions of points which are connected by triangles in ${\mathcal{T}}_{f}$ by searching the point indices of the neighboring triangles in the region and iterating this operation as long as new points are added to it. (2) For each region of points, check if there are labeled points within the region and assign that label to the whole region. As the triangles that connect ground and roofs had been removed, the case of a region containing both labels should not be possible (Figure 3c).

Finally, a label refinement process is carried out. Three considerations are made at this point: There may exist points without label (point regions with no seeds remain unlabeled after the region growing), and there may be mislabeled points both in the ground segment (due to small objects such as the upper part of vehicles or vegetation) and in the roof segment (which are unlikely but may appear in large roofs with different heights). Assuming that the vast majority of the points have been correctly classified, a nearest neighbor algorithm is applied, selecting as neighborhood of each point a sphere of $r=8\text{}\mathrm{m}$. Regarding unlabeled points, they are assigned the most common label within their neighborhood. Subsequently, an iterative process is defined for detecting or correcting points erroneously labeled as roofs. In the first iteration, the neighborhood of each roof point is checked, and the label is corrected if there are more ground points than roof points within it. This process repeats, gradually reducing the radius r to avoid the contact with actual roofs, until there are no more mislabeled points found. This iterative process was found necessary to correct relatively large objects that should be considered within the ground segment in the context of this work (e.g., upper part of a large truck). Finally, points erroneously labeled as ground are corrected following the same process, but performing only a single iteration, which was found enough for ensuring a correct performance (Figure 3d).

After this process, each point in ${\mathit{P}}_{ns}$ has a label indicating whether it belongs to the ground (point indices ${\mathit{i}}_{g}$) or a roof (point indices ${\mathit{i}}_{r}$), so the point cloud can be segmented in roofs, ${\mathit{P}}_{r}=\mathcal{S}\left({\mathit{P}}_{ns},{\mathit{i}}_{r}\right)$ and ground ${\mathit{P}}_{g}=\mathcal{S}\left({\mathit{P}}_{ns},{\mathit{i}}_{g}\right)$.

#### 2.3. Roof Parametrization

Once the points of the roofs have been isolated, a number of parameters can be computed. From a point of view based on energy efficiency and solar panel installation, there most relevant parameters are the orientation of the roof and its usable area.

First, the orientation of each point within ${\mathit{P}}_{r}$ is computed. For that purpose, the normal vector of each point ${\mathit{n}}_{i}={\left({n}_{x},{n}_{y},{n}_{z}\right)}_{y}$ is obtained using a local neighborhood of 10 points. These normal vectors describe the orientation of each point, defining the azimuth and the elevation of the vector as:
where $arctan2$ is the four-quadrant inverse tangent, and $arcsin$ the two-quadrant (angles within [−90,90] range) inverse sine. Hence, the azimuth represents the angle between the horizontal projection of the normal vector and the North (which is the y-axis for the study case data) in the XY plane, and the elevation represents the angle between the normal and the East (which is the x-axis) in the XZ plane. Here, an orientation index is assigned to each point according to its azimuth, as represented in Figure 4a, defining the orientation as North-East, North-West, South-West or South-East. This way, the point cloud ${\mathit{P}}_{r}$ can be visualized based on the orientation index of each point, Figure 4b.

$$azimuth=arctan2\left({n}_{y},\text{}{n}_{x}\right)$$

$$elevation=\mathrm{arcsin}\left({n}_{z}\right)$$

Although the orientation of the roof points is already known, the point cloud ${\mathit{P}}_{r}$ is still a set of unorganized 3D coordinates, with no contextual relationship among them. In order to organize this information, a Euclidean clustering algorithm driven by the orientation index is applied. A cluster of points ${\mathcal{C}}_{i}={\left\{\mathit{x},\mathit{y},\mathit{z}\right\}}_{i}$ will contain a number of points such that its orientation index is the same, the closest Euclidean distance between any pair of points of the cluster is less than a predefined threshold, and the closest Euclidean distance with respect to any point of a different cluster is more than that threshold (which, for this work, has been empirically defined as 2 m). This iterative process is carried out independently for each orientation index, obtaining a set of clusters ${\mathcal{C}}_{roofs}=\left\{{\mathcal{C}}_{NE},{\mathcal{C}}_{NW},{\mathcal{C}}_{SW},{\mathcal{C}}_{SE}\right\}$. This way, the points of a gabled roof will be represented by two different clusters, indicating its orientation.

Finally, the surface of each cluster is computed. There are different possible approaches for obtaining this parameter. One solution consists on the rasterization of each point cluster (that is, projecting the points on a squared grid on the XY plane and assigning the same index to the points within each cell of the grid), but it was found that the size of the grid using for building the raster has a considerable impact on the accuracy of the measured surface. Hence, the chosen approach consists of a triangulation of the points in each cluster and the addition of the surfaces of each triangle.

This stage of the process outputs, for each roof in the point cloud ${\mathit{P}}_{r}$, the set of clusters ${\mathcal{C}}_{roofs}$ that contains the points of each roof, having into account its orientation; as well as the area ${\mathit{A}}_{roofs}=\left\{{\mathit{A}}_{NE},{\mathit{A}}_{NW},{\mathit{A}}_{SW},{\mathit{A}}_{SE}\right\}$ of every group of points in ${\mathcal{C}}_{roofs}$.

#### 2.4. Shading Analysis

Shading is a relevant factor that influences the energy production of solar panels installed on the roof of a building. Using only the 3D data from the point cloud ${\mathit{P}}_{r}$, it is possible to establish the shading of a surface given the date and time of the day. Note that, as this work is focused on the geometric rather than on the energetic dimension, the effect of the meteorology will not be considered, assuming totally clear days for the computation of the shading.

In order to know the shading of a roof surface at a given time, it is necessary to obtain the azimuth (${A}_{sun})$ and elevation (${E}_{sun})$ of the Sun. Given the latitude ($\phi $) and the longitude ($\lambda )$, as well as the day of the year (d, which stands for the number of days since the beginning of the year) and time (H, hour of the day expressed as a decimal value), these parameters are computed as:
where $\delta $ is the declination angle, computed as shown in Equation (5), being the angle b obtained as shown in Equation (6):
and $\omega $ is the hour angle (Equation (7)), which depends on the Time-Corrected Equation of Time ($Eo{T}_{TC}$) (Equation (8)):

$${A}_{sun}=\mathrm{arcsin}\left(\mathrm{sin}\left(\phi \right)\mathrm{sin}\left(\delta \right)+\mathrm{cos}\left(\phi \right)\mathrm{cos}\left(\delta \right)\mathrm{cos}\left(\omega \right)\right)$$

$${E}_{sun}=\mathrm{arccos}\left(\frac{\mathrm{sin}\left(\phi \right)\mathrm{sin}\left(A\right)-\mathrm{sin}\left(\delta \right)}{\mathrm{cos}\left(\phi \right)\mathrm{cos}\left(A\right)}\right)sign\left(\omega \right)$$

$$\delta =23.45\xb0\xb7\mathrm{sin}\left(b\right)$$

$$b=360\xb0\xb7\frac{d-81}{365}$$

$$\omega =15\xb0\xb7\left(Eo{T}_{TC}-12\right)$$

$$Eo{T}_{TC}=H+4\left(\lambda -{\lambda}_{timezone}\right)+9.87\mathrm{sin}\left(2b\right)-7.53\mathrm{cos}\left(b\right)-1.5\mathrm{sin}\left(b\right)$$

Once the azimuth and elevation of the Sun are known for a specific date and time, the shading of each roof in ${\mathcal{C}}_{roofs}$ can be computed. As solar panels are installed oriented to the South in the North Hemisphere, only the cluster subset ${\mathcal{C}}_{s}=\{{\mathcal{C}}_{SW},{\mathcal{C}}_{SE}\}$ is considered for this analysis.

The process that has been followed can be thought of as a visibility analysis where, for each point ${\mathit{p}}_{i}=\left({x}_{i},{y}_{i},{z}_{i}\right)\in {\mathcal{C}}_{s}$, an occlusion search is performed in the direction of a vector with azimuth and elevation (${A}_{sun},{E}_{sun}$), which can be represented in Cartesian coordinates as a unit vector ${v}_{S}=\left({v}_{sx},{v}_{sy},{v}_{sz}\right)$. First, the parametric equations of a line that goes through ${\mathit{p}}_{i}$ with the direction of ${v}_{S}$ are defined:

$$x={x}_{i}+t\xb7{v}_{sx}$$

$$y={y}_{i}+t\xb7{v}_{sy}$$

$$z={z}_{i}+t\xb7{v}_{sz}$$

Then, a sliding sphere of radius 0.5 m is defined and slides through the line by setting a number of equally spaced positions for its center varying the parameter t from Equation (9). For each position of the sphere, the presence of points of ${\mathit{P}}_{r}$ within it is checked. Whenever any point is found, it will be considered that there is an occlusion, which implies the point is shaded.

Finally, for each cluster of points, the surface free of shading is computed following the approach of Section 2.2. If an array with different times of the day is defined, the daily evolution of the shading and the usable surface of a roof can be visualized (Figure 5).

All the parameters that have been computed for each roof can be put together as an object of a class specifically defined to store the results of the process. Therefore, each roof in ${\mathcal{C}}_{roofs}$ is represented by its point cloud, orientation index, elevation, total surface, and usable surface at a time (or array of times) of a given day.

## 3. Case Study

The methodologies defined in this work have been applied to an aerial laser scan of the city of Santiago de Compostela, in the northwest of Spain. The point cloud data employed comes from the Spanish National Plan of Aerial Ortophotography (PNOA) (http://pnoa.ign.es/presentacion), which has acquired aerial point cloud data from the Spanish territory. The aerial system employs the geodetic system ETRS89, with a positioning system that comprises GPS and an inertial system (IMU) for the processing of the trajectory. The LiDAR system has a density of 0.5 points/${\mathrm{m}}^{2}$, with an average distance between points of 1.4 m. It records up to four returns for each pulse, and the altimetric precision of the point cloud has a mean squared error $RMS{E}_{Z}\le 0.2\mathrm{m}$.

Results in Section 4 will employ three different sections of the case study data in order to offer a quantitative measurement of the methodology performance. Each section is easily distinguishable from the others in terms of urban features (Figure 6): (1) The historic center, which dates from the 9th century. The buildings have small fronts and large depths, and the streets have a variable width, generally with North-South direction. (2) The first expansion of the city, from the 20th century. The population growth was fast at that time and, even though the new buildings had a previous planning, the building blocks have irregular shapes, and the heights are not uniform. (3) Second expansion of the city, from the first decade of 21st century. The urban growth is planned, with wide streets and building blocks with regular shapes and height. Table 1 contains information about the number of points and area of the case study data.

## 4. Results and Discussion

The methodology proposed in Section 2 has been validated in the case study data showed in Section 3. First, quantitative results are given for the point cloud samples from the historic center, and the first and second expansions of the city regarding roof surface calculation. Then, qualitative results are given, showing the results after the complete case study data is analyzed, regarding roof classification and shading analysis.

#### 4.1. Roof Parametrization

In order to quantify the performance of the methodology, the point cloud samples were processed, and the extracted roof areas were compared with a manual ground truth that was gathered using data from Google Maps. Note that the outputs of the methodology consider each orientation of a roof as a single element and, also, under-segmentation may be possible if several roofs with the same orientation have not geometric separation. Therefore, the manual reference had to be collected considering both issues (Figure 7). Results are shown separately from each point cloud sample in order to extract meaningful conclusions from the data. Furthermore, to offer reliable and compact results, only the 10 largest roofs of each sample are shown in this section.

Table 2, Table 3 and Table 4 show the results of the comparison between the areas returned by the application of the proposed methodology and the manually measured areas. Several conclusions can be drawn from these results. First, it can be seen that the overall performance of the algorithm is not highly affected by the type of urbanization. The three data samples employed show different classes of urban blocks, and the measurement error varies on the $\pm 3\%$ range. These errors have three different causes: (1) The resolution of the point cloud, as stated in Section 3, is such that the average distance between points is 1.4 m. Therefore, it is likely that the boundaries of the roofs are not precisely measured and a small amount of surface is lost. (2) The presence of balconies close to the roofs (on the top floor of the building) may be interpreted as part of the roof itself, increasing the measured area. This building typology appears specially in the First Expansion of the city (Table 3), which explains the fact that the measured area is larger than the ground truth area and some of the errors are over +10%. (3) Under-segmentation is likely to happen in areas with a high density of buildings with no separation and same height. As long as there is not a physical separation between roofs of different buildings, geometry properties will not be enough to segment them properly, and under-segmentation only implies that measured areas may stand for a group of buildings instead of single buildings, but it should not affect to the precision of the area measurement itself, and therefore it is preferred over over-segmentation. However, it is important to note that the ground truth of over-segmented roofs may be less reliable as the manual reference to be extracted is more complex. It may also include the surface of small chimneys, which can be a relevant source of error in small roofs where these objects represent a considerable proportion of the total surface. This explains the fact that the largest error is presented in the Historic Centre, where the roofs are smaller and there is not separation between many of the buildings.

#### 4.2. Roof Classification and Shading Analysis

The proposed methodology has been applied to the whole case study data, which, as stated in Section 3, comprises approximately 4.5 million points of the city of Santiago de Compostela. In order to process these data, the point cloud is divided in a number of point cells, and each of them is processed individually. Figure 8 shows the results obtained after this processing. Qualitatively, it is proven that the algorithms work consistently across different types of buildings and urban distributions. Table 5 shows some relevant results such as the total area covered by roofs and the area covered on each orientation, as well as the non-shaded area on 16th May at 3 p.m. Note that the non-shaded area corresponds only to those roofs that are oriented to the South.

## 5. Conclusions

In this paper, a methodology for the automatic classification and parametrization of building roofs using 3D point cloud data from an aerial laser scanner is presented, which aims to compute the area of the roofs in urban environments having into account its orientation so further analysis regarding the installation of solar panels can be made. The methodology relies only on the geometry of the point cloud (that is, it only uses the 3D coordinates xyz), and consists of a number of processing steps applied sequentially to the input data. First, a classification of the ground, based on a triangulation of the 3D cloud, filters out unnecessary points. Then, the points that belong to roofs are organized and parametrized, obtaining a number of clusters that represent individual roofs with a set of properties such as area and orientation. Finally, a shading analysis is carried out in order to analyze the usable surface of a roof given a certain date and time, which is useful to know the adequacy of a roof to have solar panels installed.

This methodology was developed in a data-driven fashion, being focused on the case of the Spanish National Plan of Aerial Ortophotography, which provides aerial point clouds of the Spanish territory. The aerial scan of the city of Santiago de Compostela (Spain) was employed as study case for the validation of the methodology. Three different samples, representing well differentiated zones of the city, were extracted in order to quantify the performance of the roof area measurement. It was found that the error is on the $\pm 3\%$ range, which is an interesting result having into account the small point density of the point cloud data. The main conclusion that can be extracted from these results is that aerial point cloud data is totally suitable for carrying out further analysis which can be focused on the adequacy of the buildings to have solar panels installed, not only because the area orientated to the South (considering the analysis on the North Hemisphere) is known, but also because the shading of the roof can be calculated, and therefore the energy loss due to the shading can also be known.

As future work, regarding the presented methodology it would be interesting to compare the results obtained with those that would come from the application of a supervised learning algorithm, as roof classification can be reduced to a binary classification problem. It would also be interesting to apply different state-of-the-art algorithms with data from the PNOA dataset to get a better insight of the performance of this method with respect different approaches that were not designed specifically for this national database. Furthermore, an energy-focused analysis should be carried out in the future, taking the outputs of this work in order to compute the usable surface, loss due to inclination, orientation and shading, and potential installed power of solar panels installed in the roof of a given location. These proposals of future work may be necessary to improve the Technology Readiness Level of the presented methodology to a point where it should be able to be employed at a National level.

## Author Contributions

Conceptualization: M.P.; Methodology, Software: M.S. and M.P.; Validation and Visualization: M.S.; Writing—original draft: M.S.; Supervision, Writing—review and editing—and Project Administration: B.R. and P.L.

## Funding

This work has been partially supported by the Spanish Ministry of Economy and Competitiveness through the project HERMES:S3D—Healthy and Efficient Routes in Massive Open-data based Smart Cities (Ref.: TIN201346801-C4-4-R) and Human Resources program FPI (Grant BES-2014-067736), Spanish Ministry of Interior (Grant SPIP2017-02122), Spanish Ministry of Economy, Industry and Competitiveness (Grant: EUIN2017-87598), and Xunta de Galicia through grant ED431C2016-038.

## Conflicts of Interest

The authors declare no conflict of interest.

## References

- European Commission. Energy Performance of Buildings Directive. Available online: http://resource.npl.co.uk/docs/networks/tman/23feb05_agenda.pdf (accessed on 10 June 2018).
- Eurostat. Renewable Energy Statistics—Statistics Explained; Eurostat: Luxembourg City, Luxembourg, 2016. [Google Scholar]
- Freitas, S.; Catita, C.; Redweik, P.; Brito, M.C. Modelling solar potential in the urban environment: State-of-the-art review. Renew. Sustain. Energy Rev.
**2015**, 41, 915–931. [Google Scholar] [CrossRef][Green Version] - Wittmann, H.; Bajons, P.; Doneus, M.; Friesinger, H. Identification of roof areas suited for solar energy conversion systems. Renew. Energy
**1997**, 11, 25–36. [Google Scholar] [CrossRef] - Nex, F.; Remondino, F. Automatic Roof Outlines Reconstruction From Photogrammetric DSM. ISPRS Ann. Photogramm. Remote Sens. Spat. Inf. Sci.
**2012**, I-3, 257–262. [Google Scholar] [CrossRef] - Ahmadi, S.; Zoej, M.J.V.; Ebadi, H.; Moghaddam, H.A.; Mohammadzadeh, A. Automatic urban building boundary extraction from high resolution aerial images using an innovative model of active contours. Int. J. Appl. Earth Obs. Geoinf.
**2010**, 12, 150–157. [Google Scholar] [CrossRef] - Serna, A.; Marcotegui, B. Detection, segmentation and classification of 3D urban objects using mathematical morphology and supervised learning. ISPRS J. Photogramm. Remote Sens.
**2014**, 93, 243–255. [Google Scholar] [CrossRef][Green Version] - Yang, B.; Dong, Z.; Zhao, G.; Dai, W. Hierarchical extraction of urban objects from mobile laser scanning data. ISPRS J. Photogramm. Remote Sens.
**2015**, 99, 45–57. [Google Scholar] [CrossRef] - Wang, H.; Wang, C.; Luo, H.; Li, P.; Cheng, M.; Wen, C.; Li, J. Object detection in terrestrial laser scanning point clouds based on hough forest. IEEE Geosci. Remote Sens. Lett.
**2014**, 11, 1807–1811. [Google Scholar] [CrossRef] - Soilán, M.; Riveiro, B.; Martínez-Sánchez, J.; Arias, P. Segmentation and classification of road markings using MLS data. ISPRS J. Photogramm. Remote Sens.
**2017**, 123, 94–103. [Google Scholar] [CrossRef] - Yu, Y.; Li, J.; Wen, C.; Guan, H.; Luo, H.; Wang, C. Bag-of-visual-phrases and hierarchical deep models for traffic sign detection and recognition in mobile laser scanning data. ISPRS J. Photogramm. Remote Sens.
**2016**, 113, 106–123. [Google Scholar] [CrossRef] - Sánchez-Rodríguez, A.; Riveiro, B.; Conde, B.; Soilán, M. Detection of structural faults in piers of masonry arch bridges through automated processing of laser scanning data. Struct. Control Heal. Monit.
**2018**, 25. [Google Scholar] [CrossRef] - Hinks, T.; Carr, H.; Laefer, D.F. Flight Optimization Algorithms for Aerial LiDAR Capture for Urban Infrastructure Model Generation. J. Comput. Civ. Eng.
**2009**, 23, 330–339. [Google Scholar] [CrossRef][Green Version] - Vo, A.-V.; Truong-Hong, L.; Laefer, D.F.; Bertolotto, M. Octree-based region growing for point cloud segmentation. ISPRS J. Photogramm. Remote Sens.
**2015**, 104, 88–100. [Google Scholar] [CrossRef] - Soilán, M.; Truong-hong, L.; Riveiro, B.; Laefer, D. Automatic extraction of road features in urban environments using dense ALS data. Int. J. Appl. Earth Obs. Geoinf.
**2018**, 64, 226–236. [Google Scholar] [CrossRef][Green Version] - Hu, X.; Li, Y.; Shan, J.; Zhang, J.; Zhang, Y. Road centerline extraction in complex urban scenes from LiDAR data based on multiple features. IEEE Trans. Geosci. Remote Sens.
**2014**, 52, 7448–7456. [Google Scholar] [CrossRef] - Zhao, J.; You, S.; Huang, J. Rapid extraction and updating of road network from airborne LiDAR data. IEEE Appl. Imag. Pattern Recognit. Work.
**2011**, 1–7, 1–7. [Google Scholar] [CrossRef] - Qin, N.; Hu, X.; Dai, H. Deep fusion of multi-view and multimodal representation of ALS point cloud for 3D terrain scene recognition. ISPRS J. Photogramm. Remote Sens.
**2018**, in press. [Google Scholar] [CrossRef] - Yeh, C.H.; Lin, M.L.; Chan, Y.C.; Chang, K.J.; Hsieh, Y.C. Dip-slope mapping of sedimentary terrain using polygon auto-tracing and airborne LiDAR topographic data. Eng. Geol.
**2017**, 222, 236–249. [Google Scholar] [CrossRef] - Yan, J.; Shan, J.; Jiang, W. A global optimization approach to roof segmentation from airborne lidar point clouds. ISPRS J. Photogramm. Remote Sens.
**2014**, 94, 183–193. [Google Scholar] [CrossRef] - Vosselman, G.; Coenen, M.; Rottensteiner, F. Contextual segment-based classification of airborne laser scanner data. ISPRS J. Photogramm. Remote Sens.
**2017**, 128, 354–371. [Google Scholar] [CrossRef] - Lukač, N.; Seme, S.; Žlaus, D.; Štumberger, G.; Žalik, B. Buildings roofs photovoltaic potential assessment based on LiDAR (Light Detection And Ranging) data. Energy
**2014**, 66, 598–609. [Google Scholar] [CrossRef] - Lingfors, D.; Bright, J.M.; Engerer, N.A.; Ahlberg, J.; Killinger, S.; Widén, J. Comparing the capability of low- and high-resolution LiDAR data with application to solar resource assessment, roof type classification and shading analysis. Appl. Energy
**2017**, 205, 1216–1230. [Google Scholar] [CrossRef] - Wang, H.; Luo, H.; Wen, C.; Cheng, J.; Li, P.; Chen, Y.; Wang, C.; Li, J. Road Boundaries Detection Based on Local Normal Saliency From Mobile Laser Scanning Data. IEEE Geosci. Remote Sens. Lett.
**2015**, 12, 2085–2089. [Google Scholar] [CrossRef] - Fortune, S. Voronoi diagrams and Delaunay triangulations. Comput. Euclidean Geom.
**1992**, 1, 193–233. [Google Scholar] [CrossRef]

**Figure 2.**Data preprocessing. A saliency analysis is performed on the raw point cloud $\mathit{P}$, removing points from the facades (coloured in red), leaving mainly roofs and the ground.

**Figure 3.**Point cloud classification. (

**a**) Delaunay Triangulation of the point cloud, ${\mathcal{T}}_{\mathit{P}ns}$. (

**b**) The geometric features of the triangulation are employed to find the connections between roofs (red points) and ground (black points), which can be used to perform the segmentation using a region growing algorithm. (

**c**) Result of the region growing algorithm. It can be seen that some points are still not classified or misclassified, being a refinement needed at this point. (

**d**) Results after the labelling refinement.

**Figure 4.**Roof parametrization. (

**a**) Four orientation indices are defined for each point: North West-North East, North East-South East, South East-South West and South West-North West. (

**b**) Visualization of the orientation of each point in the cloud ${\mathit{P}}_{r}$. (

**c**) Result of the orientation-driven Euclidean Clustering process. Each cluster is represented in a random color.

**Figure 5.**Shading analysis. The shading of the roof at three different times of the day (morning, noon, and afternoon) is represented in black color.

**Figure 6.**Case study data. (

**a**) The city of Santiago de Compostela (Spain) was analyzed in order to get a qualitative measure of the performance of the methodology. Smaller samples of the point cloud were manually extracted to get quantitative measures from three easily differentiated areas within the city, the historic center (light blue), the first city expansion (light green) and the second city expansion (light red). (

**b**) Point cloud data of the city.

**Figure 7.**Comparison of measured areas with ground truth areas. (

**a**) A cluster of points containing a roof is highlighted in red. Note that it contains only points which are oriented to the South-East, and as there is not physical separation between roofs of different buildings with the same orientation, the cluster presents under-segmentation. (

**b**) The manual reference was collected taking into account this nature of the processing algorithms in order to correctly quantify the performance of the methodology.

**Figure 8.**Roof classification, city of Santiago de Compostela. (

**a**) All the points classified as roofs are highlighted in red. (

**b**) The roofs are colored according to their orientation.

Area | Points | Surface |
---|---|---|

Santiago—City | 4,558,644 | $4.9\text{}{\mathrm{km}}^{2}$ |

Historic Center | 46,541 | $39,660\text{}{\mathrm{m}}^{2}$ |

First expansion | 68,107 | $41,480\text{}{\mathrm{m}}^{2}$ |

Second expansion | 55,172 | $40,044\text{}{\mathrm{m}}^{2}$ |

Roof ID | Measured Area (m^{2}) | Ground Truth Area (m^{2}) | Error (m^{2}) | Error (%) |
---|---|---|---|---|

1 | 537.62 | 552.43 | −14.81 | −2.68 |

2 | 483.66 | 552.52 | −68.86 | −12.46 |

3 | 430.9 | 415.45 | 15.45 | 3.72 |

4 | 411.08 | 424.4 | −13.32 | −3.14 |

5 | 388.80 | 342.39 | 46.41 | 13.55 |

6 | 341 | 348.59 | −7.59 | −2.18 |

7 | 323.54 | 297.56 | 25.98 | 8.73 |

8 | 303.38 | 369.08 | −65.7 | −17.80 |

9 | 265.06 | 272.62 | −7.56 | −2.77 |

10 | 246.24 | 247.4 | −1.16 | −0.47 |

$\sum $ | 3731.28 | 3822.44 | −91.16 | −2.38 |

Roof ID | Measured Area (m^{2}) | Ground Truth Area (m^{2}) | Error (m^{2}) | Error (%) |
---|---|---|---|---|

1 | 862.68 | 978.42 | −115.74 | −11.83 |

2 | 861.87 | 869.96 | 1.91 | 0.22 |

3 | 640.54 | 592.32 | 48.22 | 8.14 |

4 | 667.22 | 562.69 | 104.53 | 18.58 |

5 | 596.72 | 555.89 | 40.83 | 7.34 |

6 | 208.34 | 176.18 | 32.16 | 18.25 |

7 | 515.12 | 508.66 | 6.46 | 1.27 |

8 | 305.80 | 326.07 | −20.27 | −6.22 |

9 | 315.33 | 308.44 | 6.89 | 2.23 |

10 | 305.73 | 341.65 | −35.92 | −10.51 |

$\sum $ | 5279.35 | 5210.28 | 69.07 | 1.33 |

Roof ID | Measured Area (m^{2}) | Ground Truth Area (m^{2}) | Error (m^{2}) | Error (%) |
---|---|---|---|---|

1 | 699.07 | 709.69 | −10.62 | −1.50 |

2 | 678.20 | 684.17 | −5.97 | −0.87 |

3 | 673.06 | 692.16 | −19.10 | −2.76 |

4 | 680.98 | 700.12 | −19.14 | −2.73 |

5 | 672.89 | 652.19 | 20.70 | 3.17 |

6 | 660.02 | 650.81 | 9.21 | 1.42 |

7 | 646.12 | 687.6 | −41.48 | −6.03 |

8 | 629.96 | 665.91 | −35.95 | −5.40 |

9 | 617.81 | 633.77 | −15.96 | −2.52 |

10 | 611.46 | 612.54 | −1.08 | −0.18 |

$\sum $ | 6569.57 | 6688.96 | −119.39 | −1.78 |

**Table 5.**Measured areas of the roofs according to their orientation, and not-shaded areas (on 7th July, 3 p.m.) only measured on roofs which are oriented to the South east—South west.

Orientation | Total Area (m^{2}) | Not-Shaded Area (m^{2}) |
---|---|---|

North West-North East | 221,567.56 | |

North East-South East | 203,349.87 | |

South West-North West | 216,193.09 | |

South East-South West | 221,964.11 | 219,588.80 |

© 2018 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).