跳转至
🎉 SedonaDB 0.4.0 已正式发布!🗺️ 新增 Python DataFrame API、R dplyr 接口、Geography 支持及 GPU 加速空间连接。阅读发布博客 →

RS_WorldToRasterCoordY

Introduction: Returns the Y coordinate of the grid coordinate of the given world coordinates as an integer.

RS_WorldToRasterCoordY

Format:

RS_WorldToRasterCoordY(raster: Raster, point: Geometry)

RS_WorldToRasterCoordY(raster: Raster, x: Double, y: Double)

Return type: Integer

Since: v1.5.0

SQL Example

SELECT RS_WorldToRasterCoordY(ST_MakeEmptyRaster(1, 5, 5, -53, 51, 1, -1, 0, 0), ST_GeomFromText('POINT (-50 50)'));

Output:

2

SQL Example

SELECT RS_WorldToRasterCoordY(ST_MakeEmptyRaster(1, 5, 5, -53, 51, 1, -1, 0, 0), -50, 49);

Output:

3

Tip

For non-skewed rasters, you can provide any value for longitude and the intended value of world latitude, to get the desired answer