名前

ST_GeomFromEWKB — 拡張Well-Known Binary表現 (EWKB)から指定したST_Geometry値を返します。

概要

geometry ST_GeomFromEWKB(bytea EWKB);

説明

Constructs a PostGIS geometry from an Extended Well-Known Binary (EWKB) representation.

[注記]

EWKB書式はOGC標準ではなくPostGIS独特の書式で、空間参照系識別番号 (SRID)を含みます。

Enhanced: 2.0.0 多面体サーフェス対応とTIN対応が導入されました。

この関数は3次元に対応し、Z値を削除しません。

このメソッドは曲線ストリングと曲線に対応しています。

この関数は多面体サーフェスに対応しています。

この関数は三角形と不規則三角網 (TIN)に対応しています。

This example constructs LINESTRING(-71.160281 42.258729,-71.160837 42.259113,-71.161144 42.25932) in NAD83 longitude/latitude (SRID 4269) from its EWKB representation.

PostgreSQL escape string syntax (E'...') always interprets backslash escapes. Each backslash therefore has to be doubled so that the bytea input parser receives the octal escapes.

Code
SELECT ST_GeomFromEWKB((
    E'\\001\\002\\000\\000\\040\\255\\020\\000\\000\\003\\000\\000\\000\\344\\112\\075' ||
    E'\\013\\102\\312\\121\\300\\156\\303\\050\\010\\036\\041\\105\\100\\047\\277\\105' ||
    E'\\047\\113\\312\\121\\300\\366\\173\\142\\235\\052\\041\\105\\100\\225\\174\\354' ||
    E'\\056\\120\\312\\121\\300\\160\\231\\323\\145\\061\\041\\105\\100'
)::bytea);
出力:
0102000020AD10000003000000E44A3D0B42CA51C06EC328081E21454027BF45274BCA51C0F67B629D2A214540957CEC2E50CA51C07099D36531214540
Figure
Geometry figure for visual-st-geomfromewkb-01

With standard_conforming_strings enabled (the default), ordinary string literals preserve backslashes. The same EWKB can therefore be written with a single backslash before each octal byte value.

Code
SELECT ST_GeomFromEWKB((
    '\001\002\000\000\040\255\020\000\000\003\000\000\000\344\112\075' ||
    '\013\102\312\121\300\156\303\050\010\036\041\105\100\047\277\105' ||
    '\047\113\312\121\300\366\173\142\235\052\041\105\100\225\174\354' ||
    '\056\120\312\121\300\160\231\323\145\061\041\105\100'
)::bytea);
出力:
0102000020AD10000003000000E44A3D0B42CA51C06EC328081E21454027BF45274BCA51C0F67B629D2A214540957CEC2E50CA51C07099D36531214540