<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">body { font-family:'Times New Roman'; font-size:13px}</style>
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div>I replaced the shapefile load script dropping ogr2ogr in favor of shp2pgshp.</div><div><br></div><div>This appears to have given me clean multipolygons as nothing was reported by the following:</div><div><br></div><div><font face="'Courier New',monospace">select ST_ISValidReason(a.geog4326::geometry) <br>  from data.osm_county as a <br> where ST_IsValidReason(a.geog4326::geometry) <> 'Valid Geometry'</font></div><div><br></div><div>I discovered though this process that the original shapefile had 10 counties that were duplicated.</div><div>I used postgresql to delete the duplicates.</div><div><br></div><div>All my SQL appears to be working.</div><div><br></div><div>Perhaps Martin is right: there is something wrong with the ogr2ogr load (though I switched from -nlt POLYGON to -nlt PROMOTE_TO_MULTI and it didn't make any difference).</div><div><br></div><div>I think this request for help can now be closed.</div><div><br></div><div>Thanks to all.</div><div><br></div><div>regards</div><div>Simon</div><div><br></div><div><br></div><div><br></div><blockquote style="margin: 0 0 0.80ex; border-left: #0000FF 2px solid; padding-left: 1ex">Just ’select geom’ will return the extended hexwkb (which we should have JTS support as a matter of convenience). If you need pure standard hex wkb, then<div class=""><br class=""></div><div class="">select encode(st_asbinary(geom), ‘hex’) </div><div class=""><br class=""></div><div class="">will do that</div><div class=""><br class=""></div><div class="">P<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jan 21, 2019, at 2:39 PM, Martin Davis <<a href="mailto:mtnclimb@gmail.com" class="">mtnclimb@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Not much help, I'm afraid.   I need the geometry in WKBHex.  Not sure offhand how to get that out of PostGIS.<div class=""><br class=""></div><div class="">Just post the WKT and let's see what that looks like.</div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 21, 2019 at 1:52 PM Simon Greener <<a href="mailto:simon@spatialdbadvisor.com" class="">simon@spatialdbadvisor.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">


<div class=""><div class="">Try here for an example:</div><div class=""><br class=""></div><div class=""><a href="https://www.dropbox.com/s/n234bc6i5hj7y4o/Ireland.sql?dl=0" target="_blank" class="">https://www.dropbox.com/s/n234bc6i5hj7y4o/Ireland.sql?dl=0</a></div></div></blockquote></div>
_______________________________________________<br class="">postgis-users mailing list<br class=""><a href="mailto:postgis-users@lists.osgeo.org" class="">postgis-users@lists.osgeo.org</a><br class="">https://lists.osgeo.org/mailman/listinfo/postgis-users</div></blockquote></div><br class=""></div></blockquote><br><br><br><div id="M2Signature"><div>-- </div><div><div>Regards<br></div><div><font face="Kunstler Script"><big><big><big><big>Simon</big></big></big></big></font><em><strong><br></strong></em></div><div><em><strong>--------------------------------------------------------------------------------------------------------<br></strong></em></div><div><em><strong>Spatial Advice & Solutions Architecture<br>Database Spatial Stored Procedure Designer</strong></em><br>Oracle Spatial, SQL Server, PostGIS, MySQL, ArcSDE FME<br>Awarded "2011 Oracle Spatial Excellence Award for Education and Research"<br>A: 39 Cliff View Drive, Allens Rivulet, 7150, Tas, Aust<br>W: www.spdba.com.au<br>E: simon@spdba.com.au<br>V: +61 <strong>362 396 397</strong><br>M: +61 <strong>418 396 391</strong><br>GITC Supplier: T1005<br>Skype: sggreener<br>Long: 147.20515 (147° 12' 18" E)<br>Lat: -43.01530 (43° 00' 55" S)<br>GeoHash: r22em9r98wg<br>NAC:W80CK 7SWP3</div></div></div></body></html>