ArcGIS Server Banner

ST_MLineFromShape

ST_MLineFromShape

Release 9.3 E-mail This TopicPrintable VersionGive Us feedback

NOTE: Spatial type for PostgreSQL only

Definition

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

Syntax

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 st_geometry, shape bytea);

Add a record to the table.

INSERT INTO sample_mlines (id, geometry) VALUES (
10,
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 = st_asshape (geometry)
WHERE id = 10;

Use ST_MLineFromShape to return the multilinestring information.

SELECT id, st_astext (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 )) 

See Also

  • An overview of SQL functions used with ST_Geometry types