<html><head></head><body><div style="color:#000; background-color:#fff; font-family:verdana, helvetica, sans-serif;font-size:16px"><div id="yui_3_16_0_ym19_1_1476477964343_30119"><span></span></div><div class="qtdSeparateBR" id="yui_3_16_0_ym19_1_1476477964343_30120"><div id="yui_3_16_0_ym19_1_1476477964343_30348">Hey Ben...</div><div id="yui_3_16_0_ym19_1_1476477964343_30347"><br></div><div id="yui_3_16_0_ym19_1_1476477964343_30349">Long time!</div><div id="yui_3_16_0_ym19_1_1476477964343_30257"><br></div><div id="yui_3_16_0_ym19_1_1476477964343_30455">In the absence of a more elegant approach...<br></div><div id="yui_3_16_0_ym19_1_1476477964343_30449"><br></div><div id="yui_3_16_0_ym19_1_1476477964343_30255">You could try the FDW query going via WKT rather than WKB - so deconstruct then reconstruct?</div><div id="yui_3_16_0_ym19_1_1476477964343_30286"><br></div><div id="yui_3_16_0_ym19_1_1476477964343_30350">Minor overhead for a one-off transfer, perhaps more of an issue for a working query.</div><div id="yui_3_16_0_ym19_1_1476477964343_30351"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1476477964343_30352">I use both fdw & OGR virtual data source to access data from Specify (MySQL) in QGIS. Both work fine. Different sorts of issues with each. So fdw is not just used for data transfers :-)</div><div dir="ltr" id="yui_3_16_0_ym19_1_1476477964343_30439"><br></div><div dir="ltr" id="yui_3_16_0_ym19_1_1476477964343_30473">Cheers,</div><div dir="ltr"><br></div><div dir="ltr">  Brent<br></div><br></div><div class="yahoo_quoted" id="yui_3_16_0_ym19_1_1476477964343_30126" style="display: block;">  <div style="font-family: verdana, helvetica, sans-serif; font-size: 16px;" id="yui_3_16_0_ym19_1_1476477964343_30125"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_ym19_1_1476477964343_30124"> <div dir="ltr" id="yui_3_16_0_ym19_1_1476477964343_30123"> <font id="yui_3_16_0_ym19_1_1476477964343_30122" size="2" face="Arial"> <hr id="yui_3_16_0_ym19_1_1476477964343_30121" size="1"> <b><span style="font-weight:bold;">From:</span></b> Ben Madin <ben@ausvet.com.au><br> <b id="yui_3_16_0_ym19_1_1476477964343_30254"><span style="font-weight: bold;" id="yui_3_16_0_ym19_1_1476477964343_30253">To:</span></b> PostGIS Users Discussion <postgis-users@lists.osgeo.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Saturday, October 15, 2016 1:03 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> [postgis-users] Problem extracting SQL Server Geometry (or,       what is the 0x character?)<br> </font> </div> <div class="y_msg_container" id="yui_3_16_0_ym19_1_1476477964343_30475"><br><div id="yiv0962819995"><div dir="ltr" id="yui_3_16_0_ym19_1_1476477964343_30476">G'day all,<div id="yui_3_16_0_ym19_1_1476477964343_30477"><br></div><div id="yui_3_16_0_ym19_1_1476477964343_30478">I hope a simple case of something I've missed, but we are trying to extract data from a SQL Server database into PostGIS use tds_fdw... the data in SQL Server appears to be in WKB - but when when connect to this field we have a precursor 0x. I can't find any references to anyone else suffering this problem, but that could be because I'm trying a lazy approach to automate retrieval of hundreds of tables using the FDW (that's what it is for, right?)</div><div><br></div><div>I'm left with a sense that it is an encoding error between the two systems? I've tried making the fdw column text instead of geometry, but I can't get rid of the 0x, and no amount of trying to cajole the text to any other form makes it any happier. </div><div><br></div><div>To complicate it, for testing I'm going from SQL Server 2014 (running in Windows 8.1 in a VM) to PostgreSQL 9.4 on a Mac (El Capitan) using tds_fdw compiled on the same mac. POSTGIS="2.2.2 r14797" GEOS="3.5.0-CAPI-1.9.0 r0" PROJ="Rel. 4.9.2, 08 September 2015" GDAL="GDAL 2.1.1, released 2016/07/07" LIBXML="2.7.8" LIBJSON="0.12.1" RASTER</div><div><br></div><div>Any ideas gratefully received? </div><div><br></div><div>cheers</div><div><br></div><div>Ben</div><div><br></div><div><br></div><div><br></div><div><br clear="all"><div><br></div><div class="yiv0962819995gmail_signature"><div dir="ltr"><div dir="ltr"><div>m : +61 448 887 220</div><div><br></div><div>e : <a rel="nofollow" ymailto="mailto:ben@ausvet.com.au" target="_blank" href="mailto:ben@ausvet.com.au">ben@ausvet.com.au</a></div><div><br></div><div>10 High Street, Fremantle</div><div>Western Australia</div><div><br></div><div>on the web: <a rel="nofollow" target="_blank" href="http://www.ausvet.com.au/">www.ausvet.com.au</a><br></div><div><br></div><div><br></div><div>This transmission is for the intended for a mailing list and is clearly never going to be confidential information. If you have received this transmission in error, apologies! The contents of this email are the likely ill-educated opinion of the writer only and are not endorsed by Ausvet unless expressly stated otherwise. Thanks for reading. An even bigger thanks for any help you can provide.</div></div></div></div>
</div></div></div><br>_______________________________________________<br>postgis-users mailing list<br><a ymailto="mailto:postgis-users@lists.osgeo.org" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/postgis-users</a><br><br></div> </div> </div>  </div></div></body></html>