odysseus.city_data_manager.city_geo_trips package

Submodules

odysseus.city_data_manager.city_geo_trips.austin_geo_trips module

class AustinGeoTrips(city_name='Austin', trips_data_source_id='city_open_data', year=2019, month=8)

Bases: odysseus.city_data_manager.city_geo_trips.city_geo_trips.CityGeoTrips

get_trips_od_gdfs()

This method is used to store the movements, using the Shapely library. The normalized data is loaded (—-> reference to save_norm magari<—–) and the method builds three GeoDataFrame. The trips are encoded using an object of the LineString class from the Shapely library. They are described as a segment having the coordinates of departure and arrival as extremes. In addition, two more GeoDataFrames are created, using objects of the Shapely.Point class to describe departures and arrivals.

Returns

nothing

odysseus.city_data_manager.city_geo_trips.big_data_db_geo_trips module

class BigDataDBGeoTrips(city_name, trips_data_source_id, year, month)

Bases: odysseus.city_data_manager.city_geo_trips.city_geo_trips.CityGeoTrips

odysseus.city_data_manager.city_geo_trips.calgary_geo_trips module

class CalgaryGeoTrips(city_name='Calgary', trips_data_source_id='city_open_data', year=2019, month=7)

Bases: odysseus.city_data_manager.city_geo_trips.city_geo_trips.CityGeoTrips

get_trips_od_gdfs()

This method is used to store the movements, using the Shapely library. The normalized data is loaded (—-> reference to save_norm magari<—–) and the method builds three GeoDataFrame. The trips are encoded using an object of the LineString class from the Shapely library. They are described as a segment having the coordinates of departure and arrival as extremes. In addition, two more GeoDataFrames are created, using objects of the Shapely.Point class to describe departures and arrivals.

Returns

nothing

odysseus.city_data_manager.city_geo_trips.chicago_geo_trips module

class ChicagoGeoTrips(city_name='Chicago', trips_data_source_id='city_open_data', year=2019, month=7)

Bases: odysseus.city_data_manager.city_geo_trips.city_geo_trips.CityGeoTrips

get_trips_od_gdfs()

This method is used to store the movements, using the Shapely library. The normalized data is loaded (—-> reference to save_norm magari<—–) and the method builds three GeoDataFrame. The trips are encoded using an object of the LineString class from the Shapely library. They are described as a segment having the coordinates of departure and arrival as extremes. In addition, two more GeoDataFrames are created, using objects of the Shapely.Point class to describe departures and arrivals.

Returns

nothing

odysseus.city_data_manager.city_geo_trips.city_geo_trips module

class CityGeoTrips(city_name, trips_data_source_id, year, month)

Bases: object

This abstract class deals with managing geographic travel information (e.g. departure, arrival, distance, etc.). This class is implemented by the other classes of this module. The constructor method takes as parameters:

Parameters
  • city_name (str) – City name. The name also serves to determine the timezone to which the city belongs

  • trips_data_source_id (str) – Data source from which the information is taken. This allows us to have multiple data sources associated with the same city (for example from different operators)

  • year (int) – year expressed as a four-digit number (e.g. 1999)

  • month (int) – month expressed as a number (e.g. for November the method expects to receive 11)

get_trips_od_gdfs()

This method is used to store the movements, using the Shapely library. The normalized data is loaded (—-> reference to save_norm magari<—–) and the method builds three GeoDataFrame. The trips are encoded using an object of the LineString class from the Shapely library. They are described as a segment having the coordinates of departure and arrival as extremes. In addition, two more GeoDataFrames are created, using objects of the Shapely.Point class to describe departures and arrivals.

Returns

nothing

load()

Load from memory, using the pickle file created by the save methods, the three GeoDataFrame

Returns

nothing

save_points(points, filename)

Support method to save_data_points. It stores the points passed to it as a parameter both on csv file and on pickle.

Parameters
  • points (geopandas.GeoDataFrame) – A GeoDataFrame describing the information of points to be saved

  • filename (str) – Filename

Returns

nothing

save_points_data()

Stores the points representing start and finish on file

Returns

nothing

save_trips()

It stores on file the segments that represent the path between start and finish

Returns

nothing

odysseus.city_data_manager.city_geo_trips.kansas_city_geo_trips module

class KansasCityGeoTrips(city_name='Kansas City', trips_data_source_id='city_open_data', year=2019, month=7)

Bases: odysseus.city_data_manager.city_geo_trips.city_geo_trips.CityGeoTrips

odysseus.city_data_manager.city_geo_trips.louisville_geo_trips module

class LouisvilleGeoTrips(city_name='Louisville', trips_data_source_id='city_open_data', year=2019, month=7)

Bases: odysseus.city_data_manager.city_geo_trips.city_geo_trips.CityGeoTrips

odysseus.city_data_manager.city_geo_trips.minneapolis_geo_trips module

class MinneapolisGeoTrips(city_name='Minneapolis', trips_data_source_id='city_open_data', year=2019, month=7)

Bases: odysseus.city_data_manager.city_geo_trips.city_geo_trips.CityGeoTrips

get_trips_od_gdfs()

This method is used to store the movements, using the Shapely library. The normalized data is loaded (—-> reference to save_norm magari<—–) and the method builds three GeoDataFrame. The trips are encoded using an object of the LineString class from the Shapely library. They are described as a segment having the coordinates of departure and arrival as extremes. In addition, two more GeoDataFrames are created, using objects of the Shapely.Point class to describe departures and arrivals.

Returns

nothing

odysseus.city_data_manager.city_geo_trips.norfolk_geo_trips module

class NorfolkGeoTrips(city_name='Norfolk', trips_data_source_id='city_open_data', year=2019, month=8)

Bases: odysseus.city_data_manager.city_geo_trips.city_geo_trips.CityGeoTrips

get_trips_od_gdfs()

This method is used to store the movements, using the Shapely library. The normalized data is loaded (—-> reference to save_norm magari<—–) and the method builds three GeoDataFrame. The trips are encoded using an object of the LineString class from the Shapely library. They are described as a segment having the coordinates of departure and arrival as extremes. In addition, two more GeoDataFrames are created, using objects of the Shapely.Point class to describe departures and arrivals.

Returns

nothing

odysseus.city_data_manager.city_geo_trips.nyc_citi_bike_geo_trips module

class NewYorkCityBikeGeoTrips(city_name='New_York_City', trips_data_source_id='citi_bike', year=2017, month=1)

Bases: odysseus.city_data_manager.city_geo_trips.city_geo_trips.CityGeoTrips

get_trips_od_gdfs()

This method is used to store the movements, using the Shapely library. The normalized data is loaded (—-> reference to save_norm magari<—–) and the method builds three GeoDataFrame. The trips are encoded using an object of the LineString class from the Shapely library. They are described as a segment having the coordinates of departure and arrival as extremes. In addition, two more GeoDataFrames are created, using objects of the Shapely.Point class to describe departures and arrivals.

Returns

nothing

Module contents