Merge pull request 'Filtering out buildings with floor area less that 25 square meters' (#20) from hp_results into main
Reviewed-on: https://nextgenerations-cities.encs.concordia.ca/gitea/CERC/hub/pulls/20
This commit is contained in:
commit
73c8839814
|
@ -41,7 +41,7 @@ class City:
|
||||||
self._name = None
|
self._name = None
|
||||||
self._lower_corner = lower_corner
|
self._lower_corner = lower_corner
|
||||||
self._upper_corner = upper_corner
|
self._upper_corner = upper_corner
|
||||||
self._buildings = None
|
self._buildings = []
|
||||||
self._srs_name = srs_name
|
self._srs_name = srs_name
|
||||||
self._location = None
|
self._location = None
|
||||||
self._country_code = None
|
self._country_code = None
|
||||||
|
|
|
@ -230,7 +230,9 @@ class Geojson:
|
||||||
|
|
||||||
self._city = City([self._min_x, self._min_y, 0.0], [self._max_x, self._max_y, self._max_z], 'epsg:26911')
|
self._city = City([self._min_x, self._min_y, 0.0], [self._max_x, self._max_y, self._max_z], 'epsg:26911')
|
||||||
for building in buildings:
|
for building in buildings:
|
||||||
self._city.add_city_object(building)
|
# Do not include "small building-like structures" to buildings
|
||||||
|
if building.floor_area >= 25:
|
||||||
|
self._city.add_city_object(building)
|
||||||
self._city.level_of_detail.geometry = lod
|
self._city.level_of_detail.geometry = lod
|
||||||
if lod == 1:
|
if lod == 1:
|
||||||
lines_information = GeometryHelper.city_mapping(self._city, plot=False)
|
lines_information = GeometryHelper.city_mapping(self._city, plot=False)
|
||||||
|
|
|
@ -141,7 +141,8 @@ class TestGeometryFactory(TestCase):
|
||||||
year_of_construction_field='ANNEE_CONS',
|
year_of_construction_field='ANNEE_CONS',
|
||||||
function_field='CODE_UTILI',
|
function_field='CODE_UTILI',
|
||||||
function_to_hub=MontrealFunctionToHubFunction().dictionary).city
|
function_to_hub=MontrealFunctionToHubFunction().dictionary).city
|
||||||
self.assertEqual(2356, len(city.buildings), 'wrong number of buildings')
|
# include 25 square meter condition for a building reduces buildings number from 2289 to 2057
|
||||||
|
self.assertEqual(2057, len(city.buildings), 'wrong number of buildings')
|
||||||
|
|
||||||
def test_map_neighbours(self):
|
def test_map_neighbours(self):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user