定义
ST_MPointFromText 采用 ST_MultiPoint 类型的熟知二进制 (WKB) 表示和空间参考 ID,并创建 ST_MultiPoint。
语法
Oracle
sde.st_mpointfromwkb (wkb blob, srid integer)
PostgreSQL
sde.st_mpointfromwkb (wkb bytea, srid integer)
SQLite
st_mpointfromwkb (wkb blob, srid int32)
返回类型
ST_MultiPoint
示例
本示例说明了如何使用 ST_MPointFromWKB 从熟知二进制表示创建多线串。几何是空间参考系统 4326 中的多点。在本示例中,多点存储在 SAMPLE_MPOINTS 表的几何列中且 ID = 10,然后利用熟知二进制表示对 WKB 列进行更新(使用 ST_AsBinary 函数)。最后,ST_MPointFromWKB 函数用于从 WKB 列中返回多点。SAMPLE_MPOINTS 表具有一个 GEOMETRY 列(用于存储多点)和一个 WKB 列(用于存储多点的熟知二进制表示)。
在以下 SELECT 语句中,ST_MPointFromWKB 函数用于从 WKB 列中检索多点。
Oracle
CREATE TABLE sample_mpoints (
 id integer,
 geometry sde.st_geometry,
 wkb blob
);
INSERT INTO SAMPLE_MPOINTS (id, geometry) VALUES (
 10,
 sde.st_multipoint ('multipoint (4 14, 35 16, 24 13)', 4326)
);
UPDATE SAMPLE_MPOINTS
 SET wkb = sde.st_asbinary (geometry)
 WHERE id = 10;
SELECT id, sde.st_astext (sde.st_mpointfromwkb (wkb,4326)) MULTI_POINT
 FROM SAMPLE_MPOINTS
 WHERE id = 10;
ID 	  MULTI_POINT 
10    MULTIPOINT (4.00000000 14.00000000, 35.00000000 16.00000000 24.00000000 13.00000000)
PostgreSQL
CREATE TABLE sample_mpoints (
 id integer,
 geometry sde.st_geometry,
 wkb bytea
);
INSERT INTO sample_mpoints (id, geometry) VALUES (
 10,
 sde.st_multipoint ('multipoint (4 14, 35 16, 24 13)', 4326)
);
UPDATE sample_mpoints
 SET wkb = sde.st_asbinary (geometry)
 WHERE id = 10;
SELECT id, sde.st_astext (sde.st_mpointfromwkb (wkb,4326)) 
 AS "MULTI_POINT"
 FROM sample_mpoints
 WHERE id = 10;
id 	  MULTI_POINT 
10     MULTIPOINT (4 14, 35 16, 24 13)
SQLite
CREATE TABLE sample_mpoints (
 id integer,
 wkb blob
);
SELECT AddGeometryColumn (
 NULL,
 'sample_mpoints',
 'geometry',
 4326,
 'multipointzm',
 'xyzm',
 'null'
);
INSERT INTO SAMPLE_MPOINTS (id, geometry) VALUES (
 10,
 st_multipoint ('multipoint (4 14, 35 16, 24 13)', 4326)
);
UPDATE sample_mpoints
 SET wkb = st_asbinary (geometry)
 WHERE id = 10;
SELECT id AS "ID",
 st_astext (st_mpointfromwkb (wkb,4326)) 
 AS "MULTI_POINT"
 FROM sample_mpoints
 WHERE id = 10;
ID 	  MULTI_POINT 
10    MULTIPOINT ( 4.00000000 14.00000000, 35.00000000 16.00000000, 24.00000000 13.00000000)