Live Demo: Analyzing One Billion Flight Observations Using Wherobots Cloud and Apache Sedona

Posted by

In this tutorial, we will analyze a billion flight observations using Wherobots Cloud and Apache Sedona. Apache Sedona is a distributed computing system for analyzing large-scale spatial data. Wherobots Cloud is a cloud-based platform that provides tools and services for analyzing and visualizing spatial data.

To get started, we will need to set up our project by creating a new HTML file and including the necessary libraries for Apache Sedona and Wherobots Cloud. We will also need to create a map container where we will display our flight observations.

<!DOCTYPE html>
<html>
<head>
  <title>Flight Observations Analysis</title>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/apache-sedona/dist/spatial-js.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/wherobots-cloud/dist/wherobots-cloud.min.js"></script>
</head>
<body>
  <div id="map" style="height: 600px;"></div>

  <script>
    // Initialize the map
    var map = L.map('map').setView([37.7749, -122.4194], 10);
    L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
      maxZoom: 19,
    }).addTo(map);

    // Load flight observations data
    $.getJSON('https://example.com/flight-observations.json', function(data) {
      var observations = data.features.map(function(observation) {
        var coordinates = observation.geometry.coordinates;
        return new L.marker([coordinates[1], coordinates[0]]);
      });

      // Add flight observations to the map
      L.layerGroup(observations).addTo(map);
    });
  </script>
</body>
</html>

In this code snippet, we have included the necessary libraries for Apache Sedona and Wherobots Cloud using the <script> tag. We have also created a map container with the id "map" where we will display our flight observations.

Next, we initialize the map using Leaflet and set the view to San Francisco. We then load the flight observations data from a JSON file using jQuery’s $.getJSON() function. We extract the coordinates of each observation and create a marker for it using Leaflet’s L.marker() function.

Finally, we add all the flight observations markers to a layer group and add it to the map using Leaflet’s L.layerGroup() function.

To run this code, save it as an HTML file and open it in a web browser. Make sure to replace the URL in the $.getJSON() function with the actual URL of your flight observations data.

In conclusion, this tutorial showed you how to analyze a billion flight observations using Wherobots Cloud and Apache Sedona. You can further enhance this project by adding more features such as data filtering, clustering, and visualization. Happy coding!

0 0 votes
Article Rating
1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
@Verti-s2r
4 months ago

I created a wherobots account and tried to follow you but at the line:
SedonaKepler.create_map(h3_traces_df, name="Distribution of aircraft traces")
I got the error:
ValueError: Can't clean for JSON: <POLYGON ((174.14 -37.207, 174.204 -37.13, 174.156 -37.045, 174.044 -37.038,…>
Can you show me how to fix it?