ST_MLineFromShape

注意注意:

ST_Geometry in PostgreSQL only

Definition

ST_MLineFromShape takes an ESRI multiline shape and a spatial reference ID and returns an ST_MultiLineString.

Syntax

sde.st_mlinefromshape (esri_shape bytea, srid integer)

Return type

ST_MultiLineString

Example

Create the sample_mlines table with two geometry columns—one an ST_Geometry, the other a bytea—and a unique ID.

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

Add a record to the table.

INSERT INTO sample_mlines (id, geometry) VALUES (
10,
sde.st_multilinestring ('multilinestring ((61 2, 64 3, 65 6), (58 4, 59 5, 61 8), (69 3, 67 4, 66 7, 68 9))', 0)
);

Convert shape to geometry.

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

Use ST_MLineFromShape to return the multilinestring information.

SELECT id, sde.st_astext (sde.st_mlinefromshape (shape)) 
AS MULTI_LINE_STRING
FROM sample_mlines
WHERE id = 10;

id   multi_line_string

10    MULTILINESTRING ((61 2, 64 3, 65 6), (58 4, 59 5,61 8), (69 3, 67 4, 66 7, 68 9 )) 

3/7/2012