ST_MPointFromWKB

Definición

ST_MPointFromText toma una representación binaria conocida (WKB) de tipo ST_MultiPoint y un Id. de referencia espacial, y crea un ST_MultiPoint.

Sintaxis

Oracle

sde.st_mpointfromwkb (wkb blob, srid integer)

PostgreSQL

sde.st_mpointfromwkb (wkb bytea, srid integer)

SQLite

st_mpointfromwkb (wkb blob, srid int32)

Tipo de devolución

ST_MultiPoint

Ejemplo

En este ejemplo se muestra cómo se puede utilizar ST_MPointFromWKB para crear un multipunto desde su representación binaria conocida. La geometría es un multipunto en el sistema de referencia espacial 4326. En este ejemplo, el multipunto se almacena con Id. = 10 en la columna GEOMETRY de la tabla SAMPLE_MPOINTS y, a continuación, la columna WKB se actualiza con su representación binaria conocida (utilizando la función ST_AsBinary). Por último, la función ST_MPointFromWKB se utiliza para devolver el multipunto de la columna WKB. La tabla SAMPLE_MPOINTS una columna GEOMETRY, donde el multipunto se almacena, y una columna de WKB, donde la representación binaria conocida multipunto se almacena.

En la siguiente declaración SELECT, la función ST_MPointFromWKB se usa para recuperar el multipunto desde la columna 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)

Temas relacionados

5/10/2014