Rooftop segmentation and optimization of photovoltaic panel layouts in digital surface models

.


Introduction
Cities are increasingly turning to renewable energy as a means of reducing greenhouse gas emissions and satisfying their high energy needs (REN21, 2018).Among the various renewable energy technologies, rooftop photovoltaic panels (RPVs) are the most feasible in urban areas (Aslani & Seipel, 2022a;Bódis, Kougias, Jäger-Waldau, Taylor, & Szabó, 2019;Gernaat, de Boer, Dammeier, & van Vuuren, 2020;Joshi et al., 2021;Yang, Campana, Stridh, & Yan, 2020).This is because they lower congestion in urban energy networks as a result of selfconsumption without requiring any ground-level land.They can also make a significant contribution to achieving nearly net-zero energy buildings (Attia, 2018).
RPVs, however, cannot be installed on an entire rooftop area.This is because the roof shape, roof objects (ranging from a big dormer to a small plumbing vent), and uneven distribution of solar irradiation restrict areas suitable for RPVs placement.And installing RPVs on unsuitable rooftop areas may reduce their cost-effectiveness.Indeed, roof multiplanarity, roof objects, and partial topographic shadows make finding the optimal placement of RPVs complicated, particularly when applied on a district scale.Thus, identifying a feasible layout of RPVs that best uses the limited space of the roof in terms of energy production is crucial and challenging (Gassar & Cha, 2021).
This study proposes a new spatial methodology for analyzing rooftop areas and automatically identifying the layout of RPVs that leads to efficient energy production.The methodology includes a new plane segmentation method to extract planar segments of rooftops from digital surface models (DSMs), as RPVs are installed based on planar segments.The plane segmentation method has a low risk of under-segmenting roof objects that affect RPVs placement, and it uses new planarity analysis to improve segmentation accuracy.The methodology also contains a new scalable method for placing RPVs over the derived planar segments in an optimal way.This placement method identifies a layout of RPVs that best uses planar segments while avoiding low-irradiated areas.In addition, it mitigates overestimating RPVs potential as it considers roof objects and shadow impacts.
The proposed methodology is especially beneficial for dense urban areas with complex polyhedral roof shapes and high obstructions.It uses DSMs for various purposes, namely plane segmentation, solar irradiation modeling, and placement of RPVs.The salient features of the proposed methodology are as follows: • Taking into account roof shapes, roof objects, and occlusions (i.e., shadows) in finding the optimal layout of RPVs.• Determining the optimal RPVs layout using three dimensions rather than only 2D planar roof coordinates.• Offering a realistic assessment of RPVs potential of buildings as discrete numbers of RPVs are estimated rather than raw areas.• Scalability to large regions as RPVs configurations are optimized independently for each planar segment.• Applicability to various rooftop geometries and solar energy production scenarios.
The remainder of the paper is organized as follows.Section 2 gives an overview of relevant literature about roof plane segmentation and optimization of RPVs placement.The proposed methods for roof plane segmentation and RPVs placement are explained in Section 3. Section 4 describes the test sites.The results of the proposed methods are presented and discussed in Section 5. Finally, in Section 6, the paper is concluded, and some directions for future work are proposed.

Related work
Identifying efficient layouts of RPVs requires consideration of roof shape, roof objects, and occlusions.This is because they have significant impacts on both the number of RPVs and how they receive solar irradiation (Sánchez-Aparicio, Martín-Jiménez, Del Pozo, González-González, & Lagüela, 2021;Aslani, 2022).Within such a context, point clouds and DSMs, acquired by LiDAR or stereophotogrammetry, enable analyzing the feasibility and potential of RPVs layout in three dimensions (Salim et al., 2023;Schunder, Yin, Bagchi-Sen, & Rajan, 2020;Sredenšek, Štumberger, Hadžiselimović, Mavsar, & Seme, 2022).Their combinations with geospatial information systems (GIS) allow for the automatic extraction of roof shapes, their subtle objects, and shadow modeling, which are indispensable for assessing RPVs arrangements and predicting their power generations in a detailed manner (Yildirim, Büyüksalih, & S ¸ahin, 2021;Zhu et al., 2023).LiDAR point clouds and DSMs are often accessible, quickly processed, and widely regarded as reliable data sources for spatial applications requiring height data (Gawley & McKenzie, 2022;Lingfors et al., 2017).

