| 353 | |
| 354 | ---- |
| 355 | == '''Objective 0.1.6i - Being able to easily convert world coordinates to raster coordinates.''' == |
| 356 | |
| 357 | '''ST_World2RasterCoordX(rast raster, xw float8, yw float8)'''[[BR]] |
| 358 | Returns the column number of the pixel covering the provided X and Y world coordinates. |
| 359 | This function works even if the world coordinates are outside the raster extent. |
| 360 | |
| 361 | '''ST_World2RasteCoordX(rast raster, xw float8)'''[[BR]] |
| 362 | Returns the column number of the pixels covering the provided world X coordinate for a non-rotated raster. |
| 363 | This function works even if the world coordinate is outside the raster extent. |
| 364 | This function returns an error if the raster is rotated. In this case you must also provide a Y. |
| 365 | |
| 366 | '''ST_World2RasterCoordX(rast raster, pt geometry)'''[[BR]] |
| 367 | Returns the column number of the pixel covering the provided point geometry. |
| 368 | This function works even if the point is outside the raster extent. |
| 369 | |
| 370 | '''ST_World2RasterCoordY(rast raster, xw float8, yw float8)'''[[BR]] |
| 371 | Returns the row number of the pixel covering the provided X and Y world coordinates. |
| 372 | This function works even if the world coordinates are outside the raster extent. |
| 373 | |
| 374 | '''ST_World2RasterCoordY(rast raster, yw float8)'''[[BR]] |
| 375 | Returns the row number of the pixels covering the provided world Y coordinate for a non-rotated raster. |
| 376 | This function works even if the world coordinate is outside the raster extent. |
| 377 | This function returns an error if the raster is rotated. In this case you must also provide an X. |
| 378 | |
| 379 | '''ST_World2RasterCoordY(rast raster, pt geometry)'''[[BR]] |
| 380 | Returns the row number of the pixel covering the provided point geometry. |
| 381 | This function works even if the point is outside the raster extent. |
| 382 | |
| 383 | '''ST_Raster2WorldCoordX(rast raster, xr int, yr int)'''[[BR]] |
| 384 | Returns the X world coordinate of the upper left corner of the pixel located at the provided column and row numbers. |
| 385 | This function works even if the provided raster column and row are beyond or below the raster width and height. |
| 386 | |
| 387 | |
| 388 | '''ST_Raster2WorldCoordX(rast raster, xr int)'''[[BR]] |
| 389 | Returns the X world coordinate of the upper left corner of the pixel located at the provided column number for a non-rotated raster. |
| 390 | This function works even if the provided raster column is beyond or below the raster width. |
| 391 | This function returns an error if the raster is rotated. In this case you must also provide a Y. |
| 392 | |
| 393 | '''ST_Raster2WorldCoordY(rast raster, xr int, yr int)'''[[BR]] |
| 394 | Returns the Y world coordinate of the upper left corner of the pixel located at |
| 395 | the provided column and row numbers. |
| 396 | This function works even if the provided raster column and row are beyond or below the raster width and height. |
| 397 | |
| 398 | '''ST_Raster2WorldCoordY(rast raster, yr int)'''[[BR]] |
| 399 | Returns the Y world coordinate of the upper left corner of the pixel located at the provided row number for a non-rotated raster. |
| 400 | This function works even if the provided raster row is beyond or below the raster height. |
| 401 | This function returns an error if the raster is rotated. In this case you must |
| 402 | also provide an X. |