ST_PointFromWKB — Faz uma geometria a partir de um WKB com o SRID dado
geometry ST_GeomFromWKB(bytea geom);
geometry ST_GeomFromWKB(bytea geom, integer srid);
A função ST_PointFromWKB, pega uma representação binária bem conhecida de geometria e um sistema de referência espacial ID (SRID) e cria um exemplo do tipo apropriado de geometria - nesse caso, uma geometria PONTO . Essa função cumpre o papel da Fábrica de Geometria SQL.
Se uma SRID não for especificada, leva a 0. NULO é retornado se a entrada bytea não representar uma PONTO geometria.
This method implements the OGC Simple Features Implementation Specification for SQL 1.1. s3.2.7.2
This method implements the SQL/MM specification. SQL-MM 3: 6.1.9
This function supports 3d and will not drop the z-index.
This method supports Circular Strings and Curves.
SELECT
ST_AsText(
ST_PointFromWKB(
ST_AsEWKB('POINT(2 5)'::geometry)
)
);
st_astext
------------
POINT(2 5)
(1 row)
SELECT
ST_AsText(
ST_PointFromWKB(
ST_AsEWKB('LINESTRING(2 5, 2 6)'::geometry)
)
);
st_astext
-----------
(1 row)