コード例 #1
0
 def test_support_for_other_time_column_names(self):
     df = pd.DataFrame([
         {'geometry': TestPoint(0, 0), 'xxx': datetime(2018, 1, 1, 12, 0, 0)},
         {'geometry': TestPoint(6, 0), 'xxx': datetime(2018, 1, 1, 12, 6, 0)},
         {'geometry': TestPoint(6, 6), 'xxx': datetime(2018, 1, 1, 12, 10, 0)}
     ]).set_index('xxx')
     geo_df = GeoDataFrame(df, crs=CRS_METRIC)
     traj = Trajectory(geo_df, 1)
     traj.add_speed()
     traj.add_direction()
     traj.hvplot()
     traj.plot()
     traj.get_length()
     traj.to_linestring()
     traj.to_linestringm_wkt()
コード例 #2
0
 def test_plot(self):
     from matplotlib.axes import Axes
     df = pd.DataFrame([
         {'geometry': Point(0, 0), 't': datetime(2018, 1, 1, 12, 0, 0)},
         {'geometry': Point(6, 0), 't': datetime(2018, 1, 1, 12, 6, 0)},
         {'geometry': Point(10, 0), 't': datetime(2018, 1, 1, 12, 10, 0)}
         ]).set_index('t')
     geo_df = GeoDataFrame(df, crs=from_epsg(31256))
     traj = Trajectory(1, geo_df)
     result = traj.plot()
     self.assertIsInstance(result, Axes)