Shape file 을 PostGIS 데이터베이스에 넣는 방법
정보기술/웹&데이터베이스 2011/07/01 23:55 |
Requirement:
- PostgreSQL
- PostGIS
- 데이터베이스를 생성할 때는 postgis 데이터베이스를 template로 생성하여야 한다.
방법:
- PostgreSQL 의 bin 디렉토리에 포함된 shp2pgsql.exe 를 이용하여 shapefile 을 sql 스크립트로 변환한 후 스크립트 실행
- shape 파일 과 함께 제공되는 dbf, prj, shx 정보가 같은 디렉토리에 있어야 한다.
- 사용법은 shp2pgsql.exe shapfilename schema.tablename > scriptfilename.sql
참고자료:
http://khayer.wordpress.com/2009/10/29/creating-database-and-importing-shape-file-in-postgis/
http://www.paolocorti.net/2006/07/27/migrating-shapefiles-to-postgis/
활용예:
World borders dataset 을 PostgreSQL 데이터베이스에 저장할 수 있다.
http://thematicmapping.org/downloads/world_borders.php
- PostgreSQL
- PostGIS
- 데이터베이스를 생성할 때는 postgis 데이터베이스를 template로 생성하여야 한다.
방법:
- PostgreSQL 의 bin 디렉토리에 포함된 shp2pgsql.exe 를 이용하여 shapefile 을 sql 스크립트로 변환한 후 스크립트 실행
- shape 파일 과 함께 제공되는 dbf, prj, shx 정보가 같은 디렉토리에 있어야 한다.
- 사용법은 shp2pgsql.exe shapfilename schema.tablename > scriptfilename.sql
ex) shp2pgsql.exe TM_WORLD_BORDERS_SIMPL-0.3.shp public.world_borders_simple > TM_WORLD_BORDERS_SIMPL-0.3.sql
- 스크립트 실행은 PgAdmin III 를 이용해도 될 것이고 (확인 필요), 본인은 PostgreSQL Maestro 에서 데이터베이스 프로파일을 선택한 후 우클릭하면 나타나는 팝업 메뉴에서 Database Tools > Execute script from file 기능을 이용하였다.참고자료:
http://khayer.wordpress.com/2009/10/29/creating-database-and-importing-shape-file-in-postgis/
http://www.paolocorti.net/2006/07/27/migrating-shapefiles-to-postgis/
활용예:
World borders dataset 을 PostgreSQL 데이터베이스에 저장할 수 있다.
http://thematicmapping.org/downloads/world_borders.php
'정보기술 > 웹&데이터베이스' 카테고리의 다른 글
| Shape file 을 PostGIS 데이터베이스에 넣는 방법 (0) | 2011/07/01 |
|---|---|
| Alfresco Database 직접 접근 - mysql (0) | 2010/12/06 |
| Alfresco Customization for Custom Content Type (0) | 2010/12/04 |
| Alfresco CIFS Files Service in Ubuntu 10.10 (0) | 2010/11/29 |
| Alfresco PHP Library Installation Instructions - Ubuntu 10.10 기준 (0) | 2010/11/27 |
| Ubuntu Linux 관리 Tip (Ubuntu Desktop 10.10) (0) | 2010/11/26 |

zb2tt_2009.rar
tattertools-1.0.2.zip
댓글을 달아 주세요