반응형
예전에 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
반응형
'database > Postgresql' 카테고리의 다른 글
Postgresql 공간 쿼리 - envelope 구하기 (st_envelope), spatial query (0) | 2021.06.29 |
---|---|
우분투 postgis database 설치하기 (0) | 2021.06.06 |
shp2pgsql dimension 옵션과 geotools로 dimension 확인 (0) | 2021.05.25 |
shp2pgsql을 활용하여 Shapefile to postgis로 바꿔보자 (0) | 2021.04.14 |