How to use the momepy.AreaRatio function in momepy

To help you get started, we’ve selected a few momepy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github martinfleis / momepy / tests / test_intensity.py View on Github external
left_unique_id="uID",
            )
        with pytest.raises(ValueError):
            car = mm.AreaRatio(
                self.df_tessellation,
                self.df_buildings,
                "area",
                "area",
                right_unique_id="uID",
            )
        car_sel = mm.AreaRatio(
            self.df_tessellation.iloc[10:20], self.df_buildings, "area", "area", "uID"
        ).series
        assert (car_sel.index == self.df_tessellation.iloc[10:20].index).all()
        self.blocks["area"] = self.blocks.geometry.area
        car_block = mm.AreaRatio(self.blocks, self.df_buildings, "area", "area", "bID")
        assert car_block.series.mean() == 0.2761974319698012
github martinfleis / momepy / tests / test_intensity.py View on Github external
check = 0.3206556897709747
        assert car.mean() == check
        assert carlr.mean() == check
        far = mm.AreaRatio(
            self.df_tessellation,
            self.df_buildings,
            self.df_tessellation.area,
            self.df_buildings.fl_area,
            "uID",
        ).series
        check = 1.910949846262234
        assert far.mean() == check
        with pytest.raises(ValueError):
            car = mm.AreaRatio(self.df_tessellation, self.df_buildings, "area", "area")
        with pytest.raises(ValueError):
            car = mm.AreaRatio(
                self.df_tessellation,
                self.df_buildings,
                "area",
                "area",
                left_unique_id="uID",
            )
        with pytest.raises(ValueError):
            car = mm.AreaRatio(
                self.df_tessellation,
                self.df_buildings,
                "area",
                "area",
                right_unique_id="uID",
            )
        car_sel = mm.AreaRatio(
            self.df_tessellation.iloc[10:20], self.df_buildings, "area", "area", "uID"
github martinfleis / momepy / tests / test_intensity.py View on Github external
"uID",
        ).series
        check = 1.910949846262234
        assert far.mean() == check
        with pytest.raises(ValueError):
            car = mm.AreaRatio(self.df_tessellation, self.df_buildings, "area", "area")
        with pytest.raises(ValueError):
            car = mm.AreaRatio(
                self.df_tessellation,
                self.df_buildings,
                "area",
                "area",
                left_unique_id="uID",
            )
        with pytest.raises(ValueError):
            car = mm.AreaRatio(
                self.df_tessellation,
                self.df_buildings,
                "area",
                "area",
                right_unique_id="uID",
            )
        car_sel = mm.AreaRatio(
            self.df_tessellation.iloc[10:20], self.df_buildings, "area", "area", "uID"
        ).series
        assert (car_sel.index == self.df_tessellation.iloc[10:20].index).all()
        self.blocks["area"] = self.blocks.geometry.area
        car_block = mm.AreaRatio(self.blocks, self.df_buildings, "area", "area", "bID")
        assert car_block.series.mean() == 0.2761974319698012
github martinfleis / momepy / tests / test_intensity.py View on Github external
def test_AreaRatio(self):
        car = mm.AreaRatio(
            self.df_tessellation, self.df_buildings, "area", "area", "uID"
        ).series
        carlr = mm.AreaRatio(
            self.df_tessellation,
            self.df_buildings,
            "area",
            "area",
            left_unique_id="uID",
            right_unique_id="uID",
        ).series
        check = 0.3206556897709747
        assert car.mean() == check
        assert carlr.mean() == check
        far = mm.AreaRatio(
            self.df_tessellation,
            self.df_buildings,
github martinfleis / momepy / tests / test_intensity.py View on Github external
def test_AreaRatio(self):
        car = mm.AreaRatio(
            self.df_tessellation, self.df_buildings, "area", "area", "uID"
        ).series
        carlr = mm.AreaRatio(
            self.df_tessellation,
            self.df_buildings,
            "area",
            "area",
            left_unique_id="uID",
            right_unique_id="uID",
        ).series
        check = 0.3206556897709747
        assert car.mean() == check
        assert carlr.mean() == check
        far = mm.AreaRatio(
            self.df_tessellation,
            self.df_buildings,
            self.df_tessellation.area,
            self.df_buildings.fl_area,
            "uID",
        ).series
        check = 1.910949846262234
        assert far.mean() == check
        with pytest.raises(ValueError):
            car = mm.AreaRatio(self.df_tessellation, self.df_buildings, "area", "area")
        with pytest.raises(ValueError):
            car = mm.AreaRatio(
                self.df_tessellation,
                self.df_buildings,
                "area",
                "area",
github martinfleis / momepy / tests / test_intensity.py View on Github external
def test_AreaRatio(self):
        car = mm.AreaRatio(
            self.df_tessellation, self.df_buildings, "area", "area", "uID"
        ).series
        carlr = mm.AreaRatio(
            self.df_tessellation,
            self.df_buildings,
            "area",
            "area",
            left_unique_id="uID",
            right_unique_id="uID",
        ).series
        check = 0.3206556897709747
        assert car.mean() == check
        assert carlr.mean() == check
        far = mm.AreaRatio(
            self.df_tessellation,
            self.df_buildings,
            self.df_tessellation.area,
            self.df_buildings.fl_area,
            "uID",
github martinfleis / momepy / tests / test_intensity.py View on Github external
car = mm.AreaRatio(
                self.df_tessellation,
                self.df_buildings,
                "area",
                "area",
                left_unique_id="uID",
            )
        with pytest.raises(ValueError):
            car = mm.AreaRatio(
                self.df_tessellation,
                self.df_buildings,
                "area",
                "area",
                right_unique_id="uID",
            )
        car_sel = mm.AreaRatio(
            self.df_tessellation.iloc[10:20], self.df_buildings, "area", "area", "uID"
        ).series
        assert (car_sel.index == self.df_tessellation.iloc[10:20].index).all()
        self.blocks["area"] = self.blocks.geometry.area
        car_block = mm.AreaRatio(self.blocks, self.df_buildings, "area", "area", "bID")
        assert car_block.series.mean() == 0.2761974319698012
github martinfleis / momepy / tests / test_intensity.py View on Github external
right_unique_id="uID",
        ).series
        check = 0.3206556897709747
        assert car.mean() == check
        assert carlr.mean() == check
        far = mm.AreaRatio(
            self.df_tessellation,
            self.df_buildings,
            self.df_tessellation.area,
            self.df_buildings.fl_area,
            "uID",
        ).series
        check = 1.910949846262234
        assert far.mean() == check
        with pytest.raises(ValueError):
            car = mm.AreaRatio(self.df_tessellation, self.df_buildings, "area", "area")
        with pytest.raises(ValueError):
            car = mm.AreaRatio(
                self.df_tessellation,
                self.df_buildings,
                "area",
                "area",
                left_unique_id="uID",
            )
        with pytest.raises(ValueError):
            car = mm.AreaRatio(
                self.df_tessellation,
                self.df_buildings,
                "area",
                "area",
                right_unique_id="uID",
            )