Skip to content

Commit 3af2270

Browse files
tfoldiabey79
andauthored
Map View and GeoPoints archetype (#6561)
### What Map Space View for GNSS/GPS data logged through new GPS Coordinates archetype. https://github.com/rerun-io/rerun/assets/82426/86b13ba3-97af-47d2-9422-7052d7064265 - Added a new `re_space_view_map` crate for visualizing `Points3D` with gps coordinates. - `map_visualizer_system.rs` implements the `VisualizerSystem` trait. It has only one meaningful function, that takes the `Positions3D` components and turns into `vec<MapEntry>` array along with optional `Color` and `Radius` components. This `vec<MapEntry>` is the only field of the `MapVisualizerSystem`. - `map_space_view.rs` is where the magic happens. It uses `walkers` slippy map implementation to show an OpenStreetMap or Mapbox map. On the `selection_ui ` you can change the map providers. To view Mapbox maps, you need to set mapbox tokens (you can get free tokens from Mapbox's site) and pass it via the env variable (`MAPBOX_ACCESS_TOKEN`) or via the blueprint - `map_windows.rs` is a small helper to show the zoom controls and acknowledgment on the UIs. - For blueprints I made `MapProvider` component (enum with providers+styles), and a `MapOptions` archetype. The logging of data is performed as follows: ```rust //! Log some GPS coordinates fn main() -> Result<(), Box<dyn std::error::Error>> { let rec = rerun::RecordingStreamBuilder::new("rerun_example_gps_coordinates").spawn()?; rec.log( "points", &rerun::Points3D::new([(47.6344, 19.1397, 0.0), (47.6344, 19.1399, 1.0)]), )?; Ok(()) } ``` The blueprint is defined as follows: ```python """Use a blueprint to show a map.""" import rerun as rr import rerun.blueprint as rrb rr.init("rerun_example_gps_coordinates", spawn=True) rr.log("points", Points3D([[47.6344, 19.1397, 0], [47.6334, 19.1399, 1]])) # Create a map view to display the chart. blueprint = rrb.Blueprint( rrb.MapView( origin="points", name="MapView", map_options=rrb.archetypes.MapOptions(provider=rrb.components.MapProvider.MapboxStreets), ), collapse_panels=True, ) rr.send_blueprint(blueprint) ``` The PR is not perfect, but the view is usable. Please review the changes and evaluate their potential utility for your needs. If you don't like, prefer not to merge just close it - no hard feelings. ### To be discussed * Check with you guys to see if the name is right at all. Maybe instead of GPS we can go with something better * Position3D is limited to `f32` instead of `f64`. This makes it less precise than `/NavSatFix` ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested the web demo (if applicable): * Using my own lame demo app which is not part of the PR. * [x] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG - [PR Build Summary](https://build.rerun.io/pr/6561) - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html) To run all checks from `main`, comment on the PR with `@rerun-bot full-check`. --------- Co-authored-by: Antoine Beyeler <[email protected]>
1 parent 42175df commit 3af2270

File tree

128 files changed

+4832
-59
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+4832
-59
lines changed

Diff for: ARCHITECTURE.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,14 @@ Of course, this will only take us so far. In the future we plan on caching queri
8888
Here is an overview of the crates included in the project:
8989

9090
<picture>
91-
<img src="https://static.rerun.io/crates/4f5569b318a5b8d7b0e9ab6e34e672c58ac5c63e/full.png" alt="">
92-
<source media="(max-width: 480px)" srcset="https://static.rerun.io/crates/4f5569b318a5b8d7b0e9ab6e34e672c58ac5c63e/480w.png">
93-
<source media="(max-width: 768px)" srcset="https://static.rerun.io/crates/4f5569b318a5b8d7b0e9ab6e34e672c58ac5c63e/768w.png">
94-
<source media="(max-width: 1024px)" srcset="https://static.rerun.io/crates/4f5569b318a5b8d7b0e9ab6e34e672c58ac5c63e/1024w.png">
95-
<source media="(max-width: 1200px)" srcset="https://static.rerun.io/crates/4f5569b318a5b8d7b0e9ab6e34e672c58ac5c63e/1200w.png">
91+
<img src="https://static.rerun.io/crates/3bdd323e2f9c8f6561cfc0696e7362190918d0fc/full.png" alt="">
92+
<source media="(max-width: 480px)" srcset="https://static.rerun.io/crates/3bdd323e2f9c8f6561cfc0696e7362190918d0fc/480w.png">
93+
<source media="(max-width: 768px)" srcset="https://static.rerun.io/crates/3bdd323e2f9c8f6561cfc0696e7362190918d0fc/768w.png">
94+
<source media="(max-width: 1024px)" srcset="https://static.rerun.io/crates/3bdd323e2f9c8f6561cfc0696e7362190918d0fc/1024w.png">
95+
<source media="(max-width: 1200px)" srcset="https://static.rerun.io/crates/3bdd323e2f9c8f6561cfc0696e7362190918d0fc/1200w.png">
9696
</picture>
9797

9898

99-
10099
<!-- !!! IMPORTANT!!!
101100
102101
This image must be updated each time a crate is added/removed/updated.
@@ -135,6 +134,7 @@ Update instructions:
135134
| re_space_view | Types & utilities for defining Space View classes and communicating with the Viewport. |
136135
| re_space_view_bar_chart | A Space View that shows a single bar chart. |
137136
| re_space_view_dataframe | A Space View that shows the data contained in entities in a table. |
137+
| re_space_view_map | A Space View that shows geospatial data on a map. |
138138
| re_space_view_spatial | Space Views that show entities in a 2D or 3D spatial relationship. |
139139
| re_space_view_tensor | A Space View dedicated to visualizing tensors with arbitrary dimensionality. |
140140
| re_space_view_text_document | A simple Space View that shows a single text box. |

0 commit comments

Comments
 (0)