ST_LineFromWKB

Definition

Mit ST_LineFromWKB wird anhand eines Well-known Binary-Formats (WKB) vom Typ ST_LineString und einer Raumbezugs-ID ein ST_LineString-Objekt zurückgegeben.

Syntax

Oracle

sde.st_linefromwkb (wkb blob, srid integer)

PostgreSQL

sde.st_linefromwkb (wkb bytea, srid integer)

Rückgabetyp

ST_LineString

Beispiel

Im folgenden Beispiel wurden die Zeilen der Ergebnisse zur besseren Lesbarkeit neu formatiert. Die Abstände der Ihnen angezeigten Ergebnisse können abhängig von Ihrer Online-Darstellung variieren. Im folgenden Code wird die ST_LineFromWKB-Funktion verwendet, um eine Zeile aus einer WKB-Repräsentation zu erstellen und einzufügen. Die Zeile wird in die Tabelle "sample_lines" mit einer ID und einer Linie im Raumbezugssystem 1 im WKB-Format eingefügt.

Oracle

CREATE TABLE sample_lines (id smallint, geometry sde.st_linestring, wkb blob);

INSERT INTO SAMPLE_LINES (id, geometry) VALUES (
1901,
sde.st_linestring ('linestring (850 250, 850 850)', 0)
);

INSERT INTO SAMPLE_LINES (id, geometry) VALUES (
1902,
sde.st_linestring ('linestring (33 2, 34 3, 35 6)', 0)
);

UPDATE SAMPLE_LINES
SET wkb = sde.st_asbinary (geometry)
WHERE id = 1901;

UPDATE SAMPLE_LINES
SET wkb = sde.st_asbinary (geometry)
WHERE id = 1902;

SELECT id, sde.st_astext (sde.st_linefromwkb (wkb,0)) LINE
FROM SAMPLE_LINES;

ID   LINE 

1901 LINESTRING (850.00000000 250.00000000, 850.00000000 850.00000000) 
1902 LINESTRING (33.00000000 2.00000000, 34.00000000 3.00000000, 35.00000000 6.00000000)

PostgreSQL

CREATE TABLE sample_lines (id integer, geometry sde.st_linestring, wkb bytea);

INSERT INTO sample_lines (id, geometry) VALUES (
1901,
sde.st_linestring ('linestring (850 250, 850 850)', 0)
);

INSERT INTO sample_lines (id, geometry) VALUES (
1902,
sde.st_linestring ('linestring (33 2, 34 3, 35 6)', 0)
);

UPDATE sample_lines
SET wkb = sde.st_asbinary (geometry)
WHERE id = 1901;

UPDATE sample_lines
SET wkb = sde.st_asbinary (geometry)
WHERE id = 1902;

SELECT id, sde.st_astext (st_linefromwkb (wkb,0)) 
AS LINE
FROM sample_lines;

id   line 

1901 LINESTRING (850 250, 850 850) 
1902 LINESTRING (33 2, 34 3, 35 6)

3/6/2012