Skip to content
2 changes: 2 additions & 0 deletions docs/reference/sql/st_npoints.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ kernels:

Returns the total number of coordinate points in the geometry, counting all vertices across all components.

This function also has the alias `ST_NumPoints`.
Comment thread
ajaypadwal73 marked this conversation as resolved.
Outdated

## Examples

```sql
Expand Down
7 changes: 7 additions & 0 deletions rust/sedona-functions/src/st_points.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ pub fn st_npoints_udf() -> SedonaScalarUDF {
ItemCrsKernel::wrap_impl(vec![Arc::new(STNPoints)]),
Volatility::Immutable,
)
.with_aliases(vec!["st_numpoints".to_string()])
}

#[derive(Debug)]
Expand Down Expand Up @@ -296,6 +297,12 @@ mod tests {
assert!(st_npoints_udf.documentation().is_none());
}

#[test]
fn npoints_aliases() {
let udf: ScalarUDF = st_npoints_udf().into();
assert!(udf.aliases().contains(&"st_numpoints".to_string()));
}

#[rstest]
fn udf(#[values(WKB_GEOMETRY, WKB_GEOGRAPHY)] sedona_type: SedonaType) {
use arrow_array::UInt64Array;
Expand Down