Roof plane segmentation
Roof modeling from DSMs or LiDAR datasets is mainly performed by two families of methods: parametric and generic methods.Parametric methods choose a roof model from a predefined model library that best fits the DSM.First, a hypothetical model library consisting of common roof forms, such as flat, gable, hip, and shed, is defined.Then a roof form that best fits the DSM is chosen, during which the associated parameters are also computed (Coiffier, Basselin, Ray, & Sokolov, 2021;Wang, Peethambaran, & Chen, 2018).Gooding, Crook, and Tomlin (2015) used a parametric method to model the roof forms of buildings for photovoltaic potential estimation in Leeds, UK.Lingfors et al. (2017) compared low and high-resolution LiDAR datasets to evaluate the ability of a parametric method to model the roof shapes for use in assessing RPVs potential of buildings.The results suggest that the high-resolution LiDAR dataset is better suited to modeling roofs with more complexity.While these methods always generate topologically correct and wellshaped roofs, they cannot accurately identify complex roof forms that are not in the specified library.Additionally, roof objects (e.g., chimneys and small dormers), which play an essential role in RPVs placement, might be missed in parametric methods (Mohajeri et al., 2018).
In contrast, generic methods are not restricted to any primitive shapes, and they reconstruct roofs by assembling planar patches obtained via a plane segmentation procedure (Wang et al., 2018;Wang et al., 2020).They have a high potential for modeling all polyhedral buildings of any arbitrary shape with different roof objects, making these methods well-suited for analyzing RPVs placement (Gilani, Awrangjeb, & Lu, 2018;Li et al., 2020).As the central core of generic methods, plane segmentation procedures group points (pixels) into several homogeneous planar regions by applying methods including clustering, region growing, and model fitting (Xu & Stilla, 2021).In all methods, DSM spatial resolution (or point cloud density) has a considerable impact on plane segmentation, and high-resolution DSMs are needed if small roof objects are to be distinguished.
In plane segmentation using clustering, planar patches are identified based on specific predetermined points attributes.Normal vectors are the most common attribute used in this group of methods, as points in the same plane have similar normal vectors (Xie, Tian, & Zhu, 2020;Xu & Stilla, 2021).Planarity analysis, which separates planar from nonplanar points, may also be incorporated to provide robust solutions (Sampath & Shan, 2010).In the context of RPVs, Lukač, Špelič, Štumberger, and Žalik (2020) segmented roof planes from DSMs using density-based spatial clustering of applications (DBSCAN) (Ester, Kriegel, Sander, & Xu, 1996) to determine the optimal placement of RPVs.In their method, multiple clustering attributes, namely position, slope, azimuth, and shadow values of pixels, are employed to obtain reliable results.The major shortcomings of clustering-based segmentation methods are computational costs and inadaptability to new datasets.To address these issues, a novel plane segmentation method based on an adaptive and time-efficient clustering algorithm was developed by Aslani and Seipel (2022b).The time complexity of the clustering algorithm is linear with respect to the number of data points, making it suitable to handle large datasets.Moreover, the adaptability of the algorithm enables automatic identification of the shape and number of clusters in data without necessitating complex tuning of the parameters, simplifying the process of applying it to new datasets.The results show that their method leads to reliable outcomes.
Plane segmentation based on region growing consists of a sequential process that uses local surface attributes to merge close points or regions with comparable attributes (Vo, Truong-Hong, Laefer, & Bertolotto, 2015).Seed regions, the origins of the growing process, are first selected to initialize planar segments, and then each region grows by checking its surrounding points according to given similarity criteria (Araújo & Oliveira, 2020;Dong, Yang, Hu, & Scherer, 2018).To assess RPVs potential, Huang et al. (2015) and Jochem, Höfle, Rutzinger, and Pfeifer (2009) used region growing to segment rooftops into planar patches.Despite the ease of implementation, the segmentation quality of these methods depends strongly on both the location of seeds and the sequence in which seeds grow (Xie et al., 2020).
Model-fitting-based methods group points at a local or global level based on matching them to different geometric models (Nguyen & Le, 2013).Several geometric models are fitted to points, and the model that best fits is selected.The points that suit the chosen model are then grouped as a single segment.Random sample consensus (RANSAC) is one of the most common robust estimators that has been widely used for plane segmentation in the category of model-fitting-based methods (Xu & Stilla, 2021).It picks a definitive model from a number of candidates (e.g., planes), each generated from the smallest possible subsets of points (e.g., three points for planes).RANSAC has been initially designed for single-model problems, i.e., there is only one model that should be identified (Fischler & Bolles, 1981).Different variants of single-model RANSAC have been developed to achieve better performance, such as locally optimized RANSAC, maximum a posterior estimation sample consensus (MAPSAC), and maximum likelihood estimation sample consensus (MLESAC) (Raguram, Chum, Pollefeys, Matas, & Frahm, 2013;Xie et al., 2020).Roof plane segmentation using RANSAC is a multi-model fitting problem in the sense that there might be multiple planes to be detected rather than only one plane.A straightforward generalization to multi-model fitting problems is to sequentially use single-model RANSAC as López-Fernández, Lagüela, Picón, and González-Aguilera (2015) used.However, this strategy, i.e., sequential RANSAC, alone may produce spurious planes.Spurious planes refer to the planes that do not represent actual surfaces in the scene.
To overcome some of the stated limitations, this study contributes to a new plane segmentation method that integrates multi-model fitting and region growing.It includes a new planarity analysis method to accurately recognize and exclude non-planar pixels from the multimodel fitting procedure to circumvent the creation of spurious planes.Normal vectors are also incorporated to ensure roof topologies are correctly identified.Modified region growing is used to accurately assign the excluded non-planar pixels to the initially identified planes and avoid the issue of over-segmentation.Seeds significantly affecting region (segment) growing performance are determined based on locally optimized RANSAC to warrant robust solutions.

RPVs placement
After roof plane segmentation, appropriate areas of roof segments for installing RPVs should be identified.Small segments and those with low solar irradiation along with panel setback areas (i.e., the margin between the edges of RPVs and roof faces) are removed as they are not suitable for accommodating RPVs.Buffer analysis and some thresholds (e.g., area threshold) determined from local regulations of RPVs installations can be used to remove unsuitable areas from planar segments (Huang et al., 2015;Nelson & Grubesic, 2020).
The next step is to design proper RPVs layouts on the determined suitable segments.Automatic design is preferred over human design at this point as it can potentially improve RPVs efficiency while decreasing design costs.In this regard, Jung, Jeoung, Kang, and Hong (2021) developed a method based on reinforcement learning for optimal placement of RPVs in the Nonhyeon district, South Korea.In their method, reinforcement learning is used to optimize the long-term economic return of RPVs while taking the uncertainty of simulation into account.However, roof forms and structural details are ignored, and all roofs are assumed to be flat.Udell and Toole (2019) used mixed-integer linear programming to identify the optimum placement of RPVs by considering roof shapes.Their method requires a detailed 3D model of buildings as an input, which is not always available.
Zhong and Tong (2020) developed a method that does not rely on detailed 3D building models.A DSM, instead, is used to provide a 2.5D spatial profile of roofs and their surrounding environment.The optimal placement of RPVs is treated as a maximal covering problem in which some facilities are expected to satisfy demands.Facilities are defined as RPVs, and demands are defined as suitable rooftop locations that meet slope, azimuth, and sunlight requirements.The RPVs location and orientation (landscape and portrait) are determined such that the maximum area of suitable regions (demand) is covered by RPVs (facilities).This method allows RPVs to be placed on dividing lines between neighboring roof planes, which are typically unsuitable for RPVs.Sánchez-Aparicio et al. (2021) developed a web-based application for automatically designing RPVs layouts and estimating their energy output.It considers the overall form of roofs (called a LoD2 model), acquired from the integration of LiDAR and aerial images, in placing RPVs.However, it places RPVs without regard to roof features (e.g., chimneys and vents) and shadow effects, which significantly impact RPVs placement in practice.Indeed, RPVs might be placed over chimneys or vents, unsuitable for mounting RPVs.Similarly, in the methodology proposed by Yildirim et al. (2021), RPVs layouts are automatically designed on a LoD2 model of roofs regardless of roof objects.
In Mainzer, Killinger, McKenna, and Fichtner (2017), a procedure to automatically place photovoltaic panels was developed.It considers planar segments and roof objects without detailed 3D models and only uses publicly accessible building footprint maps and orthophotos.The procedure starts with isolating rooftops in orthophotos using building footprint maps.Next, planar segments are extracted by applying a Canny edge detection algorithm followed by the Hough transformation on orthophotos of rooftops.Roof objects are then derived through contour detection and polygon approximation techniques.Finally, usable areas are identified by subtracting roof objects from planar segments, and an algorithm that progressively iterates over usable areas is employed to fit as many solar panels as possible within each rooftop.However, this approach exhibits some limitations.As no elevation datasets are used, tilts of roof segments are randomly assigned, leading to inaccurate results for each building individually.Furthermore, while planar segments and roof objects are taken into account when placing RPVs, solar irradiation and shadow-both of which are critical to the efficiency of RPVs-are disregarded in the placement procedure.
de Vries et al. (2020) integrated elevation data (LiDAR) with orthophotos to identify major planar segments and roof objects necessary for placing RPVs.In the proposed methodology, the optimal layouts are determined using a brute-force search such that the highest number of RPVs can be placed on each identified segment by considering roof objects.Shadow effects are ignored in the optimization of RPVs layout.Their methodology requires aerial images and LiDAR point clouds, which may not be accessible in all areas.Moreover, effectively using both datasets requires accurate reference frame alignment.Lukač et al. (2020) proposed a new method independent of orthophotos and relying only on DSMs.Differential evolution, instead of a brute-force search, is used to determine the optimal layout of RPVs.Although their method considers shadow, it ignores the alignment of RPVs with edges of roof segments as well as the distance between edges of roofs and RPVs (setback area).
Most of the stated studies disregard shadow effects (de Vries et al., 2020;Mainzer et al., 2017), roof objects (Jung et al., 2021;Yildirim et al., 2021), or even installation constraints (Sánchez-Aparicio et al., 2021;Zhong & Tong, 2020) in determining the optimal layout of RPVs.And they usually employ an inefficient brute-force search (de Vries et al., 2020;Mainzer et al., 2017).To address some of the mentioned issues, this work presents a novel solution based on metaheuristic optimization for automatically optimizing the layout of RPVs.It considers various parameters of RPVs layout, such as direction, orientation (portrait or landscape), and row distance, as well as the shape of roof segments, solar irradiation, occlusion, and installation constraints.More specifically, the method searches for a feasible layout aiming to avoid low-irradiated areas and maximize total energy production using a metaheuristic optimization algorithm.The layout that has the maximum number of RPVs in the regions with high solar irradiation is identified.

