Skip to content
πŸŽ‰ SedonaDB 0.4.0 is out now! πŸ—ΊοΈ Python DataFrame API, R dplyr, Geography support & GPU-accelerated spatial joins. Read the release blog β†’

ST_AsText

Introduction: Return the BOX(xmin ymin, xmax ymax) text representation of a Box2D value. The format matches PostGIS's text representation of the box2d type and is intended for display and round-tripping with PostGIS-compatible tooling β€” not as a parseable round-trip into Sedona (use ST_MakeBox2D for that).

This is the Box2D overload of ST_AsText; the Geometry variant emits standard WKT.

Format: ST_AsText(box: Box2D)

Return type: String

Since: v1.9.1

SQL Example

SELECT ST_AsText(ST_MakeBox2D(ST_Point(0.0, 0.0), ST_Point(10.0, 20.0)))

Output:

BOX(0.0 0.0, 10.0 20.0)

Returns NULL on NULL input.