반응형

예전에 shp2pgsql로 shape 파일을 postgresql table로 컨버팅한 적이 있다.

 

이번에는 반대로 pgsql2shp을 활용해서 db table을 shp 파일로 만드는 예제를 해볼 것이다.

 

pgsql2shp -f <새로운 shp 파일 경로+새로운 shp파일.shp> -g geom(geometry 컬럼 이름) -h <host> -u <user> -p <port>

-P <password> <database> "SELCT geom,filed from schema.tableName"

 

특정 필드만 선택해서 shp을 만들경우 쿼리를 위와 같이 쿼리를 이용하면 된다.

 

자세한 옵션에 대한 설명은 아래 링크를 참조하면 된다.

www.bostongis.com/pgsql2shp_shp2pgsql_quickguide.bqg

 

PostGIS 2.0 pgsql2shp shp2pgsql Command Line Cheatsheet

PostGIS 2.0.0 pgsql2shp shp2pgsql Cheat Sheet shp2pgsql and pgsql2shp are all located in the bin folder of the PostgreSQL install. pgsql2shp dumps a postgis database table, view or sql query to ESRI shape file format. USAGE: pgsql2shp [OPTIONS] database [s

www.bostongis.com

 

반응형

+ Recent posts