Skip to content

Commit 0a3088b

Browse files
committed
feat(raster): add RS_PixelAsPoint, RS_PixelAsCentroid, and RS_PixelAsPolygon UDFs
1 parent 301086f commit 0a3088b

5 files changed

Lines changed: 573 additions & 1 deletion

File tree

rust/sedona-raster-functions/benches/native-raster-functions.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,28 @@ fn criterion_benchmark(c: &mut Criterion) {
3333
);
3434
benchmark::scalar(c, &f, "native-raster", "rs_height", Raster(64, 64));
3535
benchmark::scalar(c, &f, "native-raster", "rs_numbands", Raster(64, 64));
36+
// RS_PixelAsPoint, RS_PixelAsCentroid, RS_PixelAsPolygon
37+
benchmark::scalar(
38+
c,
39+
&f,
40+
"native-raster",
41+
"rs_pixelaspoint",
42+
BenchmarkArgs::ArrayScalarScalar(Raster(64, 64), Int32(1, 64), Int32(1, 64)),
43+
);
44+
benchmark::scalar(
45+
c,
46+
&f,
47+
"native-raster",
48+
"rs_pixelascentroid",
49+
BenchmarkArgs::ArrayScalarScalar(Raster(64, 64), Int32(1, 64), Int32(1, 64)),
50+
);
51+
benchmark::scalar(
52+
c,
53+
&f,
54+
"native-raster",
55+
"rs_pixelaspolygon",
56+
BenchmarkArgs::ArrayScalarScalar(Raster(64, 64), Int32(1, 64), Int32(1, 64)),
57+
);
3658
benchmark::scalar(
3759
c,
3860
&f,

rust/sedona-raster-functions/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ pub mod rs_example;
2323
pub mod rs_georeference;
2424
pub mod rs_geotransform;
2525
pub mod rs_numbands;
26+
pub mod rs_pixel_functions;
2627
pub mod rs_rastercoordinate;
2728
pub mod rs_setsrid;
2829
pub mod rs_size;

rust/sedona-raster-functions/src/register.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ pub fn default_function_set() -> FunctionSet {
5050
crate::rs_geotransform::rs_upperleftx_udf,
5151
crate::rs_geotransform::rs_upperlefty_udf,
5252
crate::rs_numbands::rs_numbands_udf,
53+
crate::rs_pixel_functions::rs_pixelaspoint_udf,
54+
crate::rs_pixel_functions::rs_pixelascentroid_udf,
55+
crate::rs_pixel_functions::rs_pixelaspolygon_udf,
5356
crate::rs_rastercoordinate::rs_worldtorastercoord_udf,
5457
crate::rs_rastercoordinate::rs_worldtorastercoordx_udf,
5558
crate::rs_rastercoordinate::rs_worldtorastercoordy_udf,

0 commit comments

Comments
 (0)