Proposed methodology
In this section, a new spatial methodology for identifying and analyzing roof shapes and roof objects with the goal of optimizing RPVs layout is presented.Roofs are decomposed into their planar segments, and each planar segment is analyzed in terms of solar energy and shape to determine an efficient layout.The proposed methodology consists of two primary components: roof plane segmentation and RPVs layout optimization, detailed in the following subsections.

Roof plane segmentation
DSMs provide 2.5D representations of areas, but they do not distinguish between buildings and other objects.Building footprint maps are used to separate surface models of individual buildings.However, the resulting models still do not differentiate between roof faces (planar segments), which play a critical role in the context of RPVs installation.Plane segmentation is thus required to separate planar segments of roofs.The major steps of the proposed roof plane segmentation are shown in Fig. 1.In the first step, a new planarity analysis is performed to exclude pixels located on ridges or edges of roofs.Then, the remaining pixels are segmented based on locally optimized RANSAC.Finally, the excluded pixels are assigned back to the best-fitting segments, and oversegmented patches are merged using segment growing.

Identification of non-planar pixels
Using RANSAC to successively extract planar segments often creates spurious planes across borders between two roof faces, such as roof ridges.This is because pixels in these regions, called non-planar pixels, contribute to the process of hypothesis generation in RANSAC and result in narrow segments forming over the vicinity of two roof faces.To prevent creating these spurious planes, it is first necessary to exclude non-planar pixels from RANSAC.
A typical method to check the planarity of a point and its neighbors is based on fitting a plane using principal component analysis (PCA) and comparing the magnitude of the resulting eigenvalues (Li et al., 2017;Limberger & Oliveira, 2015).However, PCA generates inconsistent normal vectors that are considerably sensitive to changes in their neighborhood, making the identification of non-planar pixels problematic.To overcome this problem, we propose a simple yet effective method for the planarity test.In this method, PCA normal vectors are robustly re-estimated, and the original and re-estimated normal vectors are compared to identify non-planar pixels.The pseudocode of the method is shown in Algorithm 1.It employs the pre-computed normal vectors by PCA, LN, as prior knowledge and uses the median estimator to generate new normal vectors (line 3 in Algorithm 1).As the median estimator is robust, the resulting normal vectors are more consistent and less affected by changes in their local neighborhood, facilitating the recognition of non-planar pixels.To check planarity, the difference between the normal vector direction of each pixel and those of its neighbors is measured.A pixel is deemed non-planar if the angle between its normal vector N and any of its nearby PCA's normal vectors LN p is greater than the predefined angle threshold θ (lines 5-10 in Algorithm 1).It is based on the fact that planar pixels have a neighborhood with relatively similar normal vectors, while non-planar pixels have heterogeneous normal vectors in their neighborhoods.

Multi-model fitting
The identified planar pixels are segmented into non-overlapping segments by fitting multiple planes based on RANSAC.However, the classical form of RANSAC is not utilized for model fitting.Classical RANSAC might not be able to correctly group all pixels of a segment even though hypothesized planes are not contaminated by outliers.In other words, a random plane produced by the pixels from the same segment may not lead to a discovery of its entire pixels in classical RANSAC.This is because classical RANSAC uses the minimum required number of samples (3 points) to estimate the final model and may thus produce a plane that is not the best representative of the planar segment.To address this issue, we use locally optimized RANSAC (Lebeda, Matas, & Chum, 2012) instead of classical RANSAC.It enhances classical RANSAC by performing a local optimization step on the so-far-the-best plane.Indeed, the local optimization step is carried out iteratively using least-squares refitting inside an inner classical RANSAC.In this manner, the resulting plane better represents the segment, increasing the possibility of satisfactorily recognizing it.
Algorithm 2 shows the pseudocode for the multi-model fitting algorithm.It is based on a combination of Euclidean clustering (Rusu, 2009) and locally optimized RANSAC applied to the planar pixels successively in a subtractive manner.First, locally optimized RANSAC (Lebeda et al., 2012) is executed to obtain a planar segment.In locally optimized RANSAC, both the point-plane distance and the angle between the point normal vector and the plane normal vector are considered to maintain the topology of the segments and avoid the creation of meaningless segments (spurious patches).A pixel is an inlier if its distance from the plane is less than v and the angle between its normal vector and the plane normal vector is less than θ.These thresholds should be determined based on the DSM accuracy and the rooftops geometry.The resulting segment may include multiple unconnected sub-regions as spatial connectivity of pixels is not considered in locally optimized RANSAC.Thus, the next step applies Euclidean clustering to separate the unconnected sub-regions as independent segments.Then, small segments with less than 3 pixels are discarded as they may not produce accurate planes.Afterward, the pixels belonging to the identified segments are removed from the planar pixel set S. The mentioned steps continue on the remainder of the planar pixels until no acceptable segments are found.The pixels that cannot be assigned to any segments are added to the non-planar pixel set Q.

