| 1 | |
| 2 | = pgsql2shp Examples = |
| 3 | |
| 4 | |
| 5 | == Database on different machine, authentication required == |
| 6 | |
| 7 | {{{ |
| 8 | pgsql2shp -f myshp -h myserver -u apguser -P mypassword -g mygeomfield mydatabase mytable |
| 9 | |
| 10 | }}} |
| 11 | |
| 12 | == Database on same machine, trusted user, no need for host == |
| 13 | |
| 14 | {{{ |
| 15 | pgsql2shp -f myshp mydatabase mytable |
| 16 | |
| 17 | }}} |
| 18 | |
| 19 | == Using an sql statement instead of table == |
| 20 | |
| 21 | {{{ |
| 22 | pgsql2shp -f myshp -h myserver -u apguser -P mypassword -g mygeomfield mydatabase "select parcel_id, the_geom from parcels where neighborhood='DORCHESTER'" |
| 23 | |
| 24 | }}} |
| 25 | |
| 26 | |
| 27 | Where myshp is the shapefile name without the .shp extension |