Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce the GeoLineStrings archetype and support it in the map view #7968

Merged
merged 28 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4ee5d0e
Introduce `GeoLineStrings` archetype and support it in the map view
abey79 Oct 31, 2024
b507744
Add snippet and screenshot for the `GeoPoints` archetype
abey79 Nov 1, 2024
034c327
Fix view heuristics
abey79 Nov 1, 2024
f078708
Add `LatLon` and `DVec2D` to `rerun.hpp`
abey79 Nov 1, 2024
970e588
Add snippet (but not screenshot!) for `GeoLineStrings`
abey79 Nov 1, 2024
67610cc
`py-fmt`
abey79 Nov 1, 2024
eefbb33
Attempt to fix C++ ci
abey79 Nov 1, 2024
24c4e8b
Codegen
abey79 Nov 1, 2024
3a7d6fc
cpp-fmt
abey79 Nov 1, 2024
8f552bb
more lint fixes
abey79 Nov 1, 2024
68e5a92
moar lint
abey79 Nov 1, 2024
614a54b
Default line radius 2.0 ui points + revert some messy diff
abey79 Nov 1, 2024
36eb768
Added edit ui for `GeoLineString` (based on `LineStrip2D`)
abey79 Nov 1, 2024
1d4cf02
Add python unit tests for `GeoPoints`
abey79 Nov 1, 2024
42269ca
Add python unit tests for `GeoLineStrings`
abey79 Nov 1, 2024
1cd5f76
Added url to epsg:4326 + clarified degree & N/E positive for lat/lon
abey79 Nov 4, 2024
67aee35
Update C++ and Rust snippet to make constructors more explicit about …
abey79 Nov 4, 2024
cbb267a
Add explicit `from_lat_lon` and `from_lon_lat` to `GeoPoints` in Python
abey79 Nov 4, 2024
d969073
All Python constructor now have `lat_lon=` kw-only argument + revert …
abey79 Nov 4, 2024
2c221fc
Fix `GeoLineString` ui
abey79 Nov 4, 2024
778c47c
Custom ui for `LatLon`
abey79 Nov 4, 2024
cc0e527
Update rerun_cpp/src/rerun/archetypes/geo_points_ext.cpp
abey79 Nov 4, 2024
b262a00
Update rerun_cpp/src/rerun/components/geo_line_string_ext.cpp
abey79 Nov 4, 2024
1925d6d
codegen
abey79 Nov 4, 2024
314e3f1
codegen
abey79 Nov 6, 2024
63425de
Fix map view example snippet
abey79 Nov 6, 2024
6e162e9
Codegen, again
abey79 Nov 6, 2024
eb90eb4
do not ever drain ALL_RECORDINGS
teh-cmc Nov 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/store/re_types/definitions/rerun/archetypes.fbs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
namespace rerun.archetypes;

// ---

/// Geospatial line strings with positions expressed in [EPSG:4326](https://epsg.io/4326) altitude and longitude (North/East-positive degrees), and optional colors and radii.
///
/// Also known as "line strips" or "polylines".
///
abey79 marked this conversation as resolved.
Show resolved Hide resolved
/// **Note**: Geospatial entities are experimental.
///
/// \example archetypes/geo_line_string_simple title="Log a geospatial line string"
// TODO(ab): add screenshot
table GeoLineStrings (
"attr.rust.derive": "PartialEq",
"attr.rust.new_pub_crate",
"attr.docs.category": "Geospatial",
"attr.docs.view_types": "MapView",
"attr.docs.unreleased"
) {
// --- Required ---

/// The line strings, expressed in [EPSG:4326](https://epsg.io/4326) coordinates (North/East-positive degrees).
line_strings: [rerun.components.GeoLineString] ("attr.rerun.component_required", order: 1000);

// --- Recommended ---

/// Optional radii for the line strings.
radii: [rerun.components.Radius] ("attr.rerun.component_recommended", nullable, order: 2000);

/// Optional colors for the line strings.
///
/// \py The colors are interpreted as RGB or RGBA in sRGB gamma-space,
/// \py As either 0-1 floats or 0-255 integers, with separate alpha.
colors: [rerun.components.Color] ("attr.rerun.component_recommended", nullable, order: 2100);

//TODO(ab): add `Label` and `ShowLabels` components
//TODO(ab): add `Altitude` component
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
namespace rerun.archetypes;

// ---

/// Geospatial points with positions expressed in EPSG:4326 altitude and longitude, and optional colors and radii.
/// Geospatial points with positions expressed in [EPSG:4326](https://epsg.io/4326) latitude and longitude (North/East-positive degrees), and optional colors and radii.
///
/// **Note**: Geospatial entities are experimental.
// TODO(ab): add snippet and screenshot
///
/// \example archetypes/geo_point_simple title="Log a geospatial point" image="https://static.rerun.io/geopoint_simple/146b0783c5aea1c1b6a9aab938879942b7c820e2/1200w.png"
// TODO(ab): screenshot
table GeoPoints (
"attr.rust.derive": "PartialEq",
"attr.rust.new_pub_crate",
"attr.docs.category": "Geospatial",
"attr.docs.view_types": "MapView",
"attr.docs.unreleased"
) {
// --- Required ---

/// The EPSG:4326 coordinates for the points.
/// The [EPSG:4326](https://epsg.io/4326) coordinates for the points (North/East-positive degrees).
positions: [rerun.components.LatLon] ("attr.rerun.component_required", order: 1000);

// --- Recommended ---
Expand Down
1 change: 1 addition & 0 deletions crates/store/re_types/definitions/rerun/components.fbs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

namespace rerun.components;

// ---

/// A geospatial line string expressed in [EPSG:4326](https://epsg.io/4326) latitude and longitude (North/East-positive degrees).
table GeoLineString (
"attr.python.aliases": "datatypes.DVec2DArrayLike, npt.NDArray[np.float64]",
"attr.python.array_aliases": "npt.NDArray[np.float64]",
"attr.rust.derive": "Default, PartialEq",
"attr.rust.repr": "transparent",
"attr.cpp.no_field_ctors",
"attr.docs.unreleased"
) {
lat_lon: [rerun.datatypes.DVec2D] (order: 100);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace rerun.components;

// ---

/// A geographical position expressed in EPSG:4326 latitude and longitude.
/// A geospatial position expressed in [EPSG:4326](https://epsg.io/4326) latitude and longitude (North/East-positive degrees).
struct LatLon (
"attr.python.aliases": "npt.NDArray[np.float32], Sequence[float], Tuple[float, float]",
"attr.python.array_aliases": "npt.NDArray[np.float32], Sequence[float]",
Expand Down
1 change: 1 addition & 0 deletions crates/store/re_types/src/archetypes/.gitattributes

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

258 changes: 258 additions & 0 deletions crates/store/re_types/src/archetypes/geo_line_strings.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions crates/store/re_types/src/archetypes/geo_line_strings_ext.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
use super::GeoLineStrings;

impl GeoLineStrings {
/// Create a new `GeoLineStrings` from [EPSG:4326](https://epsg.io/4326) latitude and longitude (North/East-positive degrees).
#[inline]
pub fn from_lat_lon(
line_strings: impl IntoIterator<Item = impl Into<crate::components::GeoLineString>>,
) -> Self {
Self::new(line_strings)
}
}
Loading
Loading