Segment growing
This step refines the multi-model fitting results and decides on the non-planar pixels using a segment growing-based procedure (Algorithm 3).The designed segment growing procedure uses the obtained segments as seeds, obviating the need for seed selection in classical segment growing.Given a list of initial segments PS acquired from the previous step, the segment growing procedure starts from the largest segment SE and proceeds by examining its neighbors.Adjacent segments in PS and non-planar pixels are added to segment SE if they are accurately estimated by its plane ψ (lines 9-16 and 18-27 in Algorithm 3).Point-toplane distance and normal consistency are two criteria applied for growing.Particularly, the point-to-plane distance threshold v and the angle threshold θ are used to identify the pixels and segments coplanar with plane ψ.After the segment is grown, its plane ψ is updated using all M. Aslani and S. Seipel its pixels.The neighbors of the grown segment are examined in further iterations until no new neighboring pixel or segment can be merged.Once the expansion of segment SE is complete, SE and all merged segments are labeled (excluded from the list PS) so that they can no longer be used and initiate another segment.However, the merged non-planar pixels become unallocated (non-labeled), and as a result, they can be used by more than one segment to mitigate the effects of the growing order of segments on results.The next segment is grown using the largest segment in PS and following the same procedure described above.The iterative procedure continues until no more segments are left in PS.
After all segments have been grown, the best-fitting segment for each non-planar pixel needs to be determined.The non-planar pixels should be attached to the segments so that the segmentation accuracy is preserved while borders of segments are not distorted.To this end, the best segment for a non-planar pixel is chosen based on its proximity to the segments to which it could be assigned during the segment growing procedure.The distances between a non-planar pixel and its corresponding segments are first determined, and the segment that is closest to the non-planar pixel is picked as the most appropriate segment.The non-planar pixels that cannot be assigned to any segments are considered outliers (e.g., antenna and vegetation points).

RPVs layout optimization
After plane segmentation, the optimal layout of RPVs is determined for each acquired roof face (planar segment) independently.RPVs are placed based on installation constraints, roof face geometry, and solar irradiation.Fig. 2 depicts the workflow of the proposed method for RPVs placement, which comprises two major phases.The information required for designing RPVs layouts is obtained in the first phase, such as shrunken boundaries of roof faces satisfying installation constraints and a solar irradiation map.In the second phase, the RPVs optimal layouts and their energy yields are determined.This work considers only typical installations in which RPVs are directly attached to roofs.

Phase 1: initial processes
Achieving the optimal layout of RPVs requires having solar irradiation distribution over roof faces.This is because the performance of photovoltaic panels is a function of the amount of solar irradiation they receive.The solar irradiation incident on a roof face in a given period depends on the tilt, aspect, location, and surrounding objects of the roof face as well as the metrological conditions, all of which should be considered for a reliable estimate of solar irradiation.We use the solar model in ArcGIS Desktop to estimate solar irradiation because of its thoroughness and computation efficiency (Fu & Rich, 2000;Rich, Dubayah, Hetrick, & Saving, 1994).It has been broadly applied to many solar studies, showing its good performance (Kausika & van Sark, 2021;Radosevic, Duckham, Liu, & Sun, 2020;Zhu et al., 2022).The model considers occlusion, atmospheric effects, site topography, and variations in the sun position in global solar irradiation estimation.It includes efficient occlusion analysis to account for shadows cast by buildings, vegetation, and structural elements.The atmospheric effects estimation relies on two parameters: transmittance and diffuse proportion.Transmittance represents the ratio of solar irradiation reaching the earth surface by the shortest path to solar irradiation received at the atmosphere's upper edge.Diffuse proportion denotes the fraction of global normal irradiation flux that reaches the ground after being dispersed by atmospheric molecules.These two parameters should be adjusted to reflect the weather conditions of the geographic region, ranging from very clear skies to overcast.The model can compute solar irradiation at different spatio-temporal granularities, specified by zenith divisions, azimuth divisions, hour interval, and day interval parameters.Parameters zenith divisions and azimuth divisions are used to discretize the sky-dome, and parameters hour interval and day interval are used to discretize the sun path.These parameters are independent of the DSM spatial resolution.A higher spatial resolution of the DSM and a finer granularity of the model enable a more detailed estimation of solar irradiation, albeit at the expense of longer computation time.Thus, when using highresolution DSMs, the solar model parameters should be set such that the computation cost does not hinder obtaining the results.
After computing solar irradiation, the extent of each roof face satisfying RPVs installation regulations should be determined.To this end, the following steps are suggested for each roof face.Firstly, the boundary points of the roof face are extracted (Fig. 3a) (Gonzalez, Woods, & Eddins, 2020).They are then projected onto the roof face to eliminate their small vertical distances from the roof face.Afterward, Fig. 2. Workflow of the proposed method for RPVs placement on a planar segment.
the projected points are converted to 2D using Eq. ( 1).In this equation, λ and ω are the azimuth and tilt of the normal vector of the roof face (in degree), P → is a 3D boundary point projected on the roof face, h is the intercept of the roof face, and T is the transpose operator.This equation transforms the coordinate system such that its Z-axis becomes parallel to the normal vector of the roof face.As all points are on the same planar segment, their new Z coordinates become equal and can be skipped in the optimization step.This transformation, i.e., from 3D to 2D, reduces the computational complexity and simplifies the RPVs placement computations while considering the effect of the third dimension.A new planar polygon PG is obtained by connecting the resulting points P ′ → (Fig. 3b).
RPVs can only be placed on specific areas of a roof face due to some restrictions, which are mainly imposed to facilitate accessibility and avoid wind uplift on modules.Typically, these restrictions prohibit placing RPVs too close to roof edges, adjacent roof segments, and obstructions.There should be space between the edges of RPVs and the edges of roof faces, called setback areas.Setback areas are excluded from polygon PG using buffer analysis, which shrinks the polygon by the requested width W sb (Fig. 3c).The value of W sb , setback area width, depends on local regulations of RPVs installation.

