Changes

PostGIS function pgsql2shp

121 bytes added, 13:22, 11 September 2018
no edit summary
The mandatory column to include in the export is called ''shape''
</div>
<ol># <li> Create a SQL view or use one of the existing GIS views# <li> Open the command / DOS prompt# <li> Go to ''C:\IMSMAng\pgsql\bin''# <li> Run the command ''pgsql2shp'' with the following parameters
:: -f the name of the resulting shape file
:: -h host name
:: database name
:: SQL view or table name
<li> The export files are created in ''C:\IMSMAng\pgsql\bin'' (dbf, prj, shp and shx)</ol>If you would like to export all rows then you only need to refer to the SQL view/table by the name of it.<br/>If you would like to export only some of the rows then you need to add more SQL statementsstatement.
{{Note | Any " inside the SQL statement needs to be escaped and therefore it is easier to refer to a SQL view that contains the columns and rows you would like to export. <br/>Example: <nowiki>pgsql2shp -f land_polygon -h localhost -u imsma -P password staging " select * from haz_gis_poly where \"Status\" = 'Closed' " </nowiki>}}
6,632
edits