SlideShare a Scribd company logo
1 of 38
Download to read offline
PostGIS의 사례로 본
PostgreSQL 확장
2017. 11. 4
장병진 (jangbi882@gmail.com)
Spatial Extension. Why? How?
PgDay Seoul 2017
가장 대표적인 Spatial SQL
3
SELECT superhero.name
FROM city, superhero
WHERE ST_Contains(city.geom, superhero.geom)
AND city.name = 'Gotham';
• city와 superhero 테이블 사이에는 JOIN 가능한 Field가 없다.
• 하지만, ‘공간’ 을 통해 연결성을 가질 수 있다!
• 때문에 공간적인 연결을 이용해 JOIN을 할 수 있다.
출처: http://postgis.net/
PgDay Seoul 2017
실용적인 분석의 예
1) 전국 3차의료기관별로 최근린 읍면동을 산출하고
2) 각 읍면동별로 3차의료기관까지 도달가능한 예상시간을 구하여
3) 각 읍면동별 예상도달시간의 각 읍면동별 인구수를 곱한 값을
4) 각 시군구별로 합산한 값을 구하여
5) 전국의 시군구별 3차의료기관 분포가 얼마나 합리적인지 분석하라
4
출처: 세상물정의 물리학, 학교와 병원과 커피숍의 사정
PgDay Seoul 2017
Spatial SQL 이란?
• 공간정보 처리 함수를 이용할 수 있는 보통 SQL이다.
• 공간객체(Geometry/Geography/Raster)가 BLOB으로 저장된다.
• 공간 데이터는 database의 추가적인 컬럼(타입)일 뿐이다.
• 속성들은 database내의 일반 속성(컬럼)들과 동일하게 처리된다.
출처: PostGIS for Managers, Paul Ramsey
http://s3.cleverelephant.ca/2014-postgis-for-managers.pdf
PgDay Seoul 2017
Spatial SQL의 장점
6
 “GIS in SQL”
–database 내에서 쿼리를 이용해 데이터를 조작하고 조회
 Shared Editing
–여러 사람이 동시에 편집해도 정합성 보장
 Performance and Scale
–대량의 데이터와 많은 작업량을 처리
–전통적인 GIS에서 단계별 데이터 변환/저장 시간을 줄여줌
PgDay Seoul 2017
Spatial Database 구성요소
7
Spatial data types
–Geometry(point, line, polygon 등)
 Spatial indexing
–공간연산의 효율적 처리 지원
 Spatial functions,
–공간적 속성과 관계 질의
–공간분석 단위로직 제공 참고: http://www.opengeospatial.org/standards/sfs
PgDay Seoul 2017
Spatial Data Type
8
참고: https://en.wikipedia.org/wiki/Well-known_text
PgDay Seoul 2017
Spatial Index
9
PgDay Seoul 2017
Spatial Function
10
• ST_Length
• ST_Area
• ST_Distance
• ST_Buffer
• ST_Scale
• ST_Rotate
• ST_Transform
• ST_Intersection
• ST_Union
• ST_Simpllify
• ST_Convexhull
• ST_AsText
• ST_AsBinary
• ST_FromText
• A && B
• A @ B
• A ~ B
• A <-> B
• A <#> B
• A |=| B
• A <=> B참고: http://postgis.net/docs/manual-2.3/reference.html#Operators
PgDay Seoul 2017
기능다양성
비용절감
Spatial DBMS 비교
출처: https://www.slideshare.net/gis_todd/postgis-and-spatial-sql
PostGISSpatialLite
PgDay Seoul 2017
PostGIS Archtecture
12
출처: https://www.slideshare.net/SimeonNedkov/delft-postgis
PostgreSQL
PostGIS
Extension
GEOS
Proj4
LibXML2
LibLwGeom
GDAL
PgDay Seoul 2017
PostGIS Archtecture
13
PostgreSQL
PostGIS
Extension
GEOS
Proj4
LibXML2
LibLwGeom
PostgreSQL은 그냥 RDBMS가 아니고 ORDBMS다.
GDAL
출처: https://www.slideshare.net/SimeonNedkov/delft-postgis
PgDay Seoul 2017
PostGIS Archtecture
14
PostgreSQL
PostGIS
Extension
GEOS
Proj4
LibXML2
LibLwGeom
PostGIS는 ORDBMS의 특성을 이용해 Native 수준으로
Spatial SQL의 요소인 Type, Index, Function 들을 구현했다.
GDAL
출처: https://www.slideshare.net/SimeonNedkov/delft-postgis
PgDay Seoul 2017
PostGIS Archtecture
15
PostgreSQL
PostGIS
Extension
GEOS
Proj4
LibXML2
LibLwGeom
Database를 바로 이용할 수 없는 많은 기능들을
Sub Library 에서 Low Level로 구현해 효율을 높였다.
GDAL
출처: https://www.slideshare.net/SimeonNedkov/delft-postgis
PgDay Seoul 2017
PostGIS Archtecture
16
PostgreSQL
PostGIS
Extension
GEOS
Proj4
LibXML2
LibLwGeom
널리 사용되는 C++기반 공간정보 라이브러리를 이용해
많은 유용한 고수준 분석/처리 기능을 추가했다.
GDAL
출처: https://www.slideshare.net/SimeonNedkov/delft-postgis
PgDay Seoul 2017
PostGIS Archtecture
17
PostgreSQL
PostGIS
Extension
GEOS
Proj4
LibXML2
LibLwGeom
좌표계 변환 라이브러리를 붙여
다양한 표준 및 비표준 좌표계를 처리한다.
GDAL
출처: https://www.slideshare.net/SimeonNedkov/delft-postgis
PgDay Seoul 2017
PostGIS Archtecture
18
PostgreSQL
PostGIS
Extension
GEOS
Proj4
LibXML2
LibLwGeom
XML 라이브러리를 이용해
GML, KML 등 XML 기반 공간정보 표준을 다룬다.
GDAL
출처: https://www.slideshare.net/SimeonNedkov/delft-postgis
PgDay Seoul 2017
PostGIS Archtecture
19
PostgreSQL
PostGIS
Extension
GEOS
Proj4
LibXML2
LibLwGeom
널리 사용되는 C++기반 Raster GIS 라이브러리를 이용해
Raster 데이터 처리와 분석을 가능하게 했다.
GDAL
Spatial SQL 실습
20
PgDay Seoul 2017
먼저 SQL 워밍업~
21
SELECT
*
FROM
liquor_licenses;
출처: https://www.slideshare.net/gis_todd/postgis-and-spatial-sql
PgDay Seoul 2017
조건절을 추가 했고요.
22
SELECT
*
FROM
liquor_licenses
WHERE
license_ty='Tavern';
PgDay Seoul 2017
함수도 써볼까요?
23
SELECT
COUNT(establish)
FROM
liquor_licenses
WHERE
license_ty='Brew Pub';
PgDay Seoul 2017
종류별로 분석도 해 보지요.
24
SELECT
AVG(char_length(establish)),
license_ty
FROM
liquor_licenses
GROUP BY
license_ty;
PgDay Seoul 2017
표준편차 같은 것도 분석해 볼 수 있지요.
25
SELECT
AVG(char_length(establish)),
STDDEV(char_length(establish)),
license_ty
FROM
liquor_licenses
GROUP BY
license_ty;
PgDay Seoul 2017
드디어 공간 컬럼
26
SELECT
ST_AsText(geom)
FROM
liquor_licenses;
POINT (127.43 37.32)
PgDay Seoul 2017
길이를 구하는 거야 껌이지요~~~
27
SELECT
ST_LENGTH (geom) ,
strname
FROM
street_centerlines;
PgDay Seoul 2017
헉! 사실은 공간정보 지식이 필요해요 ㅜ.ㅜ
28
도로 길이 총합이 1보다 작아요~~~~
PgDay Seoul 2017
미터 단위의 좌표계로 변환해야 하네요.
29
SELECT
ST_LENGTH(ST_TRANSFORM(geom,5179)),
strname
FROM
street_centerlines; • EPSG:5179
- 미터단위 TM 좌표계
- 국토지리정보원 온맵, 네
이버지도에서 사용중
- 전국 규모 사용에 적합
PgDay Seoul 2017
이제 면적도 계산할 수 있어요.
30
SELECT
objectid,
ST_AREA(ST_TRANSFORM(geom,5179))
FROM
buildings;
PgDay Seoul 2017
버… 버… 버퍼링 알아요? – 공간 컬럼 추가
31
ALTER TABLE
liquor_licenses
ADD Column
buffer
geometry(Polygon,4326)
• EPSG:4326
- 도단위 경위도 좌표계
- GPS에서 오는 좌표값과
동일
- 전세계적 자료 다룰때 가
장 많이 사용
PgDay Seoul 2017
버… 버… 버퍼링 알아요? – 공간 컬럼에 넣기
32
UPDATE
liquor_licenses
SET
Buffer=
ST_TRANSFORM
(ST_BUFFER(ST_TRANSFORM(geom,5179),30),4326);
PgDay Seoul 2017
IT의 피인 JSON과 XML로 변환
33
SELECT ST_AsGeoJSON(geom) FROM floodplain_city;
SELECT ST_AsGML(geom) FROM floodplain_city;
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [127.43 37.32]
},
"properties": {
"name": "Dinagat Islands"
}
}
<Feature>
<name>Dinagat Islands</name>
<position>
<gml:Point srsDimension="2"
srsName="http://www.opengis.net/def/crs/EPSG/0/
4326">
<gml:pos>127.43 37.32</gml:pos>
</gml:Point>
</position>
</Feature>
PgDay Seoul 2017
선이 몇 개 점으로 그려졌는지 쯤이야~
34
SELECT
ST_NPoints(geom)
FROM
street_centerlines;
PgDay Seoul 2017
공간적으로 걸치는 것을 이용해 JOIN을~
35
SELECT
a.strname,a.gid,a.geom,
a.leftadd1,a.leftadd2,a.rgtadd1,a.rgtadd2
FROM
street_centerlines a, floodplain_city b
WHERE
ST_Crosses(a.geom,b.geom);
PgDay Seoul 2017
한 지역(공간) 안에서만 분석하려면~
36
SELECT a.establish, a.license_ty,a.gid,a.geom
FROM liquor_licenses a, zoning b
WHERE st_within(a.geom, b.geom)
AND
zone_name='LOW DENSITY MIXED-USE NEIGHBORHOOD DISTRICT';
PgDay Seoul 2017
지역과 타입으로 분석
37
SELECT
COUNT(a.establish),
a.license_ty, b.zone_name ,a.gid, a.geom
FROM
liquor_licenses a, zoning b
WHERE
ST_WITHIN(a.geom,b.geom)
GROUP BY
b.zone_name, a.license_ty;
들어주셔서 감사합니다~
38

