コード例 #1
0
ファイル: test_shape.py プロジェクト: cuulee/momepy
 def test_Linearity(self):
     self.df_streets["lin"] = mm.Linearity(self.df_streets).series
     euclidean = Point(self.df_streets.geometry[0].coords[0]).distance(
         Point(self.df_streets.geometry[0].coords[-1])
     )
     check = euclidean / self.df_streets.geometry[0].length
     assert self.df_streets["lin"][0] == check
コード例 #2
0
    def test_Linearity(self):
        self.df_streets["lin"] = mm.Linearity(self.df_streets).series
        euclidean = Point(self.df_streets.geometry[0].coords[0]).distance(
            Point(self.df_streets.geometry[0].coords[-1])
        )
        check = euclidean / self.df_streets.geometry[0].length
        assert self.df_streets["lin"][0] == approx(check, rel=1e-6)

        self.df_streets.loc[len(self.df_streets)] = MultiLineString(
            [[(0, 0), (-1, 1)], [(10, 10), (11, 11)]]
        )
コード例 #3
0
 def time_Linearity(self):
     mm.Linearity(self.df_streets)