This function returns the coordinate range of a raster object. The return value is a box object of PostgreSQL in the format of '((minX,minY),(maxX,maxY))'.

Syntax

BOX ST_Extent(raster raster_obj,CoorSpatialOption csOption = 'WorldFirst')

Parameters

Parameter Description
raster_obj The raster object.
CoorSpatialOption The coordinate type.

Description

The CoorSpatialOption parameter specifies the coordinate type. Valid values:

  • Raster: indicates the raster space. If this value is used, the function returns pixel coordinates.
  • World: indicates the world space. If this value is used, the function returns world coordinates.
  • WorldFirst: indicates that the world space takes precedence. If the raster object is geographically referenced, the function returns world coordinates. If the raster object is not geographically referenced, the function returns pixel coordinates.

Examples

select ST_Extent(raster_obj, 'Raster') from raster_table;

__________________________________
((0,0),(255,255))