Пример #1
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] == 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)