Creates an axis-aligned rectangle from two points representing the lower-left and upper-right corners.
SyntaxNEW ST_Polygon(pmin,pmax)
Parameters| Name | Type | Description |
|---|---|---|
|
pmin |
ST_Point |
A point that is the lower-left corner of the rectangle. |
|
pmax |
ST_Point |
A point that is the upper-right corner of the rectangle. |
RemarksReturns a rectangle defined as the envelope of two points.
The constructor is equivalent to the following: NEW ST_MultiPoint( pmin, pmax ).ST_Envelope()
If the input points do not specify the corresponding corners of a rectangle, the server will determine the correct containing rectangle for the specified points.
If input points are in a round-Earth spatial reference system, the produced polygon will not be an axis-aligned rectangle. The eastern and western boundaries will coincide with the meridians between the eastern and western point pairs, respectively, while the northern and southern edges will not coincide with the parallels and will rather follow great elliptical arches containing the edge end points. Additionally, the server will always generate a valid polygon, if possible. If such a valid polygon crosses the date line, longitude of the western points will be higher than that of the eastern points, counter to the relationship for polygons not crossing the date line.
By default, ST_Polygon uses the original format for a geometry, if it is available. Otherwise, the internal format is used. For more information about internal and original formats, see STORAGE FORMAT clause, CREATE SPATIAL REFERENCE SYSTEM statement.
Standards and compatibilitySQL/MM (ISO/IEC 13249-3: 2006) Vendor extension
ExampleThe following returns Polygon ((0 0, 4 0, 4 10, 0 10, 0 0)).
SELECT NEW ST_Polygon(NEW ST_Point(0.0, 0.0), NEW ST_Point(4.0, 10.0)) |
![]() |
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |
