ethanjweiner / visualize-the-web

A geographic visualizer of HTTP requests across long distances, built with Python and Flask
2 stars 1 forks source link

Write landpoints() function #23

Closed ethanjweiner closed 3 years ago

ethanjweiner commented 3 years ago

Task Title

Task: Write landpoints() function

Task Description

This Task will...

Summary: Find a way to generate a path from each landpoint to its connected landpoints

Epic Parent

Feature: Awesome Feature Title

ethanjweiner commented 3 years ago

Using https://github.com/telegeography/www.submarinecablemap.com/blob/master/public/api/v2/ as data source.

We have access to cable and landing point GeoJSON data. More importantly, however, we have access to cable data. Each cable includes information about the corresponding landing points. And the landing points data includes information about the corresponding cables.

Our "goal" is to have a list of all the landing points, and the nodes that this landing point is attached to. In order for the landing point to be chosen, it's "end router" must be in the relative direction of the destination. So now the question becomes: how can we ensure that the cable it takes is in the right direction? Should we allow it to be random?

My thought is that we simply ensure that the path taken brings the data CLOSER to the destination (i.e. latitude & longitude distance is shorter)

Furthermore, I think the best way to represent the data is as singular cables with two landing points --- this will simplify things immensely.

ethanjweiner commented 3 years ago

Potential pseudocode for landing_points() function

  1. Import each landing point as a geoJSON
  2. Use the landing point id to get more information about the point
  3. Use the corresponding cable id(s) to get more information about the cable
  4. Store all of the connected cables/landing points
  5. During the routing function: Direct to landing point; choose ending point based on distance-to-destination; route to that ending point using cable data
ethanjweiner commented 3 years ago

Idea: Only query for the cable upon landing on a landing point