How to use the momepy.CourtyardArea 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_shape.py View on Github external
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
github martinfleis / momepy / tests / test_dimension.py View on Github external
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"
            )
github martinfleis / momepy / tests / test_dimension.py View on Github external
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"
            )
github martinfleis / momepy / tests / test_dimension.py View on Github external
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"
            )
github martinfleis / momepy / tests / test_dimension.py View on Github external
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