ST_PointFromShape

NoteNote:

ST_Geometry in PostgreSQL only

Definition

ST_PointFromShape takes an ESRI point shape and a spatial reference ID and returns a point.

Syntax

sde.st_pointfromshape (esri_shape bytea, srid integer)

Return type

ST_Point

Example

In this example, the points are stored in the geometry column of the pts table, and the shape column is updated with their shape representations (using the ST_AsShape function). Finally, the ST_PointFromShape function is used to return the points from the shape column. The pts table has a geometry column, where the points are stored, and a shape column, where the points' shape representations are stored.

CREATE TABLE pts (id integer, geometry sde.st_point, shape bytea);

INSERT INTO pts (id, geometry) VALUES (
10,
sde.st_point ('point (44 14)', 0)
);

INSERT INTO pts (id, geometry) VALUES (
11,
sde.st_point ('point (24 13)', 0)
);

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

UPDATE pts
SET shape = sde.st_asshape (geometry)
WHERE id = 11;

In the following SELECT statement, the ST_PointFromShape function is used to retrieve the points from the shape column.

SELECT id, sde.st_astext (sde.st_pointfromshape(shape, 0)) 
AS points
FROM pts;

id	points

10	POINT (44 14)
11	POINT (24 13)

2/5/2013