Skip to content

blocklytics/FOAM-signal-visualization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FOAM-Signals Visualization

The package enables user to request a FOAM signal visualization by providing its ID. Visualization includes:

  • mapbox map showing area around the signal;
  • beacon showing location of the signal
  • and a dome representing range of the signal.

Visualization of signal #223

Examples

Dome size, map zoom and beacon size depend on signal's radius. FOAM signals radius can range from 1 to 25 km.

Signals radii: 1km --> 5km --> 25km

Ushuaia - 54.8°S

Quito - 0.1°S

New York - 40.7°N

Longyearby - 78.2°N

With Mapbox-maps zoom depends on latitude, click here for an explanation.

Workings

Signal data

Mapbox static maps

  • API call for normal map without roads and labels
  • API call for map with roads only
  • API call for map with labels only

This enables putting a layer in between ground, labels and roads.

Drawing a dome

  • Semi-circle (0° --> 180°)
  • Semi-ellipse (0° --> -180°)
  • Ellipse outline arcs fading with distance

Usage

Please log bugs and feature requests to issues. Develop and add your own features by creating a pull request.

Install dependencies in a new virtual environment:

$ virtualenv env
$ source env/bin/activate
$ pip install -r requirements.txt

Create an .env file:

MAPBOX_TOKEN = xxxxx
WEB3_INFURA_PROJECT_ID = xxxxx

Create Mapbox token here. Create Infura API key here.

Run with signal ID:

Include --save to save the visualization and --show to display it with the default image viewer.

$ python main.py <signal_id> [--show] [--save [<path>]]

Try it out with signal #223:

$ python main.py 223 --show

Run without signal ID:

User can provide its own parameters instead of calling a signal. In visualizer.py there is a function visual_from_data which takes coordinates and radius as parameters. Look at run_examples.py for some examples.

Polar explorers note! Mapbox only allows latitude <= 85°N and >= 85°S.

Credits

Map images © Mapbox © OpenStreetMap

Beacon visuals © Macrovector

Contact

You can contact me via mail on [email protected]

About

FOAM signal visualization from its ID.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published