james-willis commented on code in PR #974: URL: https://github.com/apache/sedona-db/pull/974#discussion_r3462003720
########## docs/reference/sql/rs_value.qmd: ########## @@ -0,0 +1,85 @@ +--- +# 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 either by a + point geometry or by 1-based grid coordinates. 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. + - returns: float64 + args: + - raster + - name: colX + type: int + description: Column index (1-based). + - name: rowY + type: int + description: Row index (1-based). + - returns: float64 + args: + - raster + - name: colX + type: int + - name: rowY + type: int + - 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 either as a +point geometry — the value of the pixel that contains the point is returned, with +no interpolation — or as 1-based `(colX, rowY)` grid coordinates. The band +defaults to 1. + +The result is `NULL` when the point or grid cell 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(), 2, 1); +``` + +```sql +SELECT RS_Value(RS_Example(), 2, 1, 2); +``` + +```sql +SELECT RS_Value(RS_Example(), ST_SetCRS(ST_Point(74.58, 110.57), 'OGC:CRS84')); Review Comment: done -- 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]