Phase 2: RPVs placement and energy estimation
For each polygon obtained from the previous step, the optimal layout of RPVs is determined.In this study, the optimal layout is defined as one that receives the highest amount of solar irradiation and does not deploy any of its RPVs in areas with low solar irradiation.According to this definition, the optimal layout is an efficient layout in the sense that it includes the highest number of RPVs placed in highly irradiated areas and hence has high efficiency in energy production.Identifying the optimal layout requires parameterization of RPVs placement (i.e., parametric modeling of RPVs layout) and defining an objective function.Given a shrunk roof face RF, a layout of RPVs is defined using the following variables: : starting point for RPVs placement.
• d: distance between two consecutive rows of RPVs.
• k: distance between two consecutive RPVs in rows.
Fig. 4a illustrates these variables.In this figure, the RPVs orientation j is landscape.All RPVs of a layout are placed based on the same value of the variables; thus, they are always aligned and have the same orientation and direction on a roof face.Although having different values of the variables for each RPV may increase flexibility in the placement procedure, it creates a huge search space that is dependent on the number of RPVs.Moreover, mounting RPVs with various directions, orientations, and distances on the same roof face is not common in practice due to installation costs.Thus, in this study, the variables have identical values for all RPVs on each roof face.In addition to these variables, the length and width of RPVs are assumed constant in the RPVs placement procedure as RPVs are typically standardized in size.
The following steps are taken to produce a layout of RPVs on a shrunk roof face RF.Firstly, the bounding box of RF is computed.Then, is selected inside the bounding box.The location of point O is constrained not to be any further than the length of an RPV away from the smaller edge of the bounding box.Indeed, the distance between point O and the shorter edge of the bounding box should not exceed the length of an RPV.Applying this constraint prevents the generation of layouts that are unlikely to be (near)-optimal and can accelerate convergence.Next, variables β, j, k, and d are set, and the coordinates of RPVs nodes that fall inside the bounding box are calculated.For instance, the coordinates of node 1 of panel A, node 2 of panel B, and node 3 of panel C in Fig. 5 are calculated according to Eq. ( 2), where RPV L and RPV W denote the length and width of an RPV, respectively.
To ensure that RPVs are arranged with no overlap, two constraints are applied according to Eq. (3).Afterward, RPVs that are not entirely inside polygon RF are eliminated (Fig. 4b).Finally, the average solar irradiation over each RPV is computed by combining it with the solar irradiation map, and RPVs with the average solar irradiation above a specific threshold S T are considered efficient and preserved (Fig. 4c).Indeed, this step removes inefficient RPVs that are not sufficiently exposed to the sun due to azimuth, tilt, or occlusion.The threshold S T shows the minimum acceptable average solar irradiation for installing RPVs, and it should be set to a value that leads to adequate efficiency.
An objective function should be defined to evaluate a produced layout.Depending on the aim of RPVs installation, different objective functions can be defined.In this study, the layout of RPVs that receives the highest solar irradiation is desired.Thus, the objective function is defined according to Eq. ( 4), where SI c is the average global solar irradiation over the c-th RPV, and N is the number of produced RPVs.
The layout that maximizes the objective function is chosen as the optimal layout.One strategy to find the optimal layout is to discretize the search space, produce all possible layouts, and select the one that maximizes the objective function.Although this strategy, termed bruteforce, is straightforward, it is computationally demanding as all possible candidates for layouts must be systematically checked.A genetic algorithm, metaheuristic optimization, is employed to circumvent this issue.It is a general-purpose optimization algorithm that relies on principles inspired by natural selection (Holland, 1992).In genetic algorithms, solutions evolve using a randomized but structured information exchange, leading to controlled variations and guided searches.There are many other optimization algorithms with different variants (e.g., Bat, Whale, and Bee algorithms) that can be used instead of a genetic algorithm in this phase.However, determining which optimization algorithm best fits the problem is out of the scope of this work, and a genetic algorithm is utilized only as a proof of principle.
In the RPVs placement procedure, the genetic algorithm first randomly creates a set of layouts (solutions).Then, the produced layouts evolve using selection, crossover, and mutation, which are biologically inspired operators (Fig. 6).Selection guides the algorithm toward layouts more similar to the optimal layout.Crossover generates valid novel layouts by combining the properties of the previous set of layouts.Mutation introduces diversity among layouts and prevents converging toward local optima.The evolution procedure repeats until a stopping criterion, such as no improvement in the best layout performance during multiple iterations, is satisfied.Please refer to Haupt and Haupt (2004) for more details on genetic algorithms.Placing RPVs in this way is scalable as they are independently set for each roof face.The time complexity of the employed genetic algorithm for each roof face mainly depends on the number of iterations G, the number of solutions generated in each iteration P, and the objective function.The time complexity of the objective function depends on the number of RPVs that can be  After optimization, the corresponding 3D coordinates of the resulting RPVs are computed using Eq. ( 5), where x RPV and y RPV are the coordinates of a node of an RPV, λ and ω are the azimuth and tilt of the normal vector of the roof face (in degree), h is the intercept of the roof face, and T is the transpose operator.R T z ( − λ), R T y (ω − 90), and R T z (λ) are the transpose of R z ( − λ), R y (ω − 90), and R z (λ), as defined in Eq. (1).
Lastly, the energy production of the obtained RPVs is estimated using a linear model, shown by Eq. ( 6).In this equation, E c and SI c are the solar electricity yield (kWh) and average global solar irradiation (kWh/m2 ) of the c-th RPV, and β pr , β e , and A RPV are the performance ratio, efficiency, and area of the RPV.The performance ratio indicates how close the actual performance of an RPV is to its ideal performance.It quantifies the total impact of losses (e.g., temperature and dirt) on the energy production of the RPV.The efficiency of an RPV shows the relationship between its output electric power and its input solar power relative to its area.And it depends on the employed technology of the RPV (Green et al., 2023).

Test sites and data
The proposed methodology is evaluated in two areas in Gothenburg and Uppsala, Sweden.Both Gothenburg and Uppsala are among the most environmentally friendly cities in Sweden, with a steady increase in RPVs deployment.The selected test sites have different urban densities and morphologies, affecting RPVs placement.Additionally, their DSMs were produced using different approaches, making the assessment of plane segmentation more comprehensive and credible.
The Gothenburg test site is located in the city center and features a variety of architectural styles.It is characterized by densely clustered buildings with complex roof shapes composed of many roof planes.The DSM has a spatial resolution of 10 cm, and it was produced through image matching of aerial images captured by the Swedish mapping, cadastral, and land registration authority1 in 2018 (Fig. 7a).The test site in Uppsala is about five kilometers from the city center, and it is entirely residential, with detached buildings of different orientations.The DSM of the Uppsala test site was created from a high-density LiDAR point cloud produced by Uppsala municipality 2 in 2020.The point cloud density was heterogeneous, but its average density of 67 pts./m 2 was sufficient to create a DSM with 15 cm spatial resolution (Fig. 7b).According to the descriptions (metadata) of the acquired datasets, the DSM of Gothenburg has a lower height accuracy than the Uppsala LiDAR dataset.The updated building footprint maps of both areas, showing the extent of roofs (not plinths), were produced based on the property maps provided by the Swedish mapping, cadastral, and land registration authority.The ground truth planar segments of the rooftops were manually produced to assess the performance of plane segmentation (Fig. 7c and  d).All spatial datasets were prepared using the same projection system and reference ellipsoid to prevent potential inconsistencies.

