Changes between Version 1 and Version 2 of FAQ


Ignore:
Timestamp:
04/17/09 16:06:47 (16 years ago)
Author:
mloskot
Comment:

FAQ: How to create geometry from hex-encoded WKB using SQL?

Legend:

Unmodified
Added
Removed
Modified
  • FAQ

    v1 v2  
    11= PostGIS FAQ =
     2
     3Frequently Asked Questions about PostGIS extension.
     4
     5== How to create geometry from hex-encoded WKB using SQL? ==
     6
     7This is two-steps operation which can be executed in single SQL statement. The steps include:
     8 1. Convert WKB data in hexadecimal form to raw binary using PostgreSQL function [http://www.postgresql.org/docs/8.3/static/functions-binarystring.html decode].
     9 2. Construct geometry object from WKB in raw binary form.
     10
     11Example:
     12
     13{{{
     14!sql
     15=# SELECT ST_AsText(ST_GeomFromWKB(decode('0101000000e5d022dbf93e2e40dbf97e6abc743540', 'hex'), 4326));
     16      st_astext       
     17----------------------
     18 POINT(15.123 21.456)
     19}}}