Skip to content

Commit

Permalink
Add a new "Air Traffic Data" example (#5449)
Browse files Browse the repository at this point in the history
This example demonstrates multiple aspects of the Rerun viewer:

- Use of the [map
view](https://rerun.io/docs/reference/types/views/map_view).
- Use of [pyproj](https://pyproj4.github.io/pyproj/stable/) to transform
geospatial data from one coordinate system to another.
- Use [GeoPandas](https://geopandas.org/en/stable/) to load geospatial
data into a 3D view.
- Use [Polars](https://pola.rs) to batch data to be sent via
[`rr.send_columns()`](https://rerun.io/docs/howto/logging/send-columns)
(use `--batch`).
- 
```
pixi run py-build-examples && pixi run -e examples air_traffic_data
```


![](https://static.rerun.io/air_traffic_data/4a68b46a404c4f9e3c082f57a8a8ed4bf5b9b236/1200w.png)

---------

Co-authored-by: Clement Rey <cr.rey.clement@gmail.com>
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
  • Loading branch information
3 people authored Nov 27, 2024
1 parent 18189a4 commit 0493fc8
Show file tree
Hide file tree
Showing 9 changed files with 1,084 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,6 @@ extend-ignore-re = [
"np.arange", # numpy spells "arrange" wrong
"phc_[a-zA-Z0-9]*", # Posthog public key
"PNG.?", # Workaround for https://github.com/crate-ci/typos/issues/967

"_LEVL_", # USed in air_traffic_data.py
]
2 changes: 2 additions & 0 deletions examples/manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ examples = [
"dicom_mri",
"blueprint_stocks",
"arflow",
"air_traffic_data",
]

[categories.feature-showcase]
Expand All @@ -150,6 +151,7 @@ examples = [
"raw_mesh",
"graph_lattice",
"graph_binary_tree",
"air_traffic_data",
]

# These are examples that we explicitly exclude from our website. You can check that all examples are either included
Expand Down
1 change: 1 addition & 0 deletions examples/python/air_traffic_data/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/data
49 changes: 49 additions & 0 deletions examples/python/air_traffic_data/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!--[metadata]
title = "Air traffic data"
tags = ["2D", "3D", "map", "crs"]
description = "Display aircraft traffic data"
thumbnail = "https://static.rerun.io/air_traffic_data/4a68b46a404c4f9e3c082f57a8a8ed4bf5b9b236/480w.png"
thumbnail_dimensions = [480, 294]
channel = "main"
-->


Display air traffic data kindly provided by [INVOLI](https://www.involi.com).

<picture>
<img src="https://static.rerun.io/air_traffic_data/4a68b46a404c4f9e3c082f57a8a8ed4bf5b9b236/full.png" alt="">
<source media="(max-width: 480px)" srcset="https://static.rerun.io/air_traffic_data/4a68b46a404c4f9e3c082f57a8a8ed4bf5b9b236/480w.png">
<source media="(max-width: 768px)" srcset="https://static.rerun.io/air_traffic_data/4a68b46a404c4f9e3c082f57a8a8ed4bf5b9b236/768w.png">
<source media="(max-width: 1024px)" srcset="https://static.rerun.io/air_traffic_data/4a68b46a404c4f9e3c082f57a8a8ed4bf5b9b236/1024w.png">
<source media="(max-width: 1200px)" srcset="https://static.rerun.io/air_traffic_data/4a68b46a404c4f9e3c082f57a8a8ed4bf5b9b236/1200w.png">
</picture>

This example demonstrates multiple aspects of the Rerun viewer:

- Use of the [map view](https://rerun.io/docs/reference/types/views/map_view).
- Use of [pyproj](https://pyproj4.github.io/pyproj/stable/) to transform geospatial data from one coordinate system to another.
- Use [GeoPandas](https://geopandas.org/en/stable/) to load geospatial data into a 3D view.
- Use [Polars]https://pola.rs) to batch data to be sent via [`rr.send_columns()`](https://rerun.io/docs/howto/logging/send-columns) (use `--batch`).


## Run the code

To run this example, make sure you have Python version at least 3.9, the Rerun repository checked out and the latest SDK installed:
```bash
pip install --upgrade rerun-sdk # install the latest Rerun SDK
git clone git@github.com:rerun-io/rerun.git # Clone the repository
cd rerun
git checkout latest # Check out the commit matching the latest SDK release
```
Install the necessary libraries specified in the requirements file:
```bash
pip install -e examples/python/air_traffic_data
```
To experiment with the provided example, simply execute the main Python script:
```bash
python -m air_traffic_data
```
If you wish to customize it, explore additional features, or save it use the CLI with the `--help` option for guidance:
```bash
python -m air_traffic_data --help
```
Loading

0 comments on commit 0493fc8

Please sign in to comment.