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

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
8ff0d2b
Introduce `GeoLineStrings` archetype and support it in the map view
abey79 Oct 31, 2024
1758a8d
Add snippet and screenshot for the `GeoPoints` archetype
abey79 Nov 1, 2024
66966a5
Fix view heuristics
abey79 Nov 1, 2024
c2ffaf8
Add `LatLon` and `DVec2D` to `rerun.hpp`
abey79 Nov 1, 2024
b73702e
Add snippet (but not screenshot!) for `GeoLineStrings`
abey79 Nov 1, 2024
0db1607
`py-fmt`
abey79 Nov 1, 2024
f2c46a2
Attempt to fix C++ ci
abey79 Nov 1, 2024
eaf63eb
Codegen
abey79 Nov 1, 2024
79a694c
cpp-fmt
abey79 Nov 1, 2024
291bff6
more lint fixes
abey79 Nov 1, 2024
3632ff1
moar lint
abey79 Nov 1, 2024
aa500d1
Default line radius 2.0 ui points + revert some messy diff
abey79 Nov 1, 2024
7b34745
Added edit ui for `GeoLineString` (based on `LineStrip2D`)
abey79 Nov 1, 2024
6ae095a
Add python unit tests for `GeoPoints`
abey79 Nov 1, 2024
5a20bee
Add python unit tests for `GeoLineStrings`
abey79 Nov 1, 2024
dd77177
Added url to epsg:4326 + clarified degree & N/E positive for lat/lon
abey79 Nov 4, 2024
cd97ad7
Update C++ and Rust snippet to make constructors more explicit about …
abey79 Nov 4, 2024
af9756c
Add explicit `from_lat_lon` and `from_lon_lat` to `GeoPoints` in Python
abey79 Nov 4, 2024
34ae0b3
All Python constructor now have `lat_lon=` kw-only argument + revert …
abey79 Nov 4, 2024
16f67f0
Fix `GeoLineString` ui
abey79 Nov 4, 2024
7b042e2
Custom ui for `LatLon`
abey79 Nov 4, 2024
595c331
Update rerun_cpp/src/rerun/archetypes/geo_points_ext.cpp
abey79 Nov 4, 2024
fb85c62
Update rerun_cpp/src/rerun/components/geo_line_string_ext.cpp
abey79 Nov 4, 2024
19e65d6
codegen
abey79 Nov 4, 2024
50b4991
Merge branch 'main' into antoine/linestrip
abey79 Nov 4, 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