<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi<br>
<br>
Thank you all for your answers.<br>
<br>
I haven't been clear enough.<br>
<br>
I am writing a QGIS plugin to use the Postgres 91 plus trigger [0]
to do rollbacks.<br>
<br>
I want to retrieve the geometry and I have access to the it as a
EWKB string. As I am in QGIS (python API), I don't have direct
access to Postgis functions.<br>
<br>
What I need is to cast the string from EWKB to WKB to reconstruct a
QGIS geometry [1]<br>
<br>
Is this possible?<br>
<br>
Thanks again,<br>
<br>
Denis<br>
<br>
[0
<meta http-equiv="content-type" content="text/html;
charset=windows-1252">
]
<meta http-equiv="content-type" content="text/html;
charset=windows-1252">
<a href="http://wiki.postgresql.org/wiki/Audit_trigger_91plus">http://wiki.postgresql.org/wiki/Audit_trigger_91plus</a><br>
[1]
<meta http-equiv="content-type" content="text/html;
charset=windows-1252">
<a
href="http://qgis.org/api/classQgsGeometry.html#a8723d0f5006afb6ea43c1fa1029879d8">http://qgis.org/api/classQgsGeometry.html#a8723d0f5006afb6ea43c1fa1029879d8</a><br>
<br>
<br>
<br>
<br>
<br>
<div class="moz-cite-prefix">On 04/25/2013 02:32 PM, Mike Toews
wrote:<br>
</div>
<blockquote
cite="mid:CAM2FmMojK-e4WOjQPSZ2PJbvPw_=mFBT2zdkgQ=BweLAUQf8VQ@mail.gmail.com"
type="cite">
<pre wrap="">On 26 April 2013 00:15, Worth Lutz <a class="moz-txt-link-rfc2396E" href="mailto:wal3@mindspring.com"><wal3@mindspring.com></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">SELECT ST_AsBinary( ST_GeomFromEWKB(‘01 01000020 04000000
000000000000F03F0000000000000000’));
Just a guess! I haven’t tried it.
</pre>
</blockquote>
<pre wrap="">
It seems I missed the "B", so yes ST_AsBinary is the correct function
to convert to WKB.
<a class="moz-txt-link-freetext" href="http://postgis.org/docs/ST_AsBinary.html">http://postgis.org/docs/ST_AsBinary.html</a>
postgis=# \x
Expanded display is on.
postgis=# SET bytea_output='hex';
SET
postgis=# SELECT ST_AsEWKB(g), ST_AsBinary(g)
postgis-# FROM (SELECT 'SRID=4;POINT(1 0)'::geometry AS g) AS f;
-[ RECORD 1 ]-----------------------------------------------------
st_asewkb | \x010100002004000000000000000000f03f0000000000000000
st_asbinary | \x0101000000000000000000f03f0000000000000000
-Mike
_______________________________________________
postgis-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a>
</pre>
</blockquote>
<br>
</body>
</html>