More Related Content

What's hot

QGIS 기초
QGIS 기초 QGIS 기초
QGIS 기초 slhead1
 
대용량 로그분석 Bigquery로 간단히 사용하기 (20170215 T아카데미)
대용량 로그분석 Bigquery로 간단히 사용하기 (20170215 T아카데미)대용량 로그분석 Bigquery로 간단히 사용하기 (20170215 T아카데미)
대용량 로그분석 Bigquery로 간단히 사용하기 (20170215 T아카데미)Jaikwang Lee
 
공간SQL을 이용한 공간자료분석 기초실습
공간SQL을 이용한 공간자료분석 기초실습공간SQL을 이용한 공간자료분석 기초실습
공간SQL을 이용한 공간자료분석 기초실습BJ Jang
 
MySQL GTID 시작하기
MySQL GTID 시작하기MySQL GTID 시작하기
MySQL GTID 시작하기I Goo Lee
 
공간정보거점대학 - PyQGIS 및 플러그인 개발
공간정보거점대학 - PyQGIS 및 플러그인 개발공간정보거점대학 - PyQGIS 및 플러그인 개발
공간정보거점대학 - PyQGIS 및 플러그인 개발MinPa Lee
 
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정PgDay.Seoul
 
[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기NHN FORWARD
 
PyQGIS 개발자 쿡북(PyQGIS Developer Cookbook) 한국어 판
PyQGIS 개발자 쿡북(PyQGIS Developer Cookbook) 한국어 판 PyQGIS 개발자 쿡북(PyQGIS Developer Cookbook) 한국어 판
PyQGIS 개발자 쿡북(PyQGIS Developer Cookbook) 한국어 판 SANGHEE SHIN
 
공간정보 거점대학 - OpenLayers의 고급 기능 이해 및 실습
 공간정보 거점대학 - OpenLayers의 고급 기능 이해 및 실습 공간정보 거점대학 - OpenLayers의 고급 기능 이해 및 실습
공간정보 거점대학 - OpenLayers의 고급 기능 이해 및 실습HaNJiN Lee
 
Creating Stunning Maps in GeoServer: mastering SLD and CSS styles
Creating Stunning Maps in GeoServer: mastering SLD and CSS stylesCreating Stunning Maps in GeoServer: mastering SLD and CSS styles
Creating Stunning Maps in GeoServer: mastering SLD and CSS stylesGeoSolutions
 
[Pgday.Seoul 2017] 8. PostgreSQL 10 새기능 소개 - 김상기
[Pgday.Seoul 2017] 8. PostgreSQL 10 새기능 소개 - 김상기[Pgday.Seoul 2017] 8. PostgreSQL 10 새기능 소개 - 김상기
[Pgday.Seoul 2017] 8. PostgreSQL 10 새기능 소개 - 김상기PgDay.Seoul
 
[Pgday.Seoul 2021] 1. 예제로 살펴보는 포스트그레스큐엘의 독특한 SQL
[Pgday.Seoul 2021] 1. 예제로 살펴보는 포스트그레스큐엘의 독특한 SQL[Pgday.Seoul 2021] 1. 예제로 살펴보는 포스트그레스큐엘의 독특한 SQL
[Pgday.Seoul 2021] 1. 예제로 살펴보는 포스트그레스큐엘의 독특한 SQLPgDay.Seoul
 
QGISの活用例を見てみよう
QGISの活用例を見てみようQGISの活用例を見てみよう
QGISの活用例を見てみようKazutaka ishizaki
 
[pgday.Seoul 2022] POSTGRES 테스트코드로 기여하기 - 이동욱
[pgday.Seoul 2022] POSTGRES 테스트코드로 기여하기 - 이동욱[pgday.Seoul 2022] POSTGRES 테스트코드로 기여하기 - 이동욱
[pgday.Seoul 2022] POSTGRES 테스트코드로 기여하기 - 이동욱PgDay.Seoul
 
지리정보체계(GIS) - [1] GIS 데이터 유형, 구조 알기
지리정보체계(GIS) - [1] GIS 데이터 유형, 구조 알기지리정보체계(GIS) - [1] GIS 데이터 유형, 구조 알기
지리정보체계(GIS) - [1] GIS 데이터 유형, 구조 알기Byeong-Hyeok Yu
 
PostgreSQL 공간관리 살펴보기 이근오
PostgreSQL 공간관리 살펴보기 이근오PostgreSQL 공간관리 살펴보기 이근오
PostgreSQL 공간관리 살펴보기 이근오PgDay.Seoul
 
PostgreSQL のイケてるテクニック7選
PostgreSQL のイケてるテクニック7選PostgreSQL のイケてるテクニック7選
PostgreSQL のイケてるテクニック7選Tomoya Kawanishi
 
PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs PGConf APAC
 
Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.Alexey Lesovsky
 

What's hot (20)

QGIS 기초
QGIS 기초 QGIS 기초
QGIS 기초
 
대용량 로그분석 Bigquery로 간단히 사용하기 (20170215 T아카데미)
대용량 로그분석 Bigquery로 간단히 사용하기 (20170215 T아카데미)대용량 로그분석 Bigquery로 간단히 사용하기 (20170215 T아카데미)
대용량 로그분석 Bigquery로 간단히 사용하기 (20170215 T아카데미)
 
공간SQL을 이용한 공간자료분석 기초실습
공간SQL을 이용한 공간자료분석 기초실습공간SQL을 이용한 공간자료분석 기초실습
공간SQL을 이용한 공간자료분석 기초실습
 
GeoServer 기초
GeoServer 기초GeoServer 기초
GeoServer 기초
 
MySQL GTID 시작하기
MySQL GTID 시작하기MySQL GTID 시작하기
MySQL GTID 시작하기
 
공간정보거점대학 - PyQGIS 및 플러그인 개발
공간정보거점대학 - PyQGIS 및 플러그인 개발공간정보거점대학 - PyQGIS 및 플러그인 개발
공간정보거점대학 - PyQGIS 및 플러그인 개발
 
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
[pgday.Seoul 2022] 서비스개편시 PostgreSQL 도입기 - 진소린 & 김태정
 
[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기
 
PyQGIS 개발자 쿡북(PyQGIS Developer Cookbook) 한국어 판
PyQGIS 개발자 쿡북(PyQGIS Developer Cookbook) 한국어 판 PyQGIS 개발자 쿡북(PyQGIS Developer Cookbook) 한국어 판
PyQGIS 개발자 쿡북(PyQGIS Developer Cookbook) 한국어 판
 
공간정보 거점대학 - OpenLayers의 고급 기능 이해 및 실습
 공간정보 거점대학 - OpenLayers의 고급 기능 이해 및 실습 공간정보 거점대학 - OpenLayers의 고급 기능 이해 및 실습
공간정보 거점대학 - OpenLayers의 고급 기능 이해 및 실습
 
Creating Stunning Maps in GeoServer: mastering SLD and CSS styles
Creating Stunning Maps in GeoServer: mastering SLD and CSS stylesCreating Stunning Maps in GeoServer: mastering SLD and CSS styles
Creating Stunning Maps in GeoServer: mastering SLD and CSS styles
 
[Pgday.Seoul 2017] 8. PostgreSQL 10 새기능 소개 - 김상기
[Pgday.Seoul 2017] 8. PostgreSQL 10 새기능 소개 - 김상기[Pgday.Seoul 2017] 8. PostgreSQL 10 새기능 소개 - 김상기
[Pgday.Seoul 2017] 8. PostgreSQL 10 새기능 소개 - 김상기
 
[Pgday.Seoul 2021] 1. 예제로 살펴보는 포스트그레스큐엘의 독특한 SQL
[Pgday.Seoul 2021] 1. 예제로 살펴보는 포스트그레스큐엘의 독특한 SQL[Pgday.Seoul 2021] 1. 예제로 살펴보는 포스트그레스큐엘의 독특한 SQL
[Pgday.Seoul 2021] 1. 예제로 살펴보는 포스트그레스큐엘의 독특한 SQL
 
QGISの活用例を見てみよう
QGISの活用例を見てみようQGISの活用例を見てみよう
QGISの活用例を見てみよう
 
[pgday.Seoul 2022] POSTGRES 테스트코드로 기여하기 - 이동욱
[pgday.Seoul 2022] POSTGRES 테스트코드로 기여하기 - 이동욱[pgday.Seoul 2022] POSTGRES 테스트코드로 기여하기 - 이동욱
[pgday.Seoul 2022] POSTGRES 테스트코드로 기여하기 - 이동욱
 
지리정보체계(GIS) - [1] GIS 데이터 유형, 구조 알기
지리정보체계(GIS) - [1] GIS 데이터 유형, 구조 알기지리정보체계(GIS) - [1] GIS 데이터 유형, 구조 알기
지리정보체계(GIS) - [1] GIS 데이터 유형, 구조 알기
 
PostgreSQL 공간관리 살펴보기 이근오
PostgreSQL 공간관리 살펴보기 이근오PostgreSQL 공간관리 살펴보기 이근오
PostgreSQL 공간관리 살펴보기 이근오
 
PostgreSQL のイケてるテクニック7選
PostgreSQL のイケてるテクニック7選PostgreSQL のイケてるテクニック7選
PostgreSQL のイケてるテクニック7選
 
PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs PostgreSQL WAL for DBAs
PostgreSQL WAL for DBAs
 
Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.
 

Viewers also liked

DATABASE & WEBGIS - GIS BOOTCAMP
DATABASE & WEBGIS - GIS BOOTCAMPDATABASE & WEBGIS - GIS BOOTCAMP
DATABASE & WEBGIS - GIS BOOTCAMPKevin Ng'eno
 
Open Source Databases And Gis
Open Source Databases And GisOpen Source Databases And Gis
Open Source Databases And GisKudos S.A.S
 
Intro To PostGIS
Intro To PostGISIntro To PostGIS
Intro To PostGISmleslie
 
Building Community Information Systems with Drupal and Open Layers
Building Community Information Systems with Drupal and Open LayersBuilding Community Information Systems with Drupal and Open Layers
Building Community Information Systems with Drupal and Open LayersCharles Burnett
 
Using PostGIS To Add Some Spatial Flavor To Your Application
Using PostGIS To Add Some Spatial Flavor To Your ApplicationUsing PostGIS To Add Some Spatial Flavor To Your Application
Using PostGIS To Add Some Spatial Flavor To Your ApplicationSteven Pousty
 
Postgres database Ibrahem Batta
Postgres database Ibrahem BattaPostgres database Ibrahem Batta
Postgres database Ibrahem BattaIbrahem Batta
 

Viewers also liked (6)

DATABASE & WEBGIS - GIS BOOTCAMP
DATABASE & WEBGIS - GIS BOOTCAMPDATABASE & WEBGIS - GIS BOOTCAMP
DATABASE & WEBGIS - GIS BOOTCAMP
 
Open Source Databases And Gis
Open Source Databases And GisOpen Source Databases And Gis
Open Source Databases And Gis
 
Intro To PostGIS
Intro To PostGISIntro To PostGIS
Intro To PostGIS
 
Building Community Information Systems with Drupal and Open Layers
Building Community Information Systems with Drupal and Open LayersBuilding Community Information Systems with Drupal and Open Layers
Building Community Information Systems with Drupal and Open Layers
 
Using PostGIS To Add Some Spatial Flavor To Your Application
Using PostGIS To Add Some Spatial Flavor To Your ApplicationUsing PostGIS To Add Some Spatial Flavor To Your Application
Using PostGIS To Add Some Spatial Flavor To Your Application
 
Postgres database Ibrahem Batta
Postgres database Ibrahem BattaPostgres database Ibrahem Batta
Postgres database Ibrahem Batta
 

Similar to [Pgday.Seoul 2017] 1. PostGIS의 사례로 본 PostgreSQL 확장 - 장병진

오픈소스기반 상용소프트웨어 GXT의 적용사례
오픈소스기반 상용소프트웨어 GXT의 적용사례오픈소스기반 상용소프트웨어 GXT의 적용사례
오픈소스기반 상용소프트웨어 GXT의 적용사례HaNJiN Lee
 
PostGIS - National Education Center for GIS: Open Source GIS
PostGIS - National Education Center for GIS: Open Source GIS PostGIS - National Education Center for GIS: Open Source GIS
PostGIS - National Education Center for GIS: Open Source GIS MinPa Lee
 
KCSE 2015 Tutorial 빅데이터 분석 기술의 소프트웨어 공학 분야 활용 (...
KCSE 2015 Tutorial 빅데이터 분석 기술의  소프트웨어 공학 분야 활용 (...KCSE 2015 Tutorial 빅데이터 분석 기술의  소프트웨어 공학 분야 활용 (...
KCSE 2015 Tutorial 빅데이터 분석 기술의 소프트웨어 공학 분야 활용 (...Chanjin Park
 
[제86회 Open Technet]OGC 표준 기반의 공간자료 분석과 시각화 기술 개발
[제86회 Open Technet]OGC 표준 기반의 공간자료 분석과 시각화 기술 개발[제86회 Open Technet]OGC 표준 기반의 공간자료 분석과 시각화 기술 개발
[제86회 Open Technet]OGC 표준 기반의 공간자료 분석과 시각화 기술 개발MinPa Lee
 
RxJS로 비동기와 친해지기
RxJS로 비동기와 친해지기RxJS로 비동기와 친해지기
RxJS로 비동기와 친해지기Seokju Na
 
Proj4를 이용한 좌표계 변환
Proj4를 이용한 좌표계 변환Proj4를 이용한 좌표계 변환
Proj4를 이용한 좌표계 변환BJ Jang
 
Geo tools Data Transfer
Geo tools Data TransferGeo tools Data Transfer
Geo tools Data TransferJiyoon Kim
 
[FOSS4G Korea 2016] Workshop - Advanced GeoServer
[FOSS4G Korea 2016] Workshop - Advanced GeoServer[FOSS4G Korea 2016] Workshop - Advanced GeoServer
[FOSS4G Korea 2016] Workshop - Advanced GeoServerMinPa Lee
 
이도형 실적 내역서
이도형 실적 내역서이도형 실적 내역서
이도형 실적 내역서Lee Do hyoung
 
Mongodb and spatial
Mongodb and spatialMongodb and spatial
Mongodb and spatialJiyoon Kim
 
[FOSS4G Korea 2021]Workshop-QGIS-TIPS-20211028
[FOSS4G Korea 2021]Workshop-QGIS-TIPS-20211028[FOSS4G Korea 2021]Workshop-QGIS-TIPS-20211028
[FOSS4G Korea 2021]Workshop-QGIS-TIPS-20211028MinPa Lee
 
공간정보거점대학 PostGIS 고급과정
공간정보거점대학 PostGIS 고급과정공간정보거점대학 PostGIS 고급과정
공간정보거점대학 PostGIS 고급과정JungHwan Yun
 
Open source engineering - 0.1
Open source engineering - 0.1Open source engineering - 0.1
Open source engineering - 0.1YoungSu Son
 
137 deview
137 deview137 deview
137 deviewNAVER D2
 
Popular Convention 개발기
Popular Convention 개발기Popular Convention 개발기
Popular Convention 개발기JeongHun Byeon
 
QGIS 실습 (총 7차시)
QGIS 실습 (총 7차시)QGIS 실습 (총 7차시)
QGIS 실습 (총 7차시)Byeong-Hyeok Yu
 
Node.js에서 공공API를 활용해서 개발하기
Node.js에서 공공API를 활용해서 개발하기Node.js에서 공공API를 활용해서 개발하기
Node.js에서 공공API를 활용해서 개발하기Inho Kwon
 
2020년 4월 18일 개발 이야기 정리
2020년 4월 18일 개발 이야기 정리2020년 4월 18일 개발 이야기 정리
2020년 4월 18일 개발 이야기 정리Jay Park
 
공간정보아카데미 - 오픈소스GIS 분석가과정 - QGIS 공간분석일반
공간정보아카데미 - 오픈소스GIS 분석가과정 - QGIS 공간분석일반공간정보아카데미 - 오픈소스GIS 분석가과정 - QGIS 공간분석일반
공간정보아카데미 - 오픈소스GIS 분석가과정 - QGIS 공간분석일반MinPa Lee
 

Similar to [Pgday.Seoul 2017] 1. PostGIS의 사례로 본 PostgreSQL 확장 - 장병진 (20)

오픈소스기반 상용소프트웨어 GXT의 적용사례
오픈소스기반 상용소프트웨어 GXT의 적용사례오픈소스기반 상용소프트웨어 GXT의 적용사례
오픈소스기반 상용소프트웨어 GXT의 적용사례
 
PostGIS - National Education Center for GIS: Open Source GIS
PostGIS - National Education Center for GIS: Open Source GIS PostGIS - National Education Center for GIS: Open Source GIS
PostGIS - National Education Center for GIS: Open Source GIS
 
KCSE 2015 Tutorial 빅데이터 분석 기술의 소프트웨어 공학 분야 활용 (...
KCSE 2015 Tutorial 빅데이터 분석 기술의  소프트웨어 공학 분야 활용 (...KCSE 2015 Tutorial 빅데이터 분석 기술의  소프트웨어 공학 분야 활용 (...
KCSE 2015 Tutorial 빅데이터 분석 기술의 소프트웨어 공학 분야 활용 (...
 
[제86회 Open Technet]OGC 표준 기반의 공간자료 분석과 시각화 기술 개발
[제86회 Open Technet]OGC 표준 기반의 공간자료 분석과 시각화 기술 개발[제86회 Open Technet]OGC 표준 기반의 공간자료 분석과 시각화 기술 개발
[제86회 Open Technet]OGC 표준 기반의 공간자료 분석과 시각화 기술 개발
 
RxJS로 비동기와 친해지기
RxJS로 비동기와 친해지기RxJS로 비동기와 친해지기
RxJS로 비동기와 친해지기
 
Proj4를 이용한 좌표계 변환
Proj4를 이용한 좌표계 변환Proj4를 이용한 좌표계 변환
Proj4를 이용한 좌표계 변환
 
Geo tools Data Transfer
Geo tools Data TransferGeo tools Data Transfer
Geo tools Data Transfer
 
[FOSS4G Korea 2016] Workshop - Advanced GeoServer
[FOSS4G Korea 2016] Workshop - Advanced GeoServer[FOSS4G Korea 2016] Workshop - Advanced GeoServer
[FOSS4G Korea 2016] Workshop - Advanced GeoServer
 
이도형 실적 내역서
이도형 실적 내역서이도형 실적 내역서
이도형 실적 내역서
 
Mongodb and spatial
Mongodb and spatialMongodb and spatial
Mongodb and spatial
 
[FOSS4G Korea 2021]Workshop-QGIS-TIPS-20211028
[FOSS4G Korea 2021]Workshop-QGIS-TIPS-20211028[FOSS4G Korea 2021]Workshop-QGIS-TIPS-20211028
[FOSS4G Korea 2021]Workshop-QGIS-TIPS-20211028
 
공간정보거점대학 PostGIS 고급과정
공간정보거점대학 PostGIS 고급과정공간정보거점대학 PostGIS 고급과정
공간정보거점대학 PostGIS 고급과정
 
Open source engineering - 0.1
Open source engineering - 0.1Open source engineering - 0.1
Open source engineering - 0.1
 
137 deview
137 deview137 deview
137 deview
 
Popular Convention 개발기
Popular Convention 개발기Popular Convention 개발기
Popular Convention 개발기
 
QGIS 실습 (총 7차시)
QGIS 실습 (총 7차시)QGIS 실습 (총 7차시)
QGIS 실습 (총 7차시)
 
Node.js에서 공공API를 활용해서 개발하기
Node.js에서 공공API를 활용해서 개발하기Node.js에서 공공API를 활용해서 개발하기
Node.js에서 공공API를 활용해서 개발하기
 
Portfolio
PortfolioPortfolio
Portfolio
 
2020년 4월 18일 개발 이야기 정리
2020년 4월 18일 개발 이야기 정리2020년 4월 18일 개발 이야기 정리
2020년 4월 18일 개발 이야기 정리
 
공간정보아카데미 - 오픈소스GIS 분석가과정 - QGIS 공간분석일반
공간정보아카데미 - 오픈소스GIS 분석가과정 - QGIS 공간분석일반공간정보아카데미 - 오픈소스GIS 분석가과정 - QGIS 공간분석일반
공간정보아카데미 - 오픈소스GIS 분석가과정 - QGIS 공간분석일반
 

More from PgDay.Seoul

[pgday.Seoul 2022] PostgreSQL with Google Cloud
[pgday.Seoul 2022] PostgreSQL with Google Cloud[pgday.Seoul 2022] PostgreSQL with Google Cloud
[pgday.Seoul 2022] PostgreSQL with Google CloudPgDay.Seoul
 
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
[Pgday.Seoul 2021] 2. Porting Oracle UDF and OptimizationPgDay.Seoul
 
[Pgday.Seoul 2020] 포스트그레스큐엘 자국어화 이야기
[Pgday.Seoul 2020] 포스트그레스큐엘 자국어화 이야기[Pgday.Seoul 2020] 포스트그레스큐엘 자국어화 이야기
[Pgday.Seoul 2020] 포스트그레스큐엘 자국어화 이야기PgDay.Seoul
 
[Pgday.Seoul 2020] SQL Tuning
[Pgday.Seoul 2020] SQL Tuning[Pgday.Seoul 2020] SQL Tuning
[Pgday.Seoul 2020] SQL TuningPgDay.Seoul
 
[Pgday.Seoul 2019] AppOS 고성능 I/O 확장 모듈로 성능 10배 향상시키기
[Pgday.Seoul 2019] AppOS 고성능 I/O 확장 모듈로 성능 10배 향상시키기[Pgday.Seoul 2019] AppOS 고성능 I/O 확장 모듈로 성능 10배 향상시키기
[Pgday.Seoul 2019] AppOS 고성능 I/O 확장 모듈로 성능 10배 향상시키기PgDay.Seoul
 
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스PgDay.Seoul
 
[Pgday.Seoul 2019] Advanced FDW
[Pgday.Seoul 2019] Advanced FDW[Pgday.Seoul 2019] Advanced FDW
[Pgday.Seoul 2019] Advanced FDWPgDay.Seoul
 
[Pgday.Seoul 2018] PostgreSQL 11 새 기능 소개
[Pgday.Seoul 2018]  PostgreSQL 11 새 기능 소개[Pgday.Seoul 2018]  PostgreSQL 11 새 기능 소개
[Pgday.Seoul 2018] PostgreSQL 11 새 기능 소개PgDay.Seoul
 
[Pgday.Seoul 2018] PostgreSQL 성능을 위해 개발된 라이브러리 OS 소개 apposha
[Pgday.Seoul 2018]  PostgreSQL 성능을 위해 개발된 라이브러리 OS 소개 apposha[Pgday.Seoul 2018]  PostgreSQL 성능을 위해 개발된 라이브러리 OS 소개 apposha
[Pgday.Seoul 2018] PostgreSQL 성능을 위해 개발된 라이브러리 OS 소개 apposhaPgDay.Seoul
 
[Pgday.Seoul 2018] PostgreSQL Authentication with FreeIPA
[Pgday.Seoul 2018]  PostgreSQL Authentication with FreeIPA[Pgday.Seoul 2018]  PostgreSQL Authentication with FreeIPA
[Pgday.Seoul 2018] PostgreSQL Authentication with FreeIPAPgDay.Seoul
 
[Pgday.Seoul 2018] 이기종 DB에서 PostgreSQL로의 Migration을 위한 DB2PG
[Pgday.Seoul 2018]  이기종 DB에서 PostgreSQL로의 Migration을 위한 DB2PG[Pgday.Seoul 2018]  이기종 DB에서 PostgreSQL로의 Migration을 위한 DB2PG
[Pgday.Seoul 2018] 이기종 DB에서 PostgreSQL로의 Migration을 위한 DB2PGPgDay.Seoul
 
[Pgday.Seoul 2018] AWS Cloud 환경에서 PostgreSQL 구축하기
[Pgday.Seoul 2018]  AWS Cloud 환경에서 PostgreSQL 구축하기[Pgday.Seoul 2018]  AWS Cloud 환경에서 PostgreSQL 구축하기
[Pgday.Seoul 2018] AWS Cloud 환경에서 PostgreSQL 구축하기PgDay.Seoul
 
[Pgday.Seoul 2018] Greenplum의 노드 분산 설계
[Pgday.Seoul 2018]  Greenplum의 노드 분산 설계[Pgday.Seoul 2018]  Greenplum의 노드 분산 설계
[Pgday.Seoul 2018] Greenplum의 노드 분산 설계PgDay.Seoul
 
[Pgday.Seoul 2018] replacing oracle with edb postgres
[Pgday.Seoul 2018] replacing oracle with edb postgres[Pgday.Seoul 2018] replacing oracle with edb postgres
[Pgday.Seoul 2018] replacing oracle with edb postgresPgDay.Seoul
 
[Pgday.Seoul 2017] 6. GIN vs GiST 인덱스 이야기 - 박진우
[Pgday.Seoul 2017] 6. GIN vs GiST 인덱스 이야기 - 박진우[Pgday.Seoul 2017] 6. GIN vs GiST 인덱스 이야기 - 박진우
[Pgday.Seoul 2017] 6. GIN vs GiST 인덱스 이야기 - 박진우PgDay.Seoul
 
[Pgday.Seoul 2017] 5. 테드폴허브(올챙이) PostgreSQL 확장하기 - 조현종
[Pgday.Seoul 2017] 5. 테드폴허브(올챙이) PostgreSQL 확장하기 - 조현종[Pgday.Seoul 2017] 5. 테드폴허브(올챙이) PostgreSQL 확장하기 - 조현종
[Pgday.Seoul 2017] 5. 테드폴허브(올챙이) PostgreSQL 확장하기 - 조현종PgDay.Seoul
 
[Pgday.Seoul 2017] 7. PostgreSQL DB Tuning 기업사례 - 송춘자
[Pgday.Seoul 2017] 7. PostgreSQL DB Tuning 기업사례 - 송춘자[Pgday.Seoul 2017] 7. PostgreSQL DB Tuning 기업사례 - 송춘자
[Pgday.Seoul 2017] 7. PostgreSQL DB Tuning 기업사례 - 송춘자PgDay.Seoul
 
[Pgday.Seoul 2017] 4. Composite Type/JSON 파라미터를 활용한 TVP구현(with C#, JAVA) - 지현명
[Pgday.Seoul 2017] 4. Composite Type/JSON 파라미터를 활용한 TVP구현(with C#, JAVA) - 지현명[Pgday.Seoul 2017] 4. Composite Type/JSON 파라미터를 활용한 TVP구현(with C#, JAVA) - 지현명
[Pgday.Seoul 2017] 4. Composite Type/JSON 파라미터를 활용한 TVP구현(with C#, JAVA) - 지현명PgDay.Seoul
 
[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오
[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오
[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오PgDay.Seoul
 
[Pgday.Seoul 2017] 2. PostgreSQL을 위한 리눅스 커널 최적화 - 김상욱
[Pgday.Seoul 2017] 2. PostgreSQL을 위한 리눅스 커널 최적화 - 김상욱[Pgday.Seoul 2017] 2. PostgreSQL을 위한 리눅스 커널 최적화 - 김상욱
[Pgday.Seoul 2017] 2. PostgreSQL을 위한 리눅스 커널 최적화 - 김상욱PgDay.Seoul
 

More from PgDay.Seoul (20)

[pgday.Seoul 2022] PostgreSQL with Google Cloud
[pgday.Seoul 2022] PostgreSQL with Google Cloud[pgday.Seoul 2022] PostgreSQL with Google Cloud
[pgday.Seoul 2022] PostgreSQL with Google Cloud
 
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
 
[Pgday.Seoul 2020] 포스트그레스큐엘 자국어화 이야기
[Pgday.Seoul 2020] 포스트그레스큐엘 자국어화 이야기[Pgday.Seoul 2020] 포스트그레스큐엘 자국어화 이야기
[Pgday.Seoul 2020] 포스트그레스큐엘 자국어화 이야기
 
[Pgday.Seoul 2020] SQL Tuning
[Pgday.Seoul 2020] SQL Tuning[Pgday.Seoul 2020] SQL Tuning
[Pgday.Seoul 2020] SQL Tuning
 
[Pgday.Seoul 2019] AppOS 고성능 I/O 확장 모듈로 성능 10배 향상시키기
[Pgday.Seoul 2019] AppOS 고성능 I/O 확장 모듈로 성능 10배 향상시키기[Pgday.Seoul 2019] AppOS 고성능 I/O 확장 모듈로 성능 10배 향상시키기
[Pgday.Seoul 2019] AppOS 고성능 I/O 확장 모듈로 성능 10배 향상시키기
 
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
[Pgday.Seoul 2019] Citus를 이용한 분산 데이터베이스
 
[Pgday.Seoul 2019] Advanced FDW
[Pgday.Seoul 2019] Advanced FDW[Pgday.Seoul 2019] Advanced FDW
[Pgday.Seoul 2019] Advanced FDW
 
[Pgday.Seoul 2018] PostgreSQL 11 새 기능 소개
[Pgday.Seoul 2018]  PostgreSQL 11 새 기능 소개[Pgday.Seoul 2018]  PostgreSQL 11 새 기능 소개
[Pgday.Seoul 2018] PostgreSQL 11 새 기능 소개
 
[Pgday.Seoul 2018] PostgreSQL 성능을 위해 개발된 라이브러리 OS 소개 apposha
[Pgday.Seoul 2018]  PostgreSQL 성능을 위해 개발된 라이브러리 OS 소개 apposha[Pgday.Seoul 2018]  PostgreSQL 성능을 위해 개발된 라이브러리 OS 소개 apposha
[Pgday.Seoul 2018] PostgreSQL 성능을 위해 개발된 라이브러리 OS 소개 apposha
 
[Pgday.Seoul 2018] PostgreSQL Authentication with FreeIPA
[Pgday.Seoul 2018]  PostgreSQL Authentication with FreeIPA[Pgday.Seoul 2018]  PostgreSQL Authentication with FreeIPA
[Pgday.Seoul 2018] PostgreSQL Authentication with FreeIPA
 
[Pgday.Seoul 2018] 이기종 DB에서 PostgreSQL로의 Migration을 위한 DB2PG
[Pgday.Seoul 2018]  이기종 DB에서 PostgreSQL로의 Migration을 위한 DB2PG[Pgday.Seoul 2018]  이기종 DB에서 PostgreSQL로의 Migration을 위한 DB2PG
[Pgday.Seoul 2018] 이기종 DB에서 PostgreSQL로의 Migration을 위한 DB2PG
 
[Pgday.Seoul 2018] AWS Cloud 환경에서 PostgreSQL 구축하기
[Pgday.Seoul 2018]  AWS Cloud 환경에서 PostgreSQL 구축하기[Pgday.Seoul 2018]  AWS Cloud 환경에서 PostgreSQL 구축하기
[Pgday.Seoul 2018] AWS Cloud 환경에서 PostgreSQL 구축하기
 
[Pgday.Seoul 2018] Greenplum의 노드 분산 설계
[Pgday.Seoul 2018]  Greenplum의 노드 분산 설계[Pgday.Seoul 2018]  Greenplum의 노드 분산 설계
[Pgday.Seoul 2018] Greenplum의 노드 분산 설계
 
[Pgday.Seoul 2018] replacing oracle with edb postgres
[Pgday.Seoul 2018] replacing oracle with edb postgres[Pgday.Seoul 2018] replacing oracle with edb postgres
[Pgday.Seoul 2018] replacing oracle with edb postgres
 
[Pgday.Seoul 2017] 6. GIN vs GiST 인덱스 이야기 - 박진우
[Pgday.Seoul 2017] 6. GIN vs GiST 인덱스 이야기 - 박진우[Pgday.Seoul 2017] 6. GIN vs GiST 인덱스 이야기 - 박진우
[Pgday.Seoul 2017] 6. GIN vs GiST 인덱스 이야기 - 박진우
 
[Pgday.Seoul 2017] 5. 테드폴허브(올챙이) PostgreSQL 확장하기 - 조현종
[Pgday.Seoul 2017] 5. 테드폴허브(올챙이) PostgreSQL 확장하기 - 조현종[Pgday.Seoul 2017] 5. 테드폴허브(올챙이) PostgreSQL 확장하기 - 조현종
[Pgday.Seoul 2017] 5. 테드폴허브(올챙이) PostgreSQL 확장하기 - 조현종
 
[Pgday.Seoul 2017] 7. PostgreSQL DB Tuning 기업사례 - 송춘자
[Pgday.Seoul 2017] 7. PostgreSQL DB Tuning 기업사례 - 송춘자[Pgday.Seoul 2017] 7. PostgreSQL DB Tuning 기업사례 - 송춘자
[Pgday.Seoul 2017] 7. PostgreSQL DB Tuning 기업사례 - 송춘자
 
[Pgday.Seoul 2017] 4. Composite Type/JSON 파라미터를 활용한 TVP구현(with C#, JAVA) - 지현명
[Pgday.Seoul 2017] 4. Composite Type/JSON 파라미터를 활용한 TVP구현(with C#, JAVA) - 지현명[Pgday.Seoul 2017] 4. Composite Type/JSON 파라미터를 활용한 TVP구현(with C#, JAVA) - 지현명
[Pgday.Seoul 2017] 4. Composite Type/JSON 파라미터를 활용한 TVP구현(with C#, JAVA) - 지현명
 
[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오
[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오
[Pgday.Seoul 2017] 3. PostgreSQL WAL Buffers, Clog Buffers Deep Dive - 이근오
 
[Pgday.Seoul 2017] 2. PostgreSQL을 위한 리눅스 커널 최적화 - 김상욱
[Pgday.Seoul 2017] 2. PostgreSQL을 위한 리눅스 커널 최적화 - 김상욱[Pgday.Seoul 2017] 2. PostgreSQL을 위한 리눅스 커널 최적화 - 김상욱
[Pgday.Seoul 2017] 2. PostgreSQL을 위한 리눅스 커널 최적화 - 김상욱
 

[Pgday.Seoul 2017] 1. PostGIS의 사례로 본 PostgreSQL 확장 - 장병진

  • 1. PostGIS의 사례로 본 PostgreSQL 확장 2017. 11. 4 장병진 (jangbi882@gmail.com)
  • 3. PgDay Seoul 2017 가장 대표적인 Spatial SQL 3 SELECT superhero.name FROM city, superhero WHERE ST_Contains(city.geom, superhero.geom) AND city.name = 'Gotham'; • city와 superhero 테이블 사이에는 JOIN 가능한 Field가 없다. • 하지만, ‘공간’ 을 통해 연결성을 가질 수 있다! • 때문에 공간적인 연결을 이용해 JOIN을 할 수 있다. 출처: http://postgis.net/
  • 4. PgDay Seoul 2017 실용적인 분석의 예 1) 전국 3차의료기관별로 최근린 읍면동을 산출하고 2) 각 읍면동별로 3차의료기관까지 도달가능한 예상시간을 구하여 3) 각 읍면동별 예상도달시간의 각 읍면동별 인구수를 곱한 값을 4) 각 시군구별로 합산한 값을 구하여 5) 전국의 시군구별 3차의료기관 분포가 얼마나 합리적인지 분석하라 4 출처: 세상물정의 물리학, 학교와 병원과 커피숍의 사정
  • 5. PgDay Seoul 2017 Spatial SQL 이란? • 공간정보 처리 함수를 이용할 수 있는 보통 SQL이다. • 공간객체(Geometry/Geography/Raster)가 BLOB으로 저장된다. • 공간 데이터는 database의 추가적인 컬럼(타입)일 뿐이다. • 속성들은 database내의 일반 속성(컬럼)들과 동일하게 처리된다. 출처: PostGIS for Managers, Paul Ramsey http://s3.cleverelephant.ca/2014-postgis-for-managers.pdf
  • 6. PgDay Seoul 2017 Spatial SQL의 장점 6  “GIS in SQL” –database 내에서 쿼리를 이용해 데이터를 조작하고 조회  Shared Editing –여러 사람이 동시에 편집해도 정합성 보장  Performance and Scale –대량의 데이터와 많은 작업량을 처리 –전통적인 GIS에서 단계별 데이터 변환/저장 시간을 줄여줌
  • 7. PgDay Seoul 2017 Spatial Database 구성요소 7 Spatial data types –Geometry(point, line, polygon 등)  Spatial indexing –공간연산의 효율적 처리 지원  Spatial functions, –공간적 속성과 관계 질의 –공간분석 단위로직 제공 참고: http://www.opengeospatial.org/standards/sfs
  • 8. PgDay Seoul 2017 Spatial Data Type 8 참고: https://en.wikipedia.org/wiki/Well-known_text
  • 10. PgDay Seoul 2017 Spatial Function 10 • ST_Length • ST_Area • ST_Distance • ST_Buffer • ST_Scale • ST_Rotate • ST_Transform • ST_Intersection • ST_Union • ST_Simpllify • ST_Convexhull • ST_AsText • ST_AsBinary • ST_FromText • A && B • A @ B • A ~ B • A <-> B • A <#> B • A |=| B • A <=> B참고: http://postgis.net/docs/manual-2.3/reference.html#Operators
  • 11. PgDay Seoul 2017 기능다양성 비용절감 Spatial DBMS 비교 출처: https://www.slideshare.net/gis_todd/postgis-and-spatial-sql PostGISSpatialLite
  • 12. PgDay Seoul 2017 PostGIS Archtecture 12 출처: https://www.slideshare.net/SimeonNedkov/delft-postgis PostgreSQL PostGIS Extension GEOS Proj4 LibXML2 LibLwGeom GDAL
  • 13. PgDay Seoul 2017 PostGIS Archtecture 13 PostgreSQL PostGIS Extension GEOS Proj4 LibXML2 LibLwGeom PostgreSQL은 그냥 RDBMS가 아니고 ORDBMS다. GDAL 출처: https://www.slideshare.net/SimeonNedkov/delft-postgis
  • 14. PgDay Seoul 2017 PostGIS Archtecture 14 PostgreSQL PostGIS Extension GEOS Proj4 LibXML2 LibLwGeom PostGIS는 ORDBMS의 특성을 이용해 Native 수준으로 Spatial SQL의 요소인 Type, Index, Function 들을 구현했다. GDAL 출처: https://www.slideshare.net/SimeonNedkov/delft-postgis
  • 15. PgDay Seoul 2017 PostGIS Archtecture 15 PostgreSQL PostGIS Extension GEOS Proj4 LibXML2 LibLwGeom Database를 바로 이용할 수 없는 많은 기능들을 Sub Library 에서 Low Level로 구현해 효율을 높였다. GDAL 출처: https://www.slideshare.net/SimeonNedkov/delft-postgis
  • 16. PgDay Seoul 2017 PostGIS Archtecture 16 PostgreSQL PostGIS Extension GEOS Proj4 LibXML2 LibLwGeom 널리 사용되는 C++기반 공간정보 라이브러리를 이용해 많은 유용한 고수준 분석/처리 기능을 추가했다. GDAL 출처: https://www.slideshare.net/SimeonNedkov/delft-postgis
  • 17. PgDay Seoul 2017 PostGIS Archtecture 17 PostgreSQL PostGIS Extension GEOS Proj4 LibXML2 LibLwGeom 좌표계 변환 라이브러리를 붙여 다양한 표준 및 비표준 좌표계를 처리한다. GDAL 출처: https://www.slideshare.net/SimeonNedkov/delft-postgis
  • 18. PgDay Seoul 2017 PostGIS Archtecture 18 PostgreSQL PostGIS Extension GEOS Proj4 LibXML2 LibLwGeom XML 라이브러리를 이용해 GML, KML 등 XML 기반 공간정보 표준을 다룬다. GDAL 출처: https://www.slideshare.net/SimeonNedkov/delft-postgis
  • 19. PgDay Seoul 2017 PostGIS Archtecture 19 PostgreSQL PostGIS Extension GEOS Proj4 LibXML2 LibLwGeom 널리 사용되는 C++기반 Raster GIS 라이브러리를 이용해 Raster 데이터 처리와 분석을 가능하게 했다. GDAL
  • 21. PgDay Seoul 2017 먼저 SQL 워밍업~ 21 SELECT * FROM liquor_licenses; 출처: https://www.slideshare.net/gis_todd/postgis-and-spatial-sql
  • 22. PgDay Seoul 2017 조건절을 추가 했고요. 22 SELECT * FROM liquor_licenses WHERE license_ty='Tavern';
  • 23. PgDay Seoul 2017 함수도 써볼까요? 23 SELECT COUNT(establish) FROM liquor_licenses WHERE license_ty='Brew Pub';
  • 24. PgDay Seoul 2017 종류별로 분석도 해 보지요. 24 SELECT AVG(char_length(establish)), license_ty FROM liquor_licenses GROUP BY license_ty;
  • 25. PgDay Seoul 2017 표준편차 같은 것도 분석해 볼 수 있지요. 25 SELECT AVG(char_length(establish)), STDDEV(char_length(establish)), license_ty FROM liquor_licenses GROUP BY license_ty;
  • 26. PgDay Seoul 2017 드디어 공간 컬럼 26 SELECT ST_AsText(geom) FROM liquor_licenses; POINT (127.43 37.32)
  • 27. PgDay Seoul 2017 길이를 구하는 거야 껌이지요~~~ 27 SELECT ST_LENGTH (geom) , strname FROM street_centerlines;
  • 28. PgDay Seoul 2017 헉! 사실은 공간정보 지식이 필요해요 ㅜ.ㅜ 28 도로 길이 총합이 1보다 작아요~~~~
  • 29. PgDay Seoul 2017 미터 단위의 좌표계로 변환해야 하네요. 29 SELECT ST_LENGTH(ST_TRANSFORM(geom,5179)), strname FROM street_centerlines; • EPSG:5179 - 미터단위 TM 좌표계 - 국토지리정보원 온맵, 네 이버지도에서 사용중 - 전국 규모 사용에 적합
  • 30. PgDay Seoul 2017 이제 면적도 계산할 수 있어요. 30 SELECT objectid, ST_AREA(ST_TRANSFORM(geom,5179)) FROM buildings;
  • 31. PgDay Seoul 2017 버… 버… 버퍼링 알아요? – 공간 컬럼 추가 31 ALTER TABLE liquor_licenses ADD Column buffer geometry(Polygon,4326) • EPSG:4326 - 도단위 경위도 좌표계 - GPS에서 오는 좌표값과 동일 - 전세계적 자료 다룰때 가 장 많이 사용
  • 32. PgDay Seoul 2017 버… 버… 버퍼링 알아요? – 공간 컬럼에 넣기 32 UPDATE liquor_licenses SET Buffer= ST_TRANSFORM (ST_BUFFER(ST_TRANSFORM(geom,5179),30),4326);
  • 33. PgDay Seoul 2017 IT의 피인 JSON과 XML로 변환 33 SELECT ST_AsGeoJSON(geom) FROM floodplain_city; SELECT ST_AsGML(geom) FROM floodplain_city; { "type": "Feature", "geometry": { "type": "Point", "coordinates": [127.43 37.32] }, "properties": { "name": "Dinagat Islands" } } <Feature> <name>Dinagat Islands</name> <position> <gml:Point srsDimension="2" srsName="http://www.opengis.net/def/crs/EPSG/0/ 4326"> <gml:pos>127.43 37.32</gml:pos> </gml:Point> </position> </Feature>
  • 34. PgDay Seoul 2017 선이 몇 개 점으로 그려졌는지 쯤이야~ 34 SELECT ST_NPoints(geom) FROM street_centerlines;
  • 35. PgDay Seoul 2017 공간적으로 걸치는 것을 이용해 JOIN을~ 35 SELECT a.strname,a.gid,a.geom, a.leftadd1,a.leftadd2,a.rgtadd1,a.rgtadd2 FROM street_centerlines a, floodplain_city b WHERE ST_Crosses(a.geom,b.geom);
  • 36. PgDay Seoul 2017 한 지역(공간) 안에서만 분석하려면~ 36 SELECT a.establish, a.license_ty,a.gid,a.geom FROM liquor_licenses a, zoning b WHERE st_within(a.geom, b.geom) AND zone_name='LOW DENSITY MIXED-USE NEIGHBORHOOD DISTRICT';
  • 37. PgDay Seoul 2017 지역과 타입으로 분석 37 SELECT COUNT(a.establish), a.license_ty, b.zone_name ,a.gid, a.geom FROM liquor_licenses a, zoning b WHERE ST_WITHIN(a.geom,b.geom) GROUP BY b.zone_name, a.license_ty;