티스토리 뷰
넣으려는 데이터베이스에 접속하고 익스텐션 꼭 설치
1. CREATE EXTENSION postgis;
shp2pgsql 사용해서 shp 파일 업로드
2. shp2pgsql -c -D -s 5179 -W cp949 {file_path} {table_name} | psql -U {user_name} -d {db_name}
-c: 테이블 생성
-a: 이미 테이블이 있는 경우면 -c대신 -a사용
결과

geom 컬럼이 내가 보던 geometry 형식이랑 달라서 당황했는데, 관련 블로그 글을 보니 다른 표준 형식이라고 함
보통 polygon((0 0, 1 0, 1 1, 01, 0 0)) 이런 형태는 WKT라고 부름
애초에 shp2pgsql로 업로드 할때 WKT로 할 수 없나?
"-w"를 넣으면 된다고 하는데 똑같이 들어감..

https://pamyferret.tistory.com/29
[ PostgreSql ] PostGIS 함수와 geometry 컬럼 타입 사용하기
http://postgis.net/docs/manual-2.0/ PostGIS 2.0 Manual Abstract PostGIS is an extension to the PostgreSQL object-relational database system which allows GIS (Geographic Information Systems) objects to be stored in the database. PostGIS includes support for
pamyferret.tistory.com
https://m.blog.naver.com/ilsan_ilsan/221497823431
[오픈소스GIS] WKB, WKT 이해 / postGIS에서의 변환, 입출력
이전에 shp2pgsql을 통해 shp파일을 postgresql에 올려 보고, 올렸을 때 생기는 geom컬럼이 postGIS에서...
blog.naver.com
'개발일지' 카테고리의 다른 글
[Ubuntu] 우분투 서버(ubuntu server) 글자 크기 CLI로 변경 (0) | 2024.02.05 |
---|---|
[3d-force-graph] 3D 그래프 시각화 - 관광지 그래프 예제 (0) | 2023.12.14 |
[postgreSQL] 모든 테이블의 행 수(row), 열 수(column) 조회하기 (0) | 2023.09.20 |
[linux] 사용자 추가, 비밀번호 변경, 홈 디렉터리 변경 (0) | 2023.09.18 |
[postgreSQL] 한글 TXT 또는 CSV 데이터 import하기 (0) | 2023.09.15 |
- Total
- Today
- Yesterday
- Postgis
- Claude
- vscode
- 지식그래프임베딩
- hadoop
- LLM
- psycopg
- python'
- MongoDB
- pdfmathtranslate
- rdflib
- 키워드추출
- PostgreSQL
- cursorai
- PEFT
- deepseek
- polars
- TextRank
- vervel
- ChatGPT
- geospy
- python
- SPARQL
- Encoding
- pandas
- Vue3
- knowledgegraph
- 지식그래프
- writerow
- rdffox
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |