ST_Square — Returns a single square, using the provided edge size and cell coordinate within the square grid space.
geometry ST_Square(
float8 size, integer cell_i, integer cell_j, geometry origin='POINT(0 0)')
;
Uses the same square tiling concept as ST_SquareGrid, but generates just one square at the desired cell coordinate. Optionally, can adjust origin coordinate of the tiling, the default origin is at 0,0.
Squares are generated with the SRID of the given origin. Use ST_SetSRID to set the SRID if the given origin has an unknown SRID (as is the case by default).
Disponibilidade: 2.1.0
SELECT ST_AsText(ST_SetSRID(ST_Square(1.0, 0, 0), 3857)); POLYGON((0 0,0 1,1 1,1 0,0 0))