Beispiel #1
0
 def test_CourtyardIndex(self):
     cas = self.df_buildings["cas"] = mm.CourtyardArea(self.df_buildings).series
     self.df_buildings["cix"] = mm.CourtyardIndex(self.df_buildings, "cas").series
     self.df_buildings["cix_array"] = mm.CourtyardIndex(
         self.df_buildings, cas, self.df_buildings.geometry.area
     ).series
     check = self.df_buildings.cas[80] / self.df_buildings.geometry.area[80]
     assert self.df_buildings["cix"][80] == check
     assert self.df_buildings["cix_array"][80] == check
Beispiel #2
0
    def test_CourtyardArea(self):
        self.df_buildings["area"] = self.df_buildings.geometry.area
        self.df_buildings["courtyard_area"] = mm.CourtyardArea(
            self.df_buildings, "area").series
        check = (Polygon(self.df_buildings.geometry[80].exterior).area -
                 self.df_buildings.geometry[80].area)
        assert self.df_buildings["courtyard_area"][80] == check

        area = self.df_buildings.geometry.area
        self.df_buildings["courtyard_area"] = mm.CourtyardArea(
            self.df_buildings, area).series
        assert self.df_buildings["courtyard_area"][80] == check

        self.df_buildings["courtyard_area"] = mm.CourtyardArea(
            self.df_buildings).series
        assert self.df_buildings["courtyard_area"][80] == check

        with pytest.raises(KeyError):
            self.df_buildings["courtyard_area"] = mm.CourtyardArea(
                self.df_buildings, "nonexistent")
Beispiel #3
0
    def setup(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.0, 30.0, 144)
        self.df_buildings["volume"] = mm.Volume(self.df_buildings,
                                                "height").series
        self.df_buildings["peri"] = self.df_buildings.geometry.length
        self.df_buildings["area"] = self.df_buildings.geometry.area
        self.df_buildings["cas"] = mm.CourtyardArea(self.df_buildings).series
        self.df_buildings["la"] = mm.LongestAxisLength(
            self.df_buildings).series