diff --git a/docs/html/ch01.html b/docs/html/ch01.html index 0bfbbe2..eee6db5 100644 --- a/docs/html/ch01.html +++ b/docs/html/ch01.html @@ -1,6 +1,6 @@ -Chapter 1. Managing Ship Trajectories (AIS)

Chapter 1. Managing Ship Trajectories (AIS)

Table of Contents

Contents
Data
Tools
Preparing the Database
Loading the Data
Constructing Trajectories
Basic Data Exploration
Analyzing the Trajectories

AIS stands for Automatic Identification System. It is the location tracking system for sea vessels. This module illustrates how to load big AIS data sets into MobilityDB and do basic exploration. +Chapter 1. Managing Ship Trajectories (AIS)

Chapter 1. Managing Ship Trajectories (AIS)

AIS stands for Automatic Identification System. It is the location tracking system for sea vessels. This module illustrates how to load big AIS data sets into MobilityDB and do basic exploration.

The idea of this module is inspired from the tutorial of MovingPandas on ship data analysis by Anita Graser. -

Contents

This module covers the following topics: +

Contents

This module covers the following topics:

  • Loading large trajectory datasets into MobilityDB

  • Create proper indexes to speed up trajectory construction

  • Select trajectories by a spatial window

  • Join trajectories tables by proximity

  • Select certain parts inside individual trajectories

  • Manage the temporal speed and azimuth features of ships

diff --git a/docs/html/ch01s02.html b/docs/html/ch01s02.html index 00b4cc5..de5fe89 100644 --- a/docs/html/ch01s02.html +++ b/docs/html/ch01s02.html @@ -1,3 +1,3 @@ -Data

Data

+Data

Data

The Danish Maritime Authority publishes about 3 TB of AIS routes in CSV format here. The columns in the CSV are listed in Table 1.1, “AIS columns”. This module uses the data of one day June 1st 2023. The CSV file size is 582 MB, and it contains more than 11 M rows.

Table 1.1. AIS columns

TimestampTimestamp from the AIS base station, format: 31/12/2015 23:59:59
Type of mobileDescribes what type of target this message is received from (class A AIS Vessel, Class B AIS vessel, etc)
MMSIMMSI number of vessel
LatitudeLatitude of message report (e.g. 57,8794)
LongitudeLongitude of message report (e.g. 17,9125)
Navigational statusNavigational status from AIS message if available, e.g.: 'Engaged in fishing', 'Under way using engine', mv.
ROTRot of turn from AIS message if available
SOGSpeed over ground from AIS message if available
COGCourse over ground from AIS message if available
HeadingHeading from AIS message if available
IMOIMO number of the vessel
CallsignCallsign of the vessel
NameName of the vessel
Ship typeDescribes the AIS ship type of this vessel
Cargo typeType of cargo from the AIS message
WidthWidth of the vessel
LengthLenght of the vessel
Type of position fixing deviceType of positional fixing device from the AIS message
DraughtDraugth field from AIS message
DestinationDestination from AIS message
ETAEstimated Time of Arrival, if available
Data source typeData source type, e.g. AIS
Size ALength from GPS to the bow
Size BLength from GPS to the stern
Size CLength from GPS to starboard side
Size DLength from GPS to port side

diff --git a/docs/html/ch01s03.html b/docs/html/ch01s03.html index d22f8af..1e8af30 100644 --- a/docs/html/ch01s03.html +++ b/docs/html/ch01s03.html @@ -1,4 +1,4 @@ -Tools

Tools

+Tools

Tools

The tools used in this module are as follows:

  • MobilityDB, on top of PostgreSQL and PostGIS. Although you can use a docker image, we recommend to install MobilityDB on your system, either from binaries or from sources.

  • QGIS

diff --git a/docs/html/ch01s04.html b/docs/html/ch01s04.html index 1d2c014..725ad96 100644 --- a/docs/html/ch01s04.html +++ b/docs/html/ch01s04.html @@ -1,4 +1,4 @@ -Preparing the Database

Preparing the Database

+Preparing the Database

Preparing the Database

Create a new database DanishAIS, then use your SQL editor to create the MobilityDB extension as follows:

 CREATE EXTENSION MobilityDB CASCADE;
diff --git a/docs/html/ch01s05.html b/docs/html/ch01s05.html
index c841064..0b82e1b 100644
--- a/docs/html/ch01s05.html
+++ b/docs/html/ch01s05.html
@@ -1,4 +1,4 @@
-Loading the Data

Loading the Data

+Loading the Data

Loading the Data