Results and discussion
The outputs of plane segmentation and RPVs placement on the test sites are presented and discussed.In Section 5.1, the results of the proposed plane segmentation method and an assessment of their accuracy when compared with the ground truth datasets are presented.Moreover, the performance of the method is benchmarked against that of classical RANSAC.In Section 5.2, the results of RPVs placement are analyzed.All algorithms related to plane segmentation and RPVs placement were implemented in MATLAB 2021.3

Roof plane segmentation
To evaluate the performance of the proposed plane segmentation method, it is applied to the DSMs of the test sites.The angle threshold θ is set to 7 • for both test sites, and the point-to-plane distance threshold v is set to 10 cm for the Uppsala test site and 15 cm for the Gothenburg test site.A trial-and-error procedure, applied on small parts of the test sites, was used to determine these values.It should be noted that the sensitivity of the results to θ and v depends on the geometry of rooftops and the accuracy of the DSM.
A visualization of the segmentation results on some buildings in the test sites is displayed in Fig. 8.As observed from the figure, most of the segments are identified successfully.Moreover, non-planar pixels, especially over ridgelines, are satisfactorily segmented.This is because non-planar (e.g., boundaries) and planar pixels are separated and treated independently during the segmentation procedure.The holes in the roof faces are due to groups of pixels that the plane segmentation method can neither assign to the existing segments nor produce separate suitable planar segments for.Indeed, they contain roof objects (e.g., small chimneys) that do not consist of planar segments sufficiently large to be captured by the proposed method.To be suitable for RPVs placement, the method recognizes only planar segments, whereas nonpolyhedral or very small rooftop features are not captured.It is worth noting that omitting non-polyhedral or small rooftop features does not affect the placement of RPVs as they are not practically suitable to Fig. 6.System diagram of the optimization of RPVs layout using the genetic algorithm.A set of layouts, randomly generated at first, evolves using selection, crossover, and mutation operators until a stopping criterion is satisfied.accommodate solar panels.
To quantitatively assess the performance of the plane segmentation method, its outputs are compared with the ground truth data (see Section 4), and three metrics are computed: recall, precision, and quality.Recall indicates the proportion of pixels in the ground truth that are correctly identified.Precision that evaluates the exactness of the method represents the percentage of correctly segmented pixels in the resulting planes.Quality is the compound of recall and precision, and it serves as an overall measure of performance.All three measurements are calculated based on true-positive TP, false-positive FP, and false-negative FN according to Eqs. ( 7)-( 9) (Awrangjeb & Fraser, 2014;Cai, Shi, Miao, & Hao, 2018).
TP denotes correctly segmented pixels, FP denotes incorrectly segmented pixels, and FN denotes falsely unsegmented pixels.Table 1 shows the evaluation results of the roof plane segmentation method in the test sites, and it suggests that most of the roof planes are successfully identified.According to Rottensteiner et al. (2014), the method is effective as all measures are greater than 80% in both test sites.It is also observed that the method has better performance in the Uppsala test site than in the Gothenburg test site, which is attributed to the complexity of roofs and the accuracy of DSMs.Indeed, this is because the roofs of the Gothenburg test site are more complex than those of the Uppsala test site, and the DSM of Gothenburg has a lower height accuracy than that of Uppsala.
While the method performs well, there are still some plane segmentation errors.Fig. 9 illustrates two cases where the method is unable to segment the roof faces appropriately.In both examples (Fig. 9a and  b), the roof faces occluded by tree canopies cannot be completely identified (under-segmentation).However, in Fig. 9a, there are also some spurious planes identified above the tree, which can be attributed to the flat local surfaces of the tree.
The effectiveness of the proposed method is verified by benchmarking it against RANSAC, a commonly utilized plane segmentation method (López-Fernández et al., 2015;Xie et al., 2020).The point-to- plane distance threshold v of RANSAC is set to 15 cm and 10 cm for the Gothenburg and Uppsala test sites, respectively.Table 2 shows the assessment results of RANSAC in terms of recall, precision, and quality.
Comparing Tables 1 and 2 indicates that the proposed plane segmentation method outperforms RANSAC in both test sites.

RPVs layout optimization
Placing RPVs involves estimating solar irradiation over rooftops, allowing for quantification of the amount of energy collected by each RPV.In the employed solar model, the diffuse proportion and transmittance parameters used in modeling atmospheric effects have significant impacts on solar irradiation estimates.These parameters were calibrated using the monthly global horizontal irradiance acquired from NASA surface meteorology and solar energy database4 to achieve accurate solar irradiation estimates (Table 3).Fig. 10 shows the estimated annual global solar irradiation in some scenes from the test sites.The solar irradiation intensity across the rooftops is greater than across the Fig. 8. Roof plane segmentation results of some buildings in the Gothenburg (first row) and Uppsala (second row) test sites.

