예제 #1
0
 def test_volume_aray(self):
     area = self.df_buildings.geometry.area
     height = np.linspace(10., 30., 144)
     self.df_buildings['volume'] = mm.volume(self.df_buildings, height,
                                             area)
     check = self.df_buildings.geometry[0].area * self.df_buildings.height[0]
     assert self.df_buildings['volume'][0] == check
예제 #2
0
파일: test_shape.py 프로젝트: ljwolf/momepy
 def test_volume_facade_ratio_array(self):
     peri = self.df_buildings.geometry.length
     volume = mm.volume(self.df_buildings, 'height')
     self.df_buildings['vfr'] = mm.volume_facade_ratio(
         self.df_buildings, 'height', volume, peri)
     check = self.df_buildings.volume[0] / (
         self.df_buildings.geometry[0].length * self.df_buildings.height[0])
     assert self.df_buildings['vfr'][0] == check
예제 #3
0
파일: test_shape.py 프로젝트: ljwolf/momepy
 def test_form_factor_array(self):
     self.df_buildings['ff'] = mm.form_factor(
         self.df_buildings,
         mm.volume(self.df_buildings, 'height'),
         areas=self.df_buildings.geometry.area)
     check = (self.df_buildings.geometry[0].area) / (
         self.df_buildings.volume[0]**(2 / 3))
     assert self.df_buildings['ff'][0] == check
예제 #4
0
파일: test_shape.py 프로젝트: ljwolf/momepy
    def setup_method(self):

        test_file_path = mm.datasets.get_path('bubenec')
        self.df_buildings = gpd.read_file(test_file_path, layer='buildings')
        self.df_streets = gpd.read_file(test_file_path, layer='streets')
        self.df_tessellation = gpd.read_file(test_file_path,
                                             layer='tessellation')
        self.df_buildings['height'] = np.linspace(10., 30., 144)
        self.df_buildings['volume'] = mm.volume(self.df_buildings, 'height')
예제 #5
0
 def test_volume_missing_col(self):
     with pytest.raises(KeyError):
         self.df_buildings['volume'] = mm.volume(self.df_buildings,
                                                 'height', 'area')
예제 #6
0
 def test_volume_no_area(self):
     self.df_buildings['volume'] = mm.volume(self.df_buildings, 'height')
     check = self.df_buildings.geometry[0].area * self.df_buildings.height[0]
     assert self.df_buildings['volume'][0] == check