<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">G’day all,<div><br></div><div>I’ve been using pgsql2shp to create shape files for a client by creating a table which contains global level 1 administrative boundaries (3670 records). When I connect to the db, I can see this many records and display the appropriate geometries. </div><div><br></div><div><font face="Courier New">select ccode, admin1, mapcode, st_mem_size(geom), st_isvalidreason(geom) from polbnda2013 where ccode like 'ZWE' ORDER BY 1,2;<br> ccode | admin1 | mapcode | st_mem_size | st_isvalidreason <br>-------+---------------------+---------+-------------+------------------<br> ZWE | BULAWAYO | 3230 | 2496 | Valid Geometry<br> ZWE | HARARE | 3231 | 3264 | Valid Geometry<br> ZWE | MANICALAND | 3232 | 108992 | Valid Geometry<br> ZWE | MASHONALAND CENTRAL | 3233 | 63616 | Valid Geometry<br> ZWE | MASHONALAND EAST | 3234 | 34080 | Valid Geometry<br> ZWE | MASHONALAND WEST | 3235 | 24432 | Valid Geometry<br> ZWE | MASVINGO | 3236 | 29840 | Valid Geometry<br> ZWE | MATABELELAND NORTH | 3237 | 28832 | Valid Geometry<br> ZWE | MATABELELAND SOUTH | 3238 | 69792 | Valid Geometry<br> ZWE | MIDLANDS | 3239 | 31296 | Valid Geometry<br>(10 rows)<br></font><br></div><div><br></div><div>When I run </div><div><br></div><div><font face="Courier New">pgsql2shp -b -p 5432 -f outputs/2013/polbnda2013 -g geom -u ben -P noway oiemaps outputs.polbnda2013 </font></div><div><font face="Courier New">Initializing... </font></div><div><font face="Courier New">Done (postgis major version: 2).<br>Output shape: Polygon<br>Dumping: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX [3665 rows].<br></font><br><br>The five rows missing are the last five rows in the table (Zimbabwe…). </div><div><br></div><div>Ahh you say - an error in the data for Zimbabwe! But, if I just export Zimbabwe :</div><div><br></div><div><div><font face="Courier New">pgsql2shp -b -r -p 5432 -f outputs/2013/polbnda2013 -g geom -u ben -P caitlin oiemaps "SELECT * FROM polbnda2013 WHERE ccode LIKE 'ZWE' ORDER BY ccode, admin1"</font></div><div><font face="Courier New">Initializing... </font></div><div><font face="Courier New">Done (postgis major version: 2).</font></div><div><font face="Courier New">Output shape: Polygon</font></div><div><font face="Courier New">Dumping: X [10 rows].</font></div></div><div><br></div><div><br></div><div>Due to the resolution I’m looking at about a 130MB output file, so I won’t email it in here, but the batch processing is being done on an AWS EC2 server running Ubuntu 12.04LTS (This is the third server I have tried running it on)<br><div apple-content-edited="true"><br></div><div apple-content-edited="true"> PostgreSQL 9.3.2 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3, 64-bit<br> POSTGIS="2.1.0 r11822" GEOS="3.3.3-CAPI-1.7.4" PROJ="Rel. 4.7.1, 23 September 2009" GDAL="GDAL 1.9.0, released 2011/12/29" LIBXML="2.7.8" LIBJSON="UNKNOWN" RASTER</div><div apple-content-edited="true"><br></div><div apple-content-edited="true"><br></div><div apple-content-edited="true">Has anyone seen anything similar, any ideas where I can start. </div><div apple-content-edited="true"><br></div><div apple-content-edited="true">cheers</div><div apple-content-edited="true"><br></div><div apple-content-edited="true">Ben</div><div apple-content-edited="true"><br></div><div apple-content-edited="true"><br></div><div apple-content-edited="true"><br></div><div apple-content-edited="true"><br>-- <br><br>Ben Madin<br><br>t : +61 8 6102 5535<br>m : +61 448 887 220<br>e : <a href="mailto:ben@ausvet.com.au">ben@ausvet.com.au</a><br><br>AusVet Animal Health Services<br>Western Australia<br><br>AusVet's website: <a href="http://www.ausvet.com.au">http://www.ausvet.com.au</a><br><br>This transmission is for the intended addressee only and is confidential information. If you have received this transmission in error, please delete it and notify the sender. The contents of this email are the opinion of the writer only and are not endorsed by AusVet Animal Health Services unless expressly stated otherwise. Although AusVet uses virus scanning software we do not accept liability for viruses or similar in any attachments. Thanks for reading.<br></div><br></div></body></html>