For importing CSV data into a PostgreSQL database one can use the COPY command as follows:

 COPY AISInput(T, TypeOfMobile, MMSI, Latitude, Longitude, NavigationalStatus,
diff --git a/docs/html/ch01s06.html b/docs/html/ch01s06.html
index 12d441f..bf61eb2 100644
--- a/docs/html/ch01s06.html
+++ b/docs/html/ch01s06.html
@@ -1,4 +1,4 @@
-Constructing Trajectories

Constructing Trajectories

+Constructing Trajectories

Constructing Trajectories

Now we are ready to construct ship trajectories out of their individual observations:

diff --git a/docs/html/ch01s07.html b/docs/html/ch01s07.html
index d09f794..9984748 100644
--- a/docs/html/ch01s07.html
+++ b/docs/html/ch01s07.html
@@ -1,4 +1,4 @@
-Basic Data Exploration

Basic Data Exploration

+Basic Data Exploration

Basic Data Exploration

The total distance traveled by all ships:

diff --git a/docs/html/ch01s08.html b/docs/html/ch01s08.html
index 241ef15..59ed692 100644
--- a/docs/html/ch01s08.html
+++ b/docs/html/ch01s08.html
@@ -1,4 +1,4 @@
-Analyzing the Trajectories

Analyzing the Trajectories

+Analyzing the Trajectories

Analyzing the Trajectories

Now we dive into MobilityDB and explore more of its functions. In Figure 1.6, “A sample ship trajectory between Rødby and Puttgarden”, we notice trajectories that keep going between Rødby and Puttgarden. Most probably, these are the ferries between the two ports. The task is simply to spot which ships do so, and to count how many one way trips they did in this day. This is expressed in the following query:

diff --git a/docs/html/ch02s05.html b/docs/html/ch02s05.html
index 78328f1..d15b478 100644
--- a/docs/html/ch02s05.html
+++ b/docs/html/ch02s05.html
@@ -31,4 +31,4 @@
           Version: 12+
         

Then press save and test. -

Figure 2.1. Data Source settings

Data Source settings

+

Figure 2.1. Data Source settings

Data Source settings

diff --git a/docs/html/ch02s06.html b/docs/html/ch02s06.html index 4803793..2a8f360 100644 --- a/docs/html/ch02s06.html +++ b/docs/html/ch02s06.html @@ -26,12 +26,12 @@ Query button, select Transform, add Convert field type and choose mmsi as String. -

Figure 2.2. Datatype transformations in Grafana

Datatype transformations in Grafana

  • +

    Figure 2.2. Datatype transformations in Grafana

    Datatype transformations in Grafana

  • We will modify some visualization options in the panel on the right.

    First, choose stat as the visualization -

    Figure 2.3. Choosing visualization type

    Choosing visualization type

    +

    Figure 2.3. Choosing visualization type

    Choosing visualization type

    Panel Options: Give the panel the title Incorrect AIS Boat Speed Reporting @@ -41,14 +41,14 @@ Show: All values

  • Fields: speeddifference -

    Figure 2.4. Value options dialogue box

    Value options dialogue box

  • +

    Figure 2.4. Value options dialogue box

    Value options dialogue box

    Note: we can include a limit here instead of in our SQL query as well.

    Stat Styles:

    • Orientation: Horizontal -

      Figure 2.5. Stat styles dialogue box

      Stat styles dialogue box

    +

    Figure 2.5. Stat styles dialogue box

    Stat styles dialogue box

    Standard Options:

    • Unit: Velocity → meter/second (m/s). Note: you @@ -56,16 +56,16 @@ options.

    • Color scheme: Green-Yellow-Red (by value) -

    Figure 2.6. Standard options dialogue box

    Standard options dialogue box

    +

    Figure 2.6. Standard options dialogue box

    Standard options dialogue box

    Thresholds:

    • remove the existing threshold by clicking the little trash can icon on the right. Adding a threshold will force the visualization to color the data a specific color if the threshold is met. -

    Figure 2.7. Thresholds dialogue box

    Thresholds dialogue box

    +

    Figure 2.7. Thresholds dialogue box

    Thresholds dialogue box

    The final visualization will look like the screenshot below. -

    Figure 2.8. Individual ship speed statistics visualization

    Individual ship speed statistics visualization

    Routes Used Most Frequently Visualized with a Static Heat +

    Figure 2.8. Individual ship speed statistics visualization

    Individual ship speed statistics visualization

    Routes Used Most Frequently Visualized with a Static Heat Map

    We can visualize the routes used by ships with a heat map generated from individual GPS points of the ships. This approach @@ -109,7 +109,7 @@

  • Share View: enable (this will sync up the movement and zoom across multiple maps on the same dashboard) -

  • Figure 2.9. Setting initial view in map view dialogue box

    Setting initial view in map view dialogue box

    +

    Figure 2.9. Setting initial view in map view dialogue box

    Setting initial view in map view dialogue box

    Data Layer:

    • Layer type: Heatmap @@ -125,19 +125,19 @@ Radius: 1

    • Blur: 5 -

    Figure 2.10. Setting up heat-map in data layer dialogue +

    Figure 2.10. Setting up heat-map in data layer dialogue box

    Setting up heat-map in data layer dialogue box

    Standard Options:

    • Color scheme: Blue-Yellow-Red (by value). -

    Figure 2.11. Choosing color scheme in standard options dialogue +

    Figure 2.11. Choosing color scheme in standard options dialogue box

    Choosing color scheme in standard options dialogue box

    The final visualization will look like the screenshot below.

    Note: The number of datapoints rendered can be manipulated by changing the parameter of the TABLESAMPLE SYSTEM() call in the query. -

    Figure 2.12. Route usage frequency heat-map visualization

    Route usage frequency heat-map visualization

    Number of Boats Moving Through a Given Area

    1. +

      Figure 2.12. Route usage frequency heat-map visualization

      Route usage frequency heat-map visualization

    Number of Boats Moving Through a Given Area

    1. Create a new panel, and set DanishAIS as the Source, Format as: Table.

    2. @@ -202,7 +202,7 @@ number of ships coming and going to it and that’s why it is colored red. This visualization can show relative activity of ships in regions and ports. -

      Figure 2.13. Frequency intersecting with geometric envelop +

      Figure 2.13. Frequency intersecting with geometric envelop visualization

      Frequency intersecting with geometric envelop visualization

      Boats in Proximity in a Given Time Range

      Follow the similar steps to add a Geomap panel as before, we include the following SQL script: @@ -283,9 +283,9 @@ Value: 1

    3. Color: select different color for each boat. -

    Figure 2.14. Multiple layers in data layers dialogue box

    Multiple layers in data layers dialogue box

    +

    Figure 2.14. Multiple layers in data layers dialogue box

    Multiple layers in data layers dialogue box

    The final visualization looks like the below. -

    Figure 2.15. Visualization of ships within 300m using heat-map

    Visualization of ships within 300m using heat-map

    +

    Figure 2.15. Visualization of ships within 300m using heat-map

    Visualization of ships within 300m using heat-map

    It’s helpful to include the tooltip for layers to allow users to see the data behind the visualization, which helps in interpretation and is a good way for subject-matter-experts to @@ -300,5 +300,5 @@ within ports. We could avoid including results in ports by excluding all results that occur within envelopes defined by ST_MakeEnvelope, as seen in the previous queries. -

    Figure 2.16. Multiple results for the same ship at various times while +

    Figure 2.16. Multiple results for the same ship at various times while in a port

    Multiple results for the same ship at various times while in a port

    diff --git a/docs/html/ch02s07.html b/docs/html/ch02s07.html index fd659cc..20051f2 100644 --- a/docs/html/ch02s07.html +++ b/docs/html/ch02s07.html @@ -9,10 +9,10 @@ In the dashboard window, click Dashboard settings icon; the gear symbol, on the top-slightly-right of the window. -

    Figure 2.17. Dashboard settings gear box

    Dashboard settings gear box

  • +

    Figure 2.17. Dashboard settings gear box

    Dashboard settings gear box

  • Click on the Variables in the next window on the top-left side of the screen. -

    Figure 2.18. Selecting Variables in dashboard settings

    Selecting Variables in dashboard settings

  • +

    Figure 2.18. Selecting Variables in dashboard settings

    Selecting Variables in dashboard settings

  • You’ll see a screen that explains the variables in Grafana and also points to the Templates @@ -34,7 +34,7 @@ drop-down options will look like for the variable you created. In this case, we are creating the timestamps in the same format that MobilityDB will accept. -

    Figure 2.19. Creating user-defined list of custom variables

    Creating user-defined list of custom variables

  • +

    Figure 2.19. Creating user-defined list of custom variables

    Creating user-defined list of custom variables

  • We can create another variable called ToTime with values shifted 1 hour. So the starting value would be 2018-01-04 01:00:00 and the final value will be @@ -96,7 +96,7 @@ port Rodby has less activity during this period and that’s why it is green now. But overall Rodby has more activity so when we look at the entire days data it is colored red. -

    Figure 2.20. Visualization of geometry intersection using dynamic +

    Figure 2.20. Visualization of geometry intersection using dynamic variables

    Visualization of geometry intersection using dynamic variables

    Global Variables

    Grafana also has some built-in @@ -106,7 +106,7 @@ of the $FromTime and $ToTime we created. The time range can then be modified with the time range options in the top right of the dashboard. -

    Figure 2.21. Assigning time range using global variables

    Assigning time range using global variables

    +

    Figure 2.21. Assigning time range using global variables

    Assigning time range using global variables

    Note: It is important to be aware of the timezone used for the underlying data relative to the queries for global variables. Time zones can be adjusted at the bottom of the time diff --git a/docs/html/ch02s08.html b/docs/html/ch02s08.html index 718ea26..c913542 100644 --- a/docs/html/ch02s08.html +++ b/docs/html/ch02s08.html @@ -2,4 +2,4 @@ The final dashboard will look like this. Note there are a couple additional query views that were not covered explicitly in the workshop. -

    Figure 2.22. Full Dashboard

    Full Dashboard

    +

    Figure 2.22. Full Dashboard

    Full Dashboard

  • diff --git a/docs/html/ch03.html b/docs/html/ch03.html index c46b7e3..713ea20 100644 --- a/docs/html/ch03.html +++ b/docs/html/ch03.html @@ -1,6 +1,6 @@ -Chapter 3. Managing Flight Data and Creating Dashboard with Grafana

    Chapter 3. Managing Flight Data and Creating Dashboard with Grafana

    Contents

    The module covers the following topics in 3 parts:

    Part 1 - Data and Environment Preparation diff --git a/docs/html/ch03s02.html b/docs/html/ch03s02.html index 407074f..3ecee6c 100644 --- a/docs/html/ch03s02.html +++ b/docs/html/ch03s02.html @@ -1,4 +1,4 @@ -Tools

    Tools

    +Tools

    Tools

    The tools used in this module are as follows:

    • MobilityDB, on top of PostgreSQL and PostGIS diff --git a/docs/html/ch03s03.html b/docs/html/ch03s03.html index aed46a1..b1ff150 100644 --- a/docs/html/ch03s03.html +++ b/docs/html/ch03s03.html @@ -1,4 +1,4 @@ -Part 1 - Data and Environment Preparation

      Part 1 - Data and Environment Preparation

      Preparing the Database

      +Part 1 - Data and Environment Preparation

      Part 1 - Data and Environment Preparation

      Preparing the Database

      The opensky data can be found in this Dataset link . @@ -60,7 +60,7 @@ You can check the size of the database with:

       SELECT pg_size_pretty( pg_total_relation_size('flights') );
      -        

      Data Cleaning

      +

      Data Cleaning

      Delete all icao24 that have all NULL latitudes

       -- icao24_with_null_lat is used to provide a list of rows that will be deleted
      @@ -82,7 +82,7 @@
                       that will directly impact the quality of mobilityDB trajectories
                       being created. If there as NULLs in mobilityDB trajectories,
                       some operation on it can give error.
      -            

      Setting up the Dashboard and Connecting to Data +

      Setting up the Dashboard and Connecting to Data Source

      Data for the workshop is loaded into a MobilityDB database hosted diff --git a/docs/html/ch03s04.html b/docs/html/ch03s04.html index bc3ba37..3a04644 100644 --- a/docs/html/ch03s04.html +++ b/docs/html/ch03s04.html @@ -1,4 +1,4 @@ -Part 2 - Working with Discrete Points

      Part 2 - Working with Discrete Points

      Visualizing 24hr Flight Pattern of Single Airplane

      +Part 2 - Working with Discrete Points

      Part 2 - Working with Discrete Points

      Visualizing 24hr Flight Pattern of Single Airplane

      We will start by looking at a single airplane. Grafana proves to be a good way to quickly visualize our dataset and can be useful to support pre-processing and cleaning. If using a connection to @@ -9,26 +9,26 @@ original dataset readme. The table structure in the Azure dataset after loading and transformations looks like the following: -

      Figure 3.1. First row of table single_airframe, with +

      Figure 3.1. First row of table single_airframe, with 24hrs of flight information for airplane c827a6 -

      First row of table “single_airframe”, with 24hrs of flight information for airplane “c827a6”

      Figure 3.2. Full table single_airframe_traj for airplane +

      First row of table “single_airframe”, with 24hrs of flight information for airplane “c827a6”

      Figure 3.2. Full table single_airframe_traj for airplane c827a6 with data in mobilityDB trajectories format -

      Full table “single_airframe_traj” for airplane “c827a6” with data in mobilityDB trajectories format

      Figure 3.3. First row of table flight_traj_sample, which +

      Full table “single_airframe_traj” for airplane “c827a6” with data in mobilityDB trajectories format

      Figure 3.3. First row of table flight_traj_sample, which includes 200 flight trajectories. -

      First row of table “flight_traj_sample”, which includes 200 flight trajectories.

      Change Timezone in Grafana

      +

      First row of table “flight_traj_sample”, which includes 200 flight trajectories.

      Change Timezone in Grafana

      Make Sure you are visualizing the data in the correct timezone. The data we had was in UTC. To change the timezone,

      1. Click on the time-range panel on the top-right of the window. -

        Figure 3.4. Grafana time range panel

        Grafana time range panel

      2. +

        Figure 3.4. Grafana time range panel

        Grafana time range panel

      3. In the pop-up window, on the bottom there is Change time settings. Click that to set the desired timezone. -

      Visualize the Coordinates of a Single Airplane

      +

    Visualize the Coordinates of a Single Airplane

    Let’s visualize the latitude and longitude coordinates of an airplane’s journey throughout the day. For this one we will not color the geo-markers, but it is possible to color them using @@ -85,7 +85,7 @@ sampling the results using TABLESAMPLE SYSTEM (5) in our query. This is done to speed up the visualization. -

    Figure 3.5. Single airframe geopoints vs time

    Single airframe geopoints vs time

    Time-series Graphs for a Single Airplane

    Velocity vs Time

    +

    Figure 3.5. Single airframe geopoints vs time

    Single airframe geopoints vs time

    Time-series Graphs for a Single Airplane

    Velocity vs Time

    Following the similar steps to add a Geomap panel as before, we include the following SQL script. Note $__timeFilter() is a Grafana global variable. This global variable will inject time @@ -114,7 +114,7 @@ humps. The zero speed towards the end of each hump is a clear indicator that plane stopped, thus it must have completed its flight. -

    Figure 3.6. Single airframe velocity vs time

    Single airframe velocity vs time

    Altitude vs Time

    +

    Figure 3.6. Single airframe velocity vs time

    Single airframe velocity vs time

    Altitude vs Time

    Follow the similar steps to add a Geomap panel as before, we include the following SQL script.

    1. @@ -141,7 +141,7 @@ flight. There is some noise in the data, which appear as spikes. This would be almost impossible to spot in a tabular format, but on a line graph these data anomalies can be easily identified. -

      Figure 3.7. Single airframe altitude vs time

      Single airframe altitude vs time

    Vertical-Rate vs Time

    +

    Figure 3.7. Single airframe altitude vs time

    Single airframe altitude vs time

    Vertical-Rate vs Time

    Follow the similar steps to add a Geomap panel as before, we include the following SQL script.

    1. @@ -168,7 +168,7 @@ vertical-rate and during decent this value becomes negative. So a sequence of positive values, then zero values followed by negative values would represent a single flight. -

      Figure 3.8. Single airframe vertrate vs time

      Single airframe vertrate vs time

    Callsign vs Time

    +

    Figure 3.8. Single airframe vertrate vs time

    Single airframe vertrate vs time

    Callsign vs Time

    The callsign is a unique identifier used for a specific flight path. For example, ANZ1220 is the callsign of the Air New Zealand flight 1220 from Queenstown to Auckland in New Zealand. @@ -203,4 +203,4 @@ We also see there is some NULL data in the callsign column which is why the first timestamp doesn’t have a corresponding callsign. -

    Figure 3.9. Single airframe callsign vs time

    Single airframe callsign vs time

    +

    Figure 3.9. Single airframe callsign vs time

    Single airframe callsign vs time

    diff --git a/docs/html/ch03s05.html b/docs/html/ch03s05.html index 7e76bdf..2cfdb67 100644 --- a/docs/html/ch03s05.html +++ b/docs/html/ch03s05.html @@ -1,8 +1,8 @@ -Part 3 - Working with Continuous Trajectories in MobilityDB

    Part 3 - Working with Continuous Trajectories in MobilityDB

    +Part 3 - Working with Continuous Trajectories in MobilityDB

    Part 3 - Working with Continuous Trajectories in MobilityDB

    For the following queries, we will make use of trajectories for aggregation and creating effective splits in our data based on parameters that change in time. -

    Creating MobilityDB Trajectories

    +

    Creating MobilityDB Trajectories

    This step is completed once, only on the ingestion of data. It is shown below to provide an understanding of how to do it. With temporal datatypes and mobilityDB functionality, we can see the @@ -16,7 +16,7 @@ UPDATE flights SET geom = ST_SetSRID( ST_MakePoint( lon, lat ), 4326); -

    AirFrame Trajectories

    +

    AirFrame Trajectories

    Now we are ready to construct airframe or airplane trajectories out of their individual observations. Each icao24 in our dataset represents a single @@ -78,7 +78,7 @@ can be manipulated with mobilityDB functionality. The same approach is used for each trajectory, with the function used changing depending on the datatype. -

    Flight Trajectories

    +

    Flight Trajectories

    Right now we have, in a single row, an airframe’s (where an airframe is a single physical airplane) entire day’s trip information. We would like to segment that information per @@ -141,10 +141,10 @@ This approach is very generic and can be applied anytime we want to split a trajectory by the inflection points in time of some other trajectory. -

    Aggregating Flight Statistics

    +

    Aggregating Flight Statistics

    We can now use our trajectories to pull flight specific statistics very easily. -

    Average Velocity of Each Flight

    1. +

      Average Velocity of Each Flight

      1. In Format as, we have Table

        @@ -178,7 +178,7 @@
                                 The settings we adjust improve the visualization by cutting
                                 the bar graph values of 0-200, improving the resolution at
                                 higher ranges to see differences.
        -                    

        Figure 3.10. Average flight speed visualization

        Average flight speed visualization

      Number of Private and Commercial Flights

      +

      Figure 3.10. Average flight speed visualization

      Average flight speed visualization

    Number of Private and Commercial Flights

    We can easily combine results from multiple queries in the same visualization in Grafana, simplifying the queries themselves. Here we apply some domain knowledge of sport pilot aircraft @@ -207,7 +207,7 @@ In Grafana, when we are in the query editor we can click on + Query at the bottom to add multiple queries that provide different results. -

    Figure 3.11. Multiple queries providing results for a single +

    Figure 3.11. Multiple queries providing results for a single visualization

    Multiple queries providing results for a single visualization

  • Change the visualization type to Stat.

    @@ -215,11 +215,11 @@ Overrides at the top of the options panel on the right. Here you can override global panel settings for specific attributes as shown below. -

    Figure 3.12. Override options for panel with multiple +

    Figure 3.12. Override options for panel with multiple queries

    Override options for panel with multiple queries

  • The final statistics visualization will look like this: -

    Figure 3.13. Statistic visualization of number of flights by license - type

    Statistic visualization of number of flights by license type

    Flights Taking-off in Some Interval of Time (User-Defined)

    +

    Figure 3.13. Statistic visualization of number of flights by license + type

    Statistic visualization of number of flights by license type

    Flights Taking-off in Some Interval of Time (User-Defined)

    Note: This query makes used of a sample set of data that has 200 flights to return results. @@ -333,6 +333,6 @@ multiple flights at the same time. The marker size is increasing with altitude, and the color is showing more aggressive vertical ascent rates. We can see towards the end of the visualized ascent period, there is a short increased vertical ascent rate. -

    Figure 3.14. Zoomed in view of flight ascent

    Zoomed in view of flight ascent

    +

    Figure 3.14. Zoomed in view of flight ascent

    Zoomed in view of flight ascent

    The final visualization will look like the below. -

    Figure 3.15. Final visualization with multiple flight ascents

    Final visualization with multiple flight ascents

    +

    Figure 3.15. Final visualization with multiple flight ascents

    Final visualization with multiple flight ascents

    diff --git a/docs/html/ch03s06.html b/docs/html/ch03s06.html index 437c215..ade73c9 100644 --- a/docs/html/ch03s06.html +++ b/docs/html/ch03s06.html @@ -1,7 +1,7 @@ -Complete Flight Data Business Intelligence Dashboard

    Complete Flight Data Business Intelligence Dashboard

    +Complete Flight Data Business Intelligence Dashboard

    Complete Flight Data Business Intelligence Dashboard

    The dashboard, with all the visualizations at the same time, will look like the screenshot below. Here we can continue to extend the dashboards functionality by adding more dynamic variables to have the individual flight data on the left generated with a user query or selection based on the overview take-off information on the right. This is what really empowers decision makers and subject-matter experts (SMEs) to quickly move through data and hone-in on important aspects that may have otherwise been over-looked. -

    Figure 3.16. Flight data business intelligence dashboard

    Flight data business intelligence dashboard

    +

    Figure 3.16. Flight data business intelligence dashboard

    Flight data business intelligence dashboard

    diff --git a/docs/html/ch04.html b/docs/html/ch04.html index 0508610..b9ae2eb 100644 --- a/docs/html/ch04.html +++ b/docs/html/ch04.html @@ -1,4 +1,4 @@ -Chapter 4. Managing GTFS Data

    Chapter 4. Managing GTFS Data

    The General Transit Feed Specification (GTFS) defines a common format for public transportation schedules and associated geographic information. GTFS-realtime is used to specify real-time transit data. Many transportation agencies around the world publish their data in GTFS and GTFS-realtime format and make them publicly available. A well-known repository containing such data is OpenMobilityData.

    In this chapter, we illustrate how to load GTFS data in MobilityDB. For this, we first need to import the GTFS data into PostgreSQL and then transform this data so that it can be loaded into MobilityDB. The data used in this tutorial is obtained from STIB-MIVB, the Brussels public transportation company and is available as a ZIP file. You must be aware that GTFS data is typically of big size. In order to reduce the size of the dataset, this file only contains schedules for one week and five transportation lines, whereas typical GTFS data published by STIB-MIVB contains schedules for one month and 99 transportation lines. In the reduced dataset used in this tutorial the final table containing the GTFS data in MobilityDB format has almost 10,000 trips and its size is 241 MB. Furtheremore, we need several temporary tables to transform GTFS format into MobilityDB and these tables are also big, the largest one has almost 6 million rows and its size is 621 MB.

    Several tools can be used to import GTFS data into PostgreSQL. For example, one publicly available in Github can be found here. These tools load GTFS data into PostgreSQL tables, allowing one to perform multiple imports of data provided by the same agency covering different time frames, perform various complex tasks including data validation, and take into account variations of the format provided by different agencies, updates of route information among multiple imports, etc. For the purpose of this tutorial we do a simple import and transformation using only SQL. This is enough for loading the data set we are using but a much more robust solution should be used in an operational environment, if only for coping with the considerable size of typical GTFS data, which would require parallelization of this task.

    Loading GTFS Data in PostgreSQL

    The ZIP file with the data for this tutorial contains a set of CSV files (with extension .txt) as follows: +Chapter 4. Managing GTFS Data

    Chapter 4. Managing GTFS Data

    The General Transit Feed Specification (GTFS) defines a common format for public transportation schedules and associated geographic information. GTFS-realtime is used to specify real-time transit data. Many transportation agencies around the world publish their data in GTFS and GTFS-realtime format and make them publicly available. A well-known repository containing such data is OpenMobilityData.

    In this chapter, we illustrate how to load GTFS data in MobilityDB. For this, we first need to import the GTFS data into PostgreSQL and then transform this data so that it can be loaded into MobilityDB. The data used in this tutorial is obtained from STIB-MIVB, the Brussels public transportation company and is available as a ZIP file. You must be aware that GTFS data is typically of big size. In order to reduce the size of the dataset, this file only contains schedules for one week and five transportation lines, whereas typical GTFS data published by STIB-MIVB contains schedules for one month and 99 transportation lines. In the reduced dataset used in this tutorial the final table containing the GTFS data in MobilityDB format has almost 10,000 trips and its size is 241 MB. Furtheremore, we need several temporary tables to transform GTFS format into MobilityDB and these tables are also big, the largest one has almost 6 million rows and its size is 621 MB.

    Several tools can be used to import GTFS data into PostgreSQL. For example, one publicly available in Github can be found here. These tools load GTFS data into PostgreSQL tables, allowing one to perform multiple imports of data provided by the same agency covering different time frames, perform various complex tasks including data validation, and take into account variations of the format provided by different agencies, updates of route information among multiple imports, etc. For the purpose of this tutorial we do a simple import and transformation using only SQL. This is enough for loading the data set we are using but a much more robust solution should be used in an operational environment, if only for coping with the considerable size of typical GTFS data, which would require parallelization of this task.

    Loading GTFS Data in PostgreSQL

    The ZIP file with the data for this tutorial contains a set of CSV files (with extension .txt) as follows:

    • agency.txt contains the description of the transportation agencies provinding the services (a single one in our case).

    • calendar.txt contains service patterns that operate recurrently such as, for example, every weekday.

    • calendar_dates.txt define exceptions to the default service patterns defined in calendar.txt. There are two types of exceptions: 1 means that the service has been added for the specified date, and 2 means that the service has been removed for the specified date.

    • route_types.txt contains transportation types used on routes, such as bus, metro, tramway, etc.

    • routes.txt contains transit routes. A route is a group of trips that are displayed to riders as a single service.

    • shapes.txt contains the vehicle travel paths, which are used to generate the corresponding geometry.

    • stop_times.txt contains times at which a vehicle arrives at and departs from stops for each trip.

    • translations.txt contains the translation of the route information in French and Dutch. This file is not used in this tutorial.

    • trips.txt contains trips for each route. A trip is a sequence of two or more stops that occur during a specific time period.

    We decompress the file with the data into a directory. This can be done using the command. diff --git a/docs/html/ch04s02.html b/docs/html/ch04s02.html index ea3f9ca..9e207fe 100644 --- a/docs/html/ch04s02.html +++ b/docs/html/ch04s02.html @@ -1,4 +1,4 @@ -Transforming GTFS Data for MobilityDB

    Transforming GTFS Data for MobilityDB

    +Transforming GTFS Data for MobilityDB

    Transforming GTFS Data for MobilityDB

    We start by creating a table that contains couples of service_id and date defining the dates at which a service is provided.

     DROP TABLE IF EXISTS service_dates;
    diff --git a/docs/html/index.html b/docs/html/index.html
    index 4ff5f2e..ab2f994 100644
    --- a/docs/html/index.html
    +++ b/docs/html/index.html
    @@ -1,5 +1,4 @@
    -MobilityDB Workshop

    MobilityDB Workshop

    Mahmoud SAKR

    Université libre de Bruxelles, Belgium

    Esteban ZIMÁNYI

    Université libre de Bruxelles, Belgium

    Mohammad Ismail Tirmizi

    Université libre de Bruxelles, Belgium

    Adam Broniewski

    Université libre de Bruxelles, Belgium

    Jose Antonio Lorencio Abril

    Update contents to MobilityDB 1.1. -  
    Université libre de Bruxelles, Belgium

    Abstract

    +MobilityDB Workshop

    MobilityDB Workshop

    Mahmoud SAKR

    Université libre de Bruxelles, Belgium

    Esteban ZIMÁNYI

    Université libre de Bruxelles, Belgium

    Mohammad Ismail Tirmizi

    Université libre de Bruxelles, Belgium

    Adam Broniewski

    Université libre de Bruxelles, Belgium

    Jose Antonio Lorencio Abril

    Université libre de Bruxelles, Belgium

    Abstract

    Every module in this workshop illustrates a usage scenario of MobilityDB. The data sets and the tools are described inside each of the modules. Eventually, additional modules will be added to discover more MobilityDB features.

    While this workshop illustrates the usage of MobilityDB functions, it does not explain them in detail. If you need help concerning the functions of MobilityDB, please refer to the documentation. @@ -7,25 +6,25 @@ If you have questions, ideas, comments, etc., please contact me on mahmoud.sakr@ulb.be.

    -



    Table of Contents

    1. Managing Ship Trajectories (AIS)
    Contents
    Data
    Tools
    Preparing the Database
    Loading the Data
    Constructing Trajectories
    Basic Data Exploration
    Analyzing the Trajectories
    2. Dashboard and Visualization of Ship Trajectories (AIS)
    Contents
    Tools
    Setting up the Data Source
    Setting up the Visualization Dashboard
    Sign in and Connect to Data Source
    Creating a Dashboard
    Speed of Individual Ships
    Routes Used Most Frequently Visualized with a Static Heat Map
    Number of Boats Moving Through a Given Area
    Boats in Proximity in a Given Time Range
    Dynamic Dashboards - Creating Variables
    Dynamic Query: Number of Boats Moving Through a Given Area - in a Certain Time Period
    Global Variables
    Final Dashboard
    3. Managing Flight Data and Creating Dashboard with Grafana
    Contents
    Tools
    Part 1 - Data and Environment Preparation
    Preparing the Database
    Data Cleaning
    Setting up the Dashboard and Connecting to Data + in a Certain Time Period
    Global Variables
    Final Dashboard
    3. Managing Flight Data and Creating Dashboard with Grafana
    Contents
    Tools
    Part 1 - Data and Environment Preparation
    Preparing the Database
    Data Cleaning
    Setting up the Dashboard and Connecting to Data Source -
    Part 2 - Working with Discrete Points
    Visualizing 24hr Flight Pattern of Single Airplane
    Time-series Graphs for a Single Airplane
    Part 3 - Working with Continuous Trajectories in MobilityDB
    Creating MobilityDB Trajectories
    Aggregating Flight Statistics
    Flights Taking-off in Some Interval of Time (User-Defined)
    Complete Flight Data Business Intelligence Dashboard
    4. Managing GTFS Data
    Loading GTFS Data in PostgreSQL
    Transforming GTFS Data for MobilityDB
    5. Managing Google Location History
    Loading Google Location History Data
    6. Managing GPX Data
    Loading GPX Data

    List of Figures

    1.1. Visualizing the input points
    1.2. Visualizing the ship trajectories
    1.3. Ship trajectories after filtering
    1.4. Ship trajectories with big difference between speed(Trip) and SOG
    1.5. Ship trajectories with big difference between azimuth(Trip) and COG
    1.6. A sample ship trajectory between Rødby and Puttgarden
    1.7. All ferries between Rødby and Puttgarden
    1.8. Ship that come closer than 300 meters to one another
    1.9. A zoom-in on a dangerous approach
    1.10. Another dangerous approach
    2.1. Data Source settings
    2.2. Datatype transformations in Grafana
    2.3. Choosing visualization type
    2.4. Value options dialogue box
    2.5. Stat styles dialogue box
    2.6. Standard options dialogue box
    2.7. Thresholds dialogue box
    2.8. Individual ship speed statistics visualization
    2.9. Setting initial view in map view dialogue box
    2.10. Setting up heat-map in data layer dialogue - box
    2.11. Choosing color scheme in standard options dialogue - box
    2.12. Route usage frequency heat-map visualization
    2.13. Frequency intersecting with geometric envelop - visualization
    2.14. Multiple layers in data layers dialogue box
    2.15. Visualization of ships within 300m using heat-map
    2.16. Multiple results for the same ship at various times while - in a port
    2.17. Dashboard settings gear box
    2.18. Selecting Variables in dashboard settings
    2.19. Creating user-defined list of custom variables
    2.20. Visualization of geometry intersection using dynamic - variables
    2.21. Assigning time range using global variables
    2.22. Full Dashboard
    3.1. First row of table single_airframe, with +
    Part 2 - Working with Discrete Points
    Visualizing 24hr Flight Pattern of Single Airplane
    Time-series Graphs for a Single Airplane
    Part 3 - Working with Continuous Trajectories in MobilityDB
    Creating MobilityDB Trajectories
    Aggregating Flight Statistics
    Flights Taking-off in Some Interval of Time (User-Defined)
    Complete Flight Data Business Intelligence Dashboard
    4. Managing GTFS Data
    Loading GTFS Data in PostgreSQL
    Transforming GTFS Data for MobilityDB
    5. Managing Google Location History
    Loading Google Location History Data
    6. Managing GPX Data
    Loading GPX Data

    List of Figures

    1.1. Visualizing the input points
    1.2. Visualizing the ship trajectories
    1.3. Ship trajectories after filtering
    1.4. Ship trajectories with big difference between speed(Trip) and SOG
    1.5. Ship trajectories with big difference between azimuth(Trip) and COG
    1.6. A sample ship trajectory between Rødby and Puttgarden
    1.7. All ferries between Rødby and Puttgarden
    1.8. Ship that come closer than 300 meters to one another
    1.9. A zoom-in on a dangerous approach
    1.10. Another dangerous approach
    2.1. Data Source settings
    2.2. Datatype transformations in Grafana
    2.3. Choosing visualization type
    2.4. Value options dialogue box
    2.5. Stat styles dialogue box
    2.6. Standard options dialogue box
    2.7. Thresholds dialogue box
    2.8. Individual ship speed statistics visualization
    2.9. Setting initial view in map view dialogue box
    2.10. Setting up heat-map in data layer dialogue + box
    2.11. Choosing color scheme in standard options dialogue + box
    2.12. Route usage frequency heat-map visualization
    2.13. Frequency intersecting with geometric envelop + visualization
    2.14. Multiple layers in data layers dialogue box
    2.15. Visualization of ships within 300m using heat-map
    2.16. Multiple results for the same ship at various times while + in a port
    2.17. Dashboard settings gear box
    2.18. Selecting Variables in dashboard settings
    2.19. Creating user-defined list of custom variables
    2.20. Visualization of geometry intersection using dynamic + variables
    2.21. Assigning time range using global variables
    2.22. Full Dashboard
    3.1. First row of table single_airframe, with 24hrs of flight information for airplane c827a6 -
    3.2. Full table single_airframe_traj for airplane +
    3.2. Full table single_airframe_traj for airplane c827a6 with data in mobilityDB trajectories format -
    3.3. First row of table flight_traj_sample, which +
    3.3. First row of table flight_traj_sample, which includes 200 flight trajectories. -
    3.4. Grafana time range panel
    3.5. Single airframe geopoints vs time
    3.6. Single airframe velocity vs time
    3.7. Single airframe altitude vs time
    3.8. Single airframe vertrate vs time
    3.9. Single airframe callsign vs time
    3.10. Average flight speed visualization
    3.11. Multiple queries providing results for a single - visualization
    3.12. Override options for panel with multiple - queries
    3.13. Statistic visualization of number of flights by license - type
    3.14. Zoomed in view of flight ascent
    3.15. Final visualization with multiple flight ascents
    3.16. Flight data business intelligence dashboard
    4.1. Visualization of the routes and stops for the GTFS data from Brussels.
    5.1. Visualization of the Google location history loaded into MobilityDB.

    List of Tables

    1.1. AIS columns
    +
    3.4. Grafana time range panel
    3.5. Single airframe geopoints vs time
    3.6. Single airframe velocity vs time
    3.7. Single airframe altitude vs time
    3.8. Single airframe vertrate vs time
    3.9. Single airframe callsign vs time
    3.10. Average flight speed visualization
    3.11. Multiple queries providing results for a single + visualization
    3.12. Override options for panel with multiple + queries
    3.13. Statistic visualization of number of flights by license + type
    3.14. Zoomed in view of flight ascent
    3.15. Final visualization with multiple flight ascents
    3.16. Flight data business intelligence dashboard
    4.1. Visualization of the routes and stops for the GTFS data from Brussels.
    5.1. Visualization of the Google location history loaded into MobilityDB.

    List of Tables

    1.1. AIS columns
    diff --git a/docs/index.md b/docs/index.md index b46bffe..3cf15d1 100644 --- a/docs/index.md +++ b/docs/index.md @@ -3,6 +3,10 @@ ---------------------------- Here are links to the documentation of MobilityDB-workshop +MobilityDB icon + ----------------------------- ## **Version 1.1** ----------------------------- diff --git a/docs/mobilitydb-workshop.epub b/docs/mobilitydb-workshop.epub index 24bcaee..d9710ff 100644 Binary files a/docs/mobilitydb-workshop.epub and b/docs/mobilitydb-workshop.epub differ diff --git a/docs/mobilitydb-workshop.pdf b/docs/mobilitydb-workshop.pdf index 060ac6f..34c36c7 100644 Binary files a/docs/mobilitydb-workshop.pdf and b/docs/mobilitydb-workshop.pdf differ