11// SPDX-License-Identifier: Apache-2.0
22// SPDX-FileCopyrightText: Copyright the Vortex contributors
33
4- //! Coordinate building blocks for geometry extension types: the
5- //! `Struct<x: f64, y: f64, z?: f64, m?: f64>` storage, its [`Dimension`], and the decoded
6- //! [`Coordinate`] value.
4+ //! Coordinate building blocks for geometry extension types: the `Struct<x, y[, z][, m]>` storage
5+ //! of non-nullable `f64` fields, its [`Dimension`], and the decoded [`Coordinate`] value.
76//!
8- //! The coordinate fields, where `?` marks an optional field, are:
7+ //! The coordinate fields are:
98//! - `x` — longitude or easting
109//! - `y` — latitude or northing
11- //! - `z?` — elevation
12- //! - `m?` — measure: an arbitrary per-point value such as distance along a route or a timestamp
10+ //! - `z` (optional) — elevation
11+ //! - `m` (optional) — measure: an arbitrary per-point value such as distance along a route or a
12+ //! timestamp
1313
1414use std:: fmt:: Display ;
1515use std:: fmt:: Formatter ;
@@ -65,7 +65,7 @@ impl Dimension {
6565 }
6666}
6767
68- /// A decoded coordinate. `z? `/`m? ` are `Some` iff the storage dimension includes them.
68+ /// A decoded coordinate. `z`/`m` are `Some` iff the storage dimension includes them.
6969///
7070/// This is the native value produced when unpacking a [`Point`](crate::extension::Point) scalar;
7171/// the rest of the coordinate machinery is crate-internal.
@@ -75,14 +75,14 @@ pub struct Coordinate {
7575 pub x : f64 ,
7676 /// The y (latitude/northing) ordinate.
7777 pub y : f64 ,
78- /// The optional `z? ` (elevation) ordinate.
78+ /// The optional `z` (elevation) ordinate.
7979 pub z : Option < f64 > ,
80- /// The optional `m? ` (measure) ordinate.
80+ /// The optional `m` (measure) ordinate.
8181 pub m : Option < f64 > ,
8282}
8383
8484impl Coordinate {
85- /// A 2D coordinate (`z? `/`m? ` unset).
85+ /// A 2D coordinate (`z`/`m` unset).
8686 pub fn xy ( x : f64 , y : f64 ) -> Self {
8787 Coordinate {
8888 x,
@@ -122,7 +122,7 @@ pub(crate) fn coordinate_dimension(dtype: &DType) -> VortexResult<Dimension> {
122122 Dimension :: from_field_names ( fields. names ( ) )
123123}
124124
125- /// Decode a [`Coordinate`] from a coordinate `Struct<x, y, z? , m? >` scalar (`z? `/`m? ` read iff
125+ /// Decode a [`Coordinate`] from a coordinate `Struct<x, y[ , z][ , m] >` scalar (`z`/`m` read iff
126126/// present, so the same decoder serves every dimension).
127127pub ( crate ) fn coordinate_from_struct ( scalar : & Scalar ) -> VortexResult < Coordinate > {
128128 let fields = scalar. as_struct ( ) ;
@@ -157,7 +157,7 @@ pub(crate) fn coordinate_from_scalar(scalar: &Scalar) -> VortexResult<Coordinate
157157}
158158
159159/// Validated, executed `x`/`y` columns of a point array. The bulk counterpart to [`Coordinate`];
160- /// `z? `/`m? ` are not executed.
160+ /// `z`/`m` are not executed.
161161pub ( crate ) struct ParsedCoordinates {
162162 /// The flat `f64` `x` column.
163163 pub ( crate ) xs : PrimitiveArray ,
@@ -213,7 +213,7 @@ mod tests {
213213 use crate :: extension:: GeoMetadata ;
214214 use crate :: extension:: Point ;
215215
216- /// Display emits WKT, including `z? `/`m? ` when present.
216+ /// Display emits WKT, including `z`/`m` when present.
217217 #[ test]
218218 fn display_is_wkt ( ) {
219219 let coordinate = |z, m| Coordinate {
0 commit comments