ST_PointFromWKB
Prev | 8.8.2. Well-Known Binary (WKB) | Next

## Name

ST_PointFromWKB — Makes a geometry from WKB with the given SRID

## Synopsis

`geometry ST_GeomFromWKB(`bytea geom`)`;

`geometry ST_GeomFromWKB(`bytea geom, integer srid`)`;

## Description

The `ST_PointFromWKB` function, takes a well-known binary representation of geometry and a Spatial Reference System ID (`SRID`) and creates an instance of the appropriate geometry type - in this case, a `POINT` geometry. This function plays the role of the Geometry Factory in SQL.

If an SRID is not specified, it defaults to 0. `NULL` is returned if the input `bytea` does not represent a `POINT` geometry.

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

## Examples

    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)

## See Also

ST_GeomFromWKB, ST_LineFromWKB

Prev | Up | Next
ST_LinestringFromWKB | Home | ST_WKBToSQL