-
Notifications
You must be signed in to change notification settings - Fork 56
feat(rust/sedona-raster-functions): add RS_Value for spatial 2d rasters #974
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
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
21395fc
feat(rust/sedona-raster-functions): add RS_Value
james-willis 798b67c
chore(rust/sedona-raster-functions): benchmark RS_Value
james-willis 82b7968
fix(rust/sedona-raster-functions): tighten RS_Value point sampling an…
james-willis 62b8973
test(python): inline RS_Example and use assert_query_result for RS_Va…
james-willis d593bb5
feat(rust/sedona-raster-functions): RS_Value empty-point -> NULL, sam…
james-willis a61ec7d
docs(rs_value): use the 3-arg ST_Point(x, y, crs) form in the point e…
james-willis b9722e9
fix(rust/sedona-raster-functions): use checked arithmetic for RS_Valu…
james-willis ee7eaab
feat(rust/sedona-raster-functions): defer RS_Value grid-coordinate va…
james-willis 14e0132
test(rust/sedona-raster-functions): benchmark RS_Value scalar-raster …
james-willis 415357e
perf(rust/sedona-raster-functions): hoist scalar-raster state in RS_V…
james-willis 450d9db
perf(rust/sedona-raster-functions): hoist RS_Value CRS-transform deci…
james-willis 4ea333a
perf(rust/sedona-raster-functions): parse Point coords with a fixed-o…
james-willis e251419
refactor(rust/sedona-raster-functions): dedup RS_Value point sampling…
james-willis b9af45f
perf(rust/sedona-raster-functions): extend RS_Value scalar fast path …
james-willis 9f6c94c
docs(rust/sedona-raster-functions): explain why RS_Value errors inste…
james-willis 67af522
test(rust/sedona-geometry): hoist fixtures import to the test module
james-willis fc95617
Merge remote-tracking branch 'origin/main' into pr-974
james-willis 526e9de
test(python/sedonadb): cross-check RS_Value against rasterio
james-willis 7effb08
style(rust/sedona-geometry): fix rustfmt in wkb_header test
james-willis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| --- | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| title: RS_Value | ||
| description: > | ||
| Returns the value of a single raster pixel as a double, selected by a point | ||
| geometry. Returns null if the location is outside the raster or the pixel | ||
| holds the band's nodata value. | ||
| kernels: | ||
| - returns: float64 | ||
| args: | ||
| - raster | ||
| - name: point | ||
| type: geometry | ||
| description: > | ||
| The pixel that contains this point is sampled (no resampling). | ||
| Reprojected into the raster CRS when both carry one. | ||
| - returns: float64 | ||
| args: | ||
| - raster | ||
| - name: point | ||
| type: geometry | ||
| - name: band | ||
| type: int | ||
| description: Band index (1-based). Defaults to 1 if not specified. | ||
| --- | ||
|
|
||
| ## Description | ||
|
|
||
| `RS_Value` samples one pixel of a raster. The location is given as a point | ||
| geometry — the value of the pixel that contains the point is returned, with no | ||
| interpolation. The band defaults to 1. | ||
|
|
||
| The result is `NULL` when the point falls outside the raster, or when the | ||
| sampled pixel equals the band's nodata value. Only 2-D rasters are supported. | ||
|
|
||
| ## Examples | ||
|
|
||
| ```sql | ||
| SELECT RS_Value(RS_Example(), ST_Point(74.58, 110.57, 'OGC:CRS84')); | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,6 +42,7 @@ test = [ | |
| "polars", | ||
| "pytest", | ||
| "pyyaml", | ||
| "rasterio", | ||
| ] | ||
| geopandas = [ | ||
| "adbc-driver-manager[dbapi]", | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.