PostGISGeometry Input

ST_PointFromWKB

What is ST_PointFromWKB?

ST_PointFromWKB parses a WKB byte string and returns a POINT geometry. Non-Point WKB raises an error.

SQL
1ST_PointFromWKB(bytea wkb)geometry
2ST_PointFromWKB(bytea wkb, integer srid)geometry

When would you use ST_PointFromWKB?

Use ST_PointFromWKB in typed ingest streams for Points — GPS coordinates, geocoded addresses, sensor readings. It validates that each binary row really is a Point, failing fast on schema drift.

For building points from numeric X/Y, prefer ST_MakePoint since it avoids binary parsing overhead.

FAQs

What if the WKB is a MultiPoint?

An error. Use ST_GeomFromWKB for polymorphic inputs, or ST_MPointFromWKB for MultiPoints.

Is SRID required?

No. Without an explicit SRID argument or embedded EWKB SRID, the result is SRID 0.

Is it faster than ST_PointFromText?

Yes. Binary parsing avoids text tokenising and float conversion overhead.

What Z/M ordinates are preserved?

All — if the WKB encodes Z or M ordinates, they are preserved in the output.