jesspav opened a new pull request, #416:
URL: https://github.com/apache/sedona-db/pull/416

   Adding functions `RS_WorldToRasterCoordX`, `RS_WorldToRasterCoordY`, 
`RS_WorldToRasterCoord`, with a provided x and y coordinate.
   
   Note that we should have another variant of these that accept a point, but 
it is out of scope for this PR. 
   
   Examples:
   ```
   > select rs_worldtorastercoord(RS_Example(), 45.08, 80.07 );
   ┌───────────────────────────────────────────────────────────────────┐
   │ rs_worldtorastercoord(rs_example(),Float64(45.08),Float64(80.07)) │
   │                              geometry                             │
   ╞═══════════════════════════════════════════════════════════════════╡
   │ POINT(1 0)                                                        │
   └───────────────────────────────────────────────────────────────────┘
   
   1 row(s)/1 column(s) fetched. 
   Elapsed 0.023 seconds.
   
   > select rs_worldtorastercoordx(RS_Example(), 45.08, 80.07 );
   ┌────────────────────────────────────────────────────────────────────┐
   │ rs_worldtorastercoordx(rs_example(),Float64(45.08),Float64(80.07)) │
   │                                int64                               │
   ╞════════════════════════════════════════════════════════════════════╡
   │                                                                  1 │
   └────────────────────────────────────────────────────────────────────┘
   
   1 row(s)/1 column(s) fetched. 
   Elapsed 0.007 seconds.
   
   > select rs_worldtorastercoordy(RS_Example(), 45.08, 80.07 );
   ┌────────────────────────────────────────────────────────────────────┐
   │ rs_worldtorastercoordy(rs_example(),Float64(45.08),Float64(80.07)) │
   │                                int64                               │
   ╞════════════════════════════════════════════════════════════════════╡
   │                                                                  0 │
   └────────────────────────────────────────────────────────────────────┘
   
   1 row(s)/1 column(s) fetched. 
   Elapsed 0.006 seconds.
   ```
   
   Benches:
   ```
   native-raster-rs_worldtorastercoord-ArrayScalarScalar(Raster(64, 64), 
Float64(-45.0, 45.0), Float64(...
                           time:   [1.3438 ms 1.3456 ms 1.3473 ms]
   
   native-raster-rs_worldtorastercoordx-ArrayScalarScalar(Raster(64, 64), 
Float64(-45.0, 45.0), Float64...
                           time:   [1.1348 ms 1.1367 ms 1.1386 ms]
   
   native-raster-rs_worldtorastercoordy-ArrayScalarScalar(Raster(64, 64), 
Float64(-45.0, 45.0), Float64...
                           time:   [1.1326 ms 1.1344 ms 1.1361 ms]
   
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to