ST_MPointFromShape

NoteNote:

ST_Geometry in PostgreSQL only

Definition

ST_MPointFromShape takes an ESRI Multipoint shape and a spatial reference ID and returns an ST_MultiPoint.

Syntax

sde.st_mpointfromshape (esri_shape bytea, srid integer)

Return type

ST_MultiPoint

Example

In this example, the multipoint is stored with ID = 10 in the geometry column of the mpoints table, then the shape column is updated with a shape representation (using the ST_AsShape function). Finally, the ST_MPointFromShape function is used to return the multipoint from the shape column. The x- and y-coordinates for this geometry are (44, 14) (35, 16) (24, 13). The mpoints table has a geometry column, where the multipoint is stored, and a shape column, where the multipoint's ESRI shape representation is stored.

CREATE TABLE mpoints (id integer, geometry sde.st_geometry, shape bytea);

INSERT INTO mpoints (id, geometry) VALUES (
10,
sde.st_multipoint ('multipoint (4 14, 35 16, 24 13)', 0)
);

UPDATE mpoints
SET shape = sde.st_asshape (geometry)
WHERE id = 10;

In the following SELECT statement, the ST_MPointFromShape function is used to retrieve the multipoint from the shape column.

SELECT id, sde.st_astext (sde.st_mpointFromShape (shape)) 
AS "MULTI_POINT"
FROM mpoints
WHERE id = 10;


id 	  MULTIPOINT 

10         MULTIPOINT (4 14, 35 16, 24 13)

2/5/2013