Table 1
Assessment results of the proposed method in the test sites.ground surfaces, owing to the impact of partial occlusion of the ground by the built-up structures.South-facing roof faces offer the highest potential for solar irradiation, followed by east-and west-facing roof faces.
To have a better understanding of the impact of spatial resolution and shadow on solar irradiation estimates, we compare the modeled outputs with the estimated solar irradiation values obtained from the European Commission Joint Research Center (PVGIS)5 and the National Renewable Energy Laboratory (NREL).6PVGIS and NREL are publicly available web applications that enable users to obtain solar irradiation data for vast regions of the globe.Fig. 11 compares the monthly average solar irradiation of PVGIS, NREL, and our modeled outputs in the test sites.The figure suggests that PVGIS and NREL overestimate solar irradiation.This is because the solar irradiation modeling in PVGIS and NREL is simplified, and they do not consider high levels of detail in their estimations.For instance, the spatial granularity for modeling occlusion in PVGIS is 90 m, rendering it incapable of modeling the impact of shadows cast by nearby objects in a detailed manner.In our modeling, however, the spatial resolutions of the DSMs are 10 cm and 15 cm; thus, a high level of detail is considered for shadow modeling.Moreover, the simplifications used in PVGIS and NREL lead to the solar irradiation profiles (blue and red curves in the figure) with almost the same range in both test sites, 10-170 kWh/m 2 /month.However, the solar irradiation profiles based on our outputs (green curves in the figure) have different ranges, 10-115 kWh/m 2 /month in Gothenburg and 10-75 kWh/m 2 / month in Uppsala.
RPVs are placed using the pre-computed solar irradiation maps and planar segments of rooftops.Table 4 lists the parameters, variables, and their values for placing RPVs.The width of setback areas W sb , margins between the edges of RPVs and roof faces, is set to 0.5 m, which is according to the local regulations of RPVs installation in the test sites.The solar irradiation threshold S T specifies the minimum amount of irradiation required for an RPV to be worth considering, and its value is technology-and location-dependent (Compagnon, 2004;Kanters & Wall, 2014;Thopil, Sachse, Lalk, & Thopil, 2020).Based on experts' recommendations and in accordance with several recent studies (Lingfors et al., 2017;Mohajeri et al., 2018;Thebault, Clivillé, Berrah, & Desthieux, 2020), parameter S T is set to 1000 kWh/m 2 /year.Moreover, the size of RPVs is set to 1.7 m × 1.0 m, which is the typical size of commercial rooftop photovoltaic panels.
As detailed in Section 3.2.2, in the optimization, layout variables (O, j, β, d, k) are determined to maximize the objective function.To investigate the effect of some layout variables, two different scenarios are designed in RPVs layout optimization.In the first scenario, variables k and d, distances between RPVs, are assumed to be constant and not optimized, and they are set to their minimum values (see Table 4).Moreover, variable β, the direction of RPVs rows, is limited to only four possible values for practical and esthetical reasons.It can take on {γ, γ + 90,γ − 90,γ + 180}, where γ is the azimuth (aspect) of the longest edge of the roof face, parallel or perpendicular to the nearest edge of its building footprint.In this manner, RPVs are aligned with the longest edge of the roof face, which is common in practice.The results of layout optimization in scenario 1 over some buildings in the test sites are shown in Fig. 12.
As is evident from Fig. 12, roof shapes and roof objects are considered in placing RPVs.Additionally, the proposed methodology avoids mounting RPVs over areas with low solar irradiation.For instance, no RPVs are mounted over the lower part of the roof face in the bottom left scene due to the shadow cast by surrounding trees.As expected, northfacing roof faces do not have sufficient suitability for RPVs.There is no space between two adjacent rows or columns as parameters k and d are set to their minimum values and are excluded from optimization.Rows of RPVs are aligned with the roof faces, parallel or perpendicular to the longest edge of the roof faces, which is because of limiting variable β to some specific directions.
In the second scenario, all layout variables are optimized, and no one is set as a constant.There is no restriction on the direction of RPVs or the distance between them.Thus, the degree of freedom of the placement of RPVs increases while the search space becomes bigger compared with the first scenario.Scenario 2 leads to different results than scenario 1 on some roof faces.Fig. 13 illustrates the differences between the outputs of scenarios 1 and 2. In all scenes of the figure, the number of RPVs and, thus, the total solar irradiation (i.e., the objective function) in scenario 2 is greater.In scenario 2, the optimal values of variables d and k on almost all tilted roof faces in the test sites are found to be their minimum possible values: (1 − j)RPV L + jRPV W for variable d and zero for variable k (see Eq. ( 3)).However, in general, there might be some cases where the optimal values of k and d are larger than their minimum values.Fig. 14 shows a sample planar segment where k > 0 is optimal.In this example, the shape of the planar segment, when considering roof objects that appeared as rectangular holes, makes k = 0 non-optimal.
Note that in the genetic algorithm for both scenarios, the number of solutions generated in each iteration is set to 50.The optimization is terminated when the so-far-the-best solution is not improved within 5 iterations.The convergence speed of the genetic algorithm depends on the complexity of the objective function.Finding the optimal point in a complex objective function might be more difficult and require more trials than finding the optimal point in a simple objective function.The complexity of the objective function itself depends on the shape of the roof face, the number and shape of roof objects included in the roof face, and the shadow pattern across the roof face.Thus, the convergence speed of the genetic algorithm may vary for different roof faces.Moreover, the stochasticity of the genetic algorithm can cause variations in the convergence speed for the same roof face in different runs.To ensure that the optimization parameters are suitable for converging to the optimal solutions, the optimization was repeated five times, and the deviations of the best fitness values became less than 1%.
Table 5 compares the extracted roof faces and the acquired RPVs from scenarios 1 and 2 in terms of total area and annual energy yield.In this table, RF means all extracted roof faces, and RPV SC1 and RPV SC2 denote all RPVs placed by scenarios 1 and 2. To estimate the energy yield, RPVs efficiency and performance ratio, as explained in Section 3.2.2, are respectively set to 0.16 and 0.75 that are in line with Romero Rodríguez, Duminil, Sánchez Ramos, and Eicker (2017).In the Gothenburg test site, scenario 2 results in more RPVs and more energy production in comparison to scenario 1.However, both scenarios in the Uppsala test site lead to similar results (similar layouts of RPVs).Indeed, the additional degree of freedom in scenario 2 of the Uppsala test site cannot help achieve more efficient layouts of RPVs.This is because all roof faces in the Uppsala test site are tilted and have rectangular shapes with minimal roof details.The more complex the geometry of a roof face and its overall occlusion pattern, the more likely the layouts vary between scenarios 1 and 2. RPVs cover around 17% and 13% of roof faces in the Gothenburg and Uppsala test sites, respectively, which is still a significant proportion on urban scales.Comparing the energy yield of RF and RPV SC shows that using the entire rooftop areas for energy yield calculation leads to a 5-6 fold overestimation of the solar energy potential of buildings.This illustrates the importance of the proposed methodology in estimating the solar energy potential of buildings.
We compare our results to those obtained using the method proposed in Aslani and Seipel (2022b).The method identifies RPV-utilizable segments by spatially analyzing each roof face.It ensures that segments suitable for installing RPVs have an appropriate size, satisfy installation regulations, and are sufficiently exposed to the sun.It uses morphological erosion and opening operations to exclude setback areas and geometrically unsuitable parts of roof faces.Roof faces with low solar irradiation are eliminated by defining a solar irradiation threshold.
Table 6 quantitatively compares the resulting layouts of scenario 2 with the RPV-utilizable segments.Scenario 2 was chosen for the comparison as it produces more RPVs than scenario 1. RF UT denotes utilizable segments, and RPV SC2 represents the RPVs derived in scenario 2. As the table shows, the utilizable segments are overestimating RPVs potential by 52% in Gothenburg and 18% in Uppsala.This is because the method in Aslani and Seipel (2022b) considers suitable areas based on the cross average of solar irradiation of the entire roof face rather than on the panel level, which leads to less spatial sensitivity to variations of irradiation caused by shadows.Instead, in this work, areas that cannot accommodate RPVs and those parts of the roof faces with low solar irradiation are not taken into account.The analysis based on panel placement provides the flexibility to scrutinize roof faces for their suitability in much more spatial detail.Visual comparisons reveal that the more complex the geometry of a rooftop is, the greater the difference between RPV SC2 and RF UT is.

