In the city generator, the building density of each block is affected by the distance between the block and roads. The method to measure the density of each block is to calculate the minimum distance between the center of each block and all the main, secondary roads on the map. Then, the distance value will be put into three different intervals to evaluate the scores, and all the scores of the block will be summed up. Finally, the summed scores for main roads and secondary roads are weighted into the final density value.
The range of each interval can be determined by the user. The distance value will be assigned a score according to the intervals set by the user. For example, if the user sets three continuous intervals, [1, 10](starting interval), [10, 20] and [20, 30], they represent 3, 2, and 1 points respectively. When the distance between the block and the main road is 11,then the block will get 2 points. It can be seen that when the block is closer to the main road, the score will be higher, which can reflect higher density.
Since there will be multiple main roads on the map, each block will get multiple points and sum up a total score. Based on the maximum score and minimum score on the entire map, the total score obtained by each block will be remapped to three intervals of FAR, respectively [0.5, 2.0], [2.0, 5.0], and [5.0,20.0]. In this way, the block score can be used in the next section, city form, to present different functional forms of building volume.