ST_MPointFromText function
The ST_MPointFromText function takes a well-known text representation of a multipoint and, optionally, a spatial reference system identifier as input parameters and returns the corresponding multipoint.
If the given well-known text representation is null, then null is returned.
The recommended function for achieving the same result is the ST_MultiPoint function. It is recommended because of its flexibility: ST_MultiPoint takes additional forms of input as well as the well-known text representation.
Syntax
Parameters
- wkt
- A value of type CLOB(2G) that contains the well-known text representation of the resulting multipoint.
- srs_id
- A value of type INTEGER that identifies the spatial reference
system for the resulting multipoint.
If the srs_id parameter is omitted, the spatial reference system with the numeric identifier 0 (zero) is used.
If the specified srs_id does not identify a spatial reference system listed in the catalog view DB2GSE.ST_SPATIAL_REFERENCE_SYSTEMS, then an exception condition is raised (SQLSTATE 38SU1).
Return type
db2gse.ST_MultiPoint
Example
In the following example, the lines of results have been reformatted for readability. The spacing in your results will vary according to your online display.
SET CURRENT FUNCTION PATH = CURRENT FUNCTION PATH, db2gse
CREATE TABLE sample_mpoints (id INTEGER, geometry ST_MultiPoint)
INSERT INTO sample_mpoints
VALUES (1110, ST_MPointFromText ('multipoint (1 2, 4 3, 5 6) )', 1) )
SELECT id, CAST( ST_AsText( geometry ) AS VARCHAR(280) ) MULTIPOINT
FROM sample_mpoints
WHERE id = 1110
ID MULTIPOINT
---------- --------------------------------------------------------------------
1110 MULTIPOINT (1.00000000 2.00000000, 4.00000000 3.00000000,
5.00000000 6.00000000)