PostGIS function pgsql2shp
From IMSMA Wiki
One of the geotables need to be included in the table/view that you are exporting and the mandatory column is called shape.
- Create a SQL view or use one of the existing GIS views
- Open the command / DOS prompt
- Go to C:\IMSMAng\pgsql\bin
- Run the command pgsql2shp with the following parameters
- -f the name of the resulting shape file
- -h host name If the Staging area database is on your computer than use localhost
- -u user Use imsma
- -P password Use password
- database name
- SQL view or table name
You may refer to the SQL view/table by the name of it you would like to export all rows OR specify the SQL statement.
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. |
The number of rows exported witll be shown when the export is done
Example: pgsql2shp -f land_polygon -h localhost -u imsma -P password staging " select * from haz_gis_poly where \"Status\" = 'Closed' "
|