ST_MLineFromWKB

Definition

ST_MLineFromWKB takes a well-known binary (WKB) representation of type ST_MultiLineString and a spatial reference ID and creates an ST_MultiLineString.

Syntax

Oracle

sde.st_mlinefromwkb (wkb blob, srid integer)

PostgreSQL

sde.st_mlinefromwkb (wkb bytea, srid integer)

Return type

ST_MultiLineString

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.

This example illustrates how ST_MLineFromWKB can be used to create a multilinestring from its well-known binary representation. The geometry is a multilinestring in spatial reference system 1. In this example, the multilinestring is stored with ID = 10 in the geometry column of the sample_mlines table, and the wkb column is updated with its well-known binary representation (using the ST_AsBinary function). Finally, the ST_MLineFromWKB function is used to return the multilinestring from the wkb column. The x- and y-coordinates for this geometry are line 1: (61, 2) (64, 3) (65, 6); line 2: (58, 4) (59, 5) (61, 8); and line 3: (69, 3) (67, 4) (66, 7) (68, 9). The sample_mlines table has a geometry column, where the multilinestring is stored, and a wkb column, where the multilinestring's WKB representation is stored.

Oracle

CREATE TABLE sample_mlines (id integer, geometry sde.st_geometry, wkb blob);

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)
);

UPDATE SAMPLE_MLINES
SET wkb = sde.st_asbinary (geometry)
WHERE id = 10;

PostgreSQL

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

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)
);

UPDATE sample_mlines
SET wkb = sde.st_asbinary (geometry)
WHERE id = 10;

In the following SELECT statement, the ST_MLineFromWKB function is used to retrieve the multilinestring from the wkb column.

Oracle

SELECT id, sde.st_astext (sde.st_mlinefromwkb (wkb,0)) MULTI_LINE_STRING
FROM SAMPLE_MLINES
WHERE id = 10;

ID    MULTI_LINE_STRING

10    MULTILINESTRING ((61.00000000 2.00000000, 64.00000000 3.00000000, 65.00000000 6.00000000), (58.00000000 4.00000000, 59.00000000 5.00000000, 61.00000000 8.0000000), (69.00000000 3.00000000, 67.00000000 4.00000000, 66.00000000 7.00000000, 68.00000000 9.00000000 )) 

PostgreSQL

SELECT id, sde.st_astext (sde.st_mlinefromwkb (wkb,0)) 
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 )) 

2/5/2013