Conclusion and future work
RPVs provide great potential to satisfy the increasing energy demand in urban areas.On roofs where suitable areas are limited, proper placement of RPVs is indispensable for achieving efficient energy production.In this study, a new spatial methodology based on DSMs that takes the most advantage of limited rooftop areas in placing RPVs was proposed.Planar segments of rooftops are first identified by a new plane segmentation method.The method is based on model fitting, segment growing, and planarity analysis to achieve reliable results.In the next step, an efficient layout of RPVs is determined for each identified planar segment.The proposed method for RPVs placement looks for a layout with maximum energy production.It also ensures that the placed RPVs satisfy geometric, solar, and regulatory constraints.That is, it averts placing RPVs near edges or in areas that are either small or have a small amount of solar irradiation.
The proposed methodology was evaluated on two test sites in Gothenburg and Uppsala.The results showed that the proposed plane segmentation method has satisfying performance with 89.7% recall and  88.7% precision in the Gothenburg test site and 100% recall and 99.5% precision in the Uppsala test site.Furthermore, our method demonstrated higher viability than RANSAC in both test sites.The proposed method can generally work with DSMs at different spatial resolutions.However, spatial resolution affects the method's ability to delineate roof faces and their objects (e.g., chimneys).Small roof faces cannot be extracted from DSMs with a coarse spatial resolution, and a roof face should be covered by a sufficient number of pixels-at least three pixels as the minimum required points to define a plane-so that its planar segment can be extracted.The accuracy of the DSM is another factor that affects the performance of the method.DSMs with higher accuracy may lead to more accurate segmentation results, which is why the method showed better performance in the Uppsala test site, as its DSM has better accuracy.The solar irradiation estimation is also affected by spatial resolution, especially when shadow effects are essential to be taken into account.Higher spatial resolution offers potential for a more detailed estimation of solar irradiation but requires a longer processing time.That is the reason why the comparative results showed that PVGIS and NREL overestimate solar irradiation.Their modeling is simplified, and they do not account for occlusion in a detailed manner.
According to the results of layout optimization, roof shapes, roof objects, and occlusions are adequately considered in placing RPVs, which allows for a realistic estimate of the solar energy potential of rooftops.Detailed analysis based on panel placement avoids overestimating solar energy potential.It should be noted once again that spatial resolution is important for RPVs placement and can affect the identification of occlusions.A statistical summary of the RPVs layouts indicated that less than one-fifth of the rooftop areas are used for RPVs in both test sites.The proposed methodology can provide an accurate understanding of rooftop solar potential, which can be useful for adopting solar energy as a key component for moving toward sustainable cities.It can help evaluate the extent to which solar energy can offset fossil fuel use.The proposed methodology is also valuable for solar energy practitioners (e.g., installers) and municipalities as it enables the generation of efficient RPVs configurations in an automated manner.In addition, the methodology can be beneficial for informed planning of RPVs contributions to local urban networks and facilitating decisions about investments in RPVs as it provides the possibility of a proper assessment of RPVs potential in large-scale areas.Indeed, it can provide policymakers with a future distribution of RPVs and a realistic estimate of their energy generation, which are necessary for developing local schemes and making informed decisions for the transition to renewable energies.It can help efficiently manage growing energy consumption in urban areas, which is one of the goals of sustainable cities.Moreover, the proposed plane segmentation method can help construct 3D building models that have many applications in the development of sustainable cities, including energy demand estimation and noise propagation estimation.
Although the proposed methodology has shown remarkable performance, there is still room for further development.In this study, the methodology is compatible with only DSMs as input, and any LiDAR point clouds would need to be converted to DSMs before being used.This conversion simplifies neighborhood definition and results in easyto-use data, but it may induce smoothing effects at sharp edges.Therefore, one further development is to enhance the methodology so that it becomes compatible with LiDAR point clouds as well.Another potentially important area for development is considering the energy demand of buildings when placing RPVs.The proposed layout optimization does not match the energy production of RPVs with the building energy consumption, which may result in an undesired power flow between the building and the grid.Any discrepancy between the daily electricity consumption profile and the energy generation profile of a building necessitates either importing energy from the grid or exporting a part of the produced energy back to the grid.Both situations might be unfavorable for owners, particularly if the price of importing energy exceeds that of exporting energy-considering investment costs for RPVs.Thus, further work includes the development of a method that maximizes the self-consumption of buildings with the fewest possible RPVs.This results in a decrease in operational energy costs and contributes to the development of sustainable cities.Moreover, the proposed methodology does not consider rooftop materials.For instance, glass roofs or large skylight windows might be recognized as utilizable areas for RPVs, which is not common in practice.The methodology should be developed such that it considers rooftop materials in the placement procedure.In this context, a combination of DSMs with multispectral aerial images might be necessary, as DSMs alone do not provide any spectral information required for identifying rooftop materials.

Declaration of Competing Interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Table 5
Summary statistics of the extracted roof faces and resulting RPVs in the test sites.

Table 6
Comparing the results of RPVs placement with the results of the method proposed in Aslani and Seipel (2022b).

Fig. 4 .
Fig. 4. Illustration of RPVs placement.A layout of RPVs is first produced inside the bounding box of the planar segment (a).RPVs outside of the segment boundary are eliminated (b).RPVs with low solar irradiation are removed (c).

Fig. 5 .
Fig. 5. Placement of RPVs.Blue rectangles represent RPVs.(For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article.)

Fig. 7 .
Fig. 7. DSMs of the Gothenburg (a) and Uppsala (b) test sites.Manually established ground truth planar segments of the Gothenburg (c) and Uppsala (d) test sites.

Fig. 9 .
Fig. 9.Some plane segmentation errors.Spurious planes identified over a tree that partly covers a building in the Gothenburg test site (a) and a partially detected roof face of an occluded building in the Uppsala test site (b).True orthophotos are utilized only for the purpose of visualization (not processing).

Fig. 10 .
Fig. 10.Estimated annual global solar irradiation in some scenes from the Gothenburg and Uppsala test sites, shown in the first and second rows, respectively.

Fig. 11 .
Fig. 11.Comparing the monthly average solar irradiation of PVGIS, NREL, and our modeled outputs in the Gothenburg test site (a) and Uppsala test site (b).

Fig. 12 .
Fig. 12. Layout optimization results for some buildings in the test sites.The first row corresponds to the Gothenburg test site, and the second row corresponds to the Uppsala test site.Aerial photos are used only for the sake of visualization.

Fig. 14 .
Fig. 14.Sample planar segment where the optimal value of k is larger than zero.

Fig. 13 .
Fig. 13.Top view of some scenes where scenarios 1 (left column) and 2 (right column) produced different outcomes.Objective function values in scenario 2 are greater than those in scenario 1 because of the increased number of RPVs in scenario 2. True orthophotos are used only for visualization purposes (not processing).

Table 2
Evaluation results of RANSAC in the test sites.

Table 4
Summary of the parameters and variables for placing RPVs.