際際滷

際際滷Share a Scribd company logo
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 ̄
Cdatabase ??? ??? ??? ???? ???? ??
? Shared Editing
C?? ??? ??? ???? ??? ??
? Performance and Scale
C??? ???? ?? ???? ??
C???? GIS?? ??? ??? ??/?? ??? ???
PgDay Seoul 2017
Spatial Database ????
7
?Spatial data types
CGeometry(point, line, polygon ?)
? Spatial indexing
C????? ??? ?? ??
? Spatial functions,
C??? ??? ?? ??
C???? ???? ?? ??: 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 ??
??: /gis_todd/postgis-and-spatial-sql
PostGISSpatialLite
PgDay Seoul 2017
PostGIS Archtecture
12
??: /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
??: /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
??: /SimeonNedkov/delft-postgis
PgDay Seoul 2017
PostGIS Archtecture
15
PostgreSQL
PostGIS
Extension
GEOS
Proj4
LibXML2
LibLwGeom
Database? ?? ??? ? ?? ?? ????
Sub Library ?? Low Level? ??? ??? ???.
GDAL
??: /SimeonNedkov/delft-postgis
PgDay Seoul 2017
PostGIS Archtecture
16
PostgreSQL
PostGIS
Extension
GEOS
Proj4
LibXML2
LibLwGeom
?? ???? C++?? ???? ?????? ???
?? ??? ??? ??/?? ??? ????.
GDAL
??: /SimeonNedkov/delft-postgis
PgDay Seoul 2017
PostGIS Archtecture
17
PostgreSQL
PostGIS
Extension
GEOS
Proj4
LibXML2
LibLwGeom
??? ?? ?????? ??
??? ?? ? ??? ???? ????.
GDAL
??: /SimeonNedkov/delft-postgis
PgDay Seoul 2017
PostGIS Archtecture
18
PostgreSQL
PostGIS
Extension
GEOS
Proj4
LibXML2
LibLwGeom
XML ?????? ???
GML, KML ? XML ?? ???? ??? ???.
GDAL
??: /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;
??: /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
?´ ?´ ??? ???? C ?? ?? ??
31
ALTER TABLE
liquor_licenses
ADD Column
buffer
geometry(Polygon,4326)
? EPSG:4326
- ??? ??? ???
- GPS?? ?? ????
??
- ???? ?? ??? ?
? ?? ??
PgDay Seoul 2017
?´ ?´ ??? ???? C ?? ??? ??
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
Ad

Recommended

Mvcc in postgreSQL ???
Mvcc in postgreSQL ???
PgDay.Seoul
?
[Foss4 g2013 korea]postgis? geoserver? ??? ??? ????? ?? ??? ??? ?? ??
[Foss4 g2013 korea]postgis? geoserver? ??? ??? ????? ?? ??? ??? ?? ??
BJ Jang
?
?????????????? ????????? ??????? ??? ?????????
?????????????? ????????? ??????? ??? ?????????
?? ?
?
PGroonga 2 - PostgreSQLでの畠猟碧のQ協井
PGroonga 2 - PostgreSQLでの畠猟碧のQ協井
Kouhei Sutou
?
[Pgday.Seoul 2020] SQL Tuning
[Pgday.Seoul 2020] SQL Tuning
PgDay.Seoul
?
Airflow? ??? ??? Workflow ??
Airflow? ??? ??? Workflow ??
YoungHeon (Roy) Kim
?
???? GIS ?? - PostGIS
???? GIS ?? - PostGIS
JungHwan Yun
?
Open Source GIS ???? 4?? - GeoServer ?? 2014? 7??
Open Source GIS ???? 4?? - GeoServer ?? 2014? 7??
BJ Jang
?
???? ???? - OpenLayers? ?? ?? ?? ? ??
???? ???? - OpenLayers? ?? ?? ?? ? ??
HaNJiN Lee
?
[Pgday.Seoul 2021] 1. ??? ???? ????????? ??? SQL
[Pgday.Seoul 2021] 1. ??? ???? ????????? ??? SQL
PgDay.Seoul
?
[pgday.Seoul 2022] ?????? PostgreSQL ??? - ??? & ???
[pgday.Seoul 2022] ?????? PostgreSQL ??? - ??? & ???
PgDay.Seoul
?
Intro ProxySQL
Intro ProxySQL
I Goo Lee
?
[NDC18] ??? ? ???? ??? ????? ???: ?? ??? ?? ?? ??
[NDC18] ??? ? ???? ??? ????? ???: ?? ??? ?? ?? ??
Hyojun Jeon
?
???? ???? ?? ? ??? ?? Glue, EMR ?? - ??? ???? ????, AWS :: AWS Summit Seoul 2019
???? ???? ?? ? ??? ?? Glue, EMR ?? - ??? ???? ????, AWS :: AWS Summit Seoul 2019
Amazon Web Services Korea
?
????GIS ?? ?? - OpenLayers ??
????GIS ?? ?? - OpenLayers ??
HaNJiN Lee
?
???? ??? ??? ??? ?? ?? ?? ???? Ppt ???
???? ??? ??? ??? ?? ?? ?? ???? Ppt ???
Minji Kang
?
[2019] 200? ?? ??? ?? MySQL ??
[2019] 200? ?? ??? ?? MySQL ??
NHN FORWARD
?
MongoDB World 2015 - A Technical Introduction to WiredTiger
MongoDB World 2015 - A Technical Introduction to WiredTiger
WiredTiger
?
Naver???, ??? ??, ??? ?? ??DB (??? ?????? ??DB) [Naver]
Naver???, ??? ??, ??? ?? ??DB (??? ?????? ??DB) [Naver]
MongoDB
?
???? ??? ?? ???? ???? ??? ???? : ???
???? ??? ?? ???? ???? ??? ???? : ???
NAVER D2
?
[???] ??? ????
[???] ??? ????
Young-Ho Cho
?
PostgreSQL and RAM usage
PostgreSQL and RAM usage
Alexey Bashtanov
?
[MLOps KR ??] MLOps ?? ?? ?? ??(210605)
[MLOps KR ??] MLOps ?? ?? ?? ??(210605)
Seongyun Byeon
?
[pgday.Seoul 2022] POSTGRES ?????? ???? - ???
[pgday.Seoul 2022] POSTGRES ?????? ???? - ???
PgDay.Seoul
?
Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.
Alexey Lesovsky
?
iFunEngine: 30? ?? ?? ?? ???
iFunEngine: 30? ?? ?? ?? ???
iFunFactory Inc.
?
まずやっとく永看壊岳乙姻艶皆河晦チュ`ニング
まずやっとく永看壊岳乙姻艶皆河晦チュ`ニング
Kosuke Kida
?
???????? PostGIS ????
???????? PostGIS ????
JungHwan Yun
?
DATABASE & WEBGIS - GIS BOOTCAMP
DATABASE & WEBGIS - GIS BOOTCAMP
Kevin Ng'eno
?
Open Source Databases And Gis
Open Source Databases And Gis
Kudos S.A.S
?

More Related Content

What's hot (20)

???? ???? - OpenLayers? ?? ?? ?? ? ??
???? ???? - OpenLayers? ?? ?? ?? ? ??
HaNJiN Lee
?
[Pgday.Seoul 2021] 1. ??? ???? ????????? ??? SQL
[Pgday.Seoul 2021] 1. ??? ???? ????????? ??? SQL
PgDay.Seoul
?
[pgday.Seoul 2022] ?????? PostgreSQL ??? - ??? & ???
[pgday.Seoul 2022] ?????? PostgreSQL ??? - ??? & ???
PgDay.Seoul
?
Intro ProxySQL
Intro ProxySQL
I Goo Lee
?
[NDC18] ??? ? ???? ??? ????? ???: ?? ??? ?? ?? ??
[NDC18] ??? ? ???? ??? ????? ???: ?? ??? ?? ?? ??
Hyojun Jeon
?
???? ???? ?? ? ??? ?? Glue, EMR ?? - ??? ???? ????, AWS :: AWS Summit Seoul 2019
???? ???? ?? ? ??? ?? Glue, EMR ?? - ??? ???? ????, AWS :: AWS Summit Seoul 2019
Amazon Web Services Korea
?
????GIS ?? ?? - OpenLayers ??
????GIS ?? ?? - OpenLayers ??
HaNJiN Lee
?
???? ??? ??? ??? ?? ?? ?? ???? Ppt ???
???? ??? ??? ??? ?? ?? ?? ???? Ppt ???
Minji Kang
?
[2019] 200? ?? ??? ?? MySQL ??
[2019] 200? ?? ??? ?? MySQL ??
NHN FORWARD
?
MongoDB World 2015 - A Technical Introduction to WiredTiger
MongoDB World 2015 - A Technical Introduction to WiredTiger
WiredTiger
?
Naver???, ??? ??, ??? ?? ??DB (??? ?????? ??DB) [Naver]
Naver???, ??? ??, ??? ?? ??DB (??? ?????? ??DB) [Naver]
MongoDB
?
???? ??? ?? ???? ???? ??? ???? : ???
???? ??? ?? ???? ???? ??? ???? : ???
NAVER D2
?
[???] ??? ????
[???] ??? ????
Young-Ho Cho
?
PostgreSQL and RAM usage
PostgreSQL and RAM usage
Alexey Bashtanov
?
[MLOps KR ??] MLOps ?? ?? ?? ??(210605)
[MLOps KR ??] MLOps ?? ?? ?? ??(210605)
Seongyun Byeon
?
[pgday.Seoul 2022] POSTGRES ?????? ???? - ???
[pgday.Seoul 2022] POSTGRES ?????? ???? - ???
PgDay.Seoul
?
Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.
Alexey Lesovsky
?
iFunEngine: 30? ?? ?? ?? ???
iFunEngine: 30? ?? ?? ?? ???
iFunFactory Inc.
?
まずやっとく永看壊岳乙姻艶皆河晦チュ`ニング
まずやっとく永看壊岳乙姻艶皆河晦チュ`ニング
Kosuke Kida
?
???????? PostGIS ????
???????? PostGIS ????
JungHwan Yun
?
???? ???? - OpenLayers? ?? ?? ?? ? ??
???? ???? - OpenLayers? ?? ?? ?? ? ??
HaNJiN Lee
?
[Pgday.Seoul 2021] 1. ??? ???? ????????? ??? SQL
[Pgday.Seoul 2021] 1. ??? ???? ????????? ??? SQL
PgDay.Seoul
?
[pgday.Seoul 2022] ?????? PostgreSQL ??? - ??? & ???
[pgday.Seoul 2022] ?????? PostgreSQL ??? - ??? & ???
PgDay.Seoul
?
[NDC18] ??? ? ???? ??? ????? ???: ?? ??? ?? ?? ??
[NDC18] ??? ? ???? ??? ????? ???: ?? ??? ?? ?? ??
Hyojun Jeon
?
???? ???? ?? ? ??? ?? Glue, EMR ?? - ??? ???? ????, AWS :: AWS Summit Seoul 2019
???? ???? ?? ? ??? ?? Glue, EMR ?? - ??? ???? ????, AWS :: AWS Summit Seoul 2019
Amazon Web Services Korea
?
????GIS ?? ?? - OpenLayers ??
????GIS ?? ?? - OpenLayers ??
HaNJiN Lee
?
???? ??? ??? ??? ?? ?? ?? ???? Ppt ???
???? ??? ??? ??? ?? ?? ?? ???? Ppt ???
Minji Kang
?
[2019] 200? ?? ??? ?? MySQL ??
[2019] 200? ?? ??? ?? MySQL ??
NHN FORWARD
?
MongoDB World 2015 - A Technical Introduction to WiredTiger
MongoDB World 2015 - A Technical Introduction to WiredTiger
WiredTiger
?
Naver???, ??? ??, ??? ?? ??DB (??? ?????? ??DB) [Naver]
Naver???, ??? ??, ??? ?? ??DB (??? ?????? ??DB) [Naver]
MongoDB
?
???? ??? ?? ???? ???? ??? ???? : ???
???? ??? ?? ???? ???? ??? ???? : ???
NAVER D2
?
[MLOps KR ??] MLOps ?? ?? ?? ??(210605)
[MLOps KR ??] MLOps ?? ?? ?? ??(210605)
Seongyun Byeon
?
[pgday.Seoul 2022] POSTGRES ?????? ???? - ???
[pgday.Seoul 2022] POSTGRES ?????? ???? - ???
PgDay.Seoul
?
Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.
Alexey Lesovsky
?
まずやっとく永看壊岳乙姻艶皆河晦チュ`ニング
まずやっとく永看壊岳乙姻艶皆河晦チュ`ニング
Kosuke Kida
?
???????? PostGIS ????
???????? PostGIS ????
JungHwan Yun
?

Viewers also liked (6)

DATABASE & WEBGIS - GIS BOOTCAMP
DATABASE & WEBGIS - GIS BOOTCAMP
Kevin Ng'eno
?
Open Source Databases And Gis
Open Source Databases And Gis
Kudos S.A.S
?
Intro To PostGIS
Intro To PostGIS
mleslie
?
Building Community Information Systems with Drupal and Open Layers
Building Community Information Systems with Drupal and Open Layers
Charles Burnett
?
Using PostGIS To Add Some Spatial Flavor To Your Application
Using PostGIS To Add Some Spatial Flavor To Your Application
Steven Pousty
?
Postgres database Ibrahem Batta
Postgres database Ibrahem Batta
Ibrahem Batta
?
DATABASE & WEBGIS - GIS BOOTCAMP
DATABASE & WEBGIS - GIS BOOTCAMP
Kevin Ng'eno
?
Open Source Databases And Gis
Open Source Databases And Gis
Kudos S.A.S
?
Intro To PostGIS
Intro To PostGIS
mleslie
?
Building Community Information Systems with Drupal and Open Layers
Building Community Information Systems with Drupal and Open Layers
Charles Burnett
?
Using PostGIS To Add Some Spatial Flavor To Your Application
Using PostGIS To Add Some Spatial Flavor To Your Application
Steven Pousty
?
Postgres database Ibrahem Batta
Postgres database Ibrahem Batta
Ibrahem Batta
?
Ad

Similar to [Pgday.Seoul 2017] 1. PostGIS? ??? ? PostgreSQL ?? - ??? (20)

??SQL? ??? ?????? ????
??SQL? ??? ?????? ????
BJ Jang
?
PostGIS ????
PostGIS ????
Byeong-Hyeok Yu
?
?????? ??????? GXT? ????
?????? ??????? GXT? ????
HaNJiN Lee
?
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 ????????? ?????? ??????? ?????????? ?????? ????? ?????? (...
Chanjin Park
?
[?86? Open Technet]OGC ?? ??? ???? ??? ??? ?? ??
[?86? Open Technet]OGC ?? ??? ???? ??? ??? ?? ??
MinPa Lee
?
RxJS? ???? ????
RxJS? ???? ????
Seokju Na
?
Proj4? ??? ??? ??
Proj4? ??? ??? ??
BJ Jang
?
Geo tools Data Transfer
Geo tools Data Transfer
Jiyoon Kim
?
[FOSS4G Korea 2016] Workshop - Advanced GeoServer
[FOSS4G Korea 2016] Workshop - Advanced GeoServer
MinPa Lee
?
??? ?? ???
??? ?? ???
Lee Do hyoung
?
???????? - PyQGIS ? ???? ??
???????? - PyQGIS ? ???? ??
MinPa Lee
?
Mongodb and spatial
Mongodb and spatial
Jiyoon Kim
?
[FOSS4G Korea 2021]Workshop-QGIS-TIPS-20211028
[FOSS4G Korea 2021]Workshop-QGIS-TIPS-20211028
MinPa Lee
?
Open source engineering - 0.1
Open source engineering - 0.1
YoungSu Son
?
Popular Convention ???
Popular Convention ???
JeongHun Byeon
?
QGIS ?? (? 7??)
QGIS ?? (? 7??)
Byeong-Hyeok Yu
?
Node.js?? ??API? ???? ????
Node.js?? ??API? ???? ????
Inho Kwon
?
Portfolio
Portfolio
MyeongSeokKim2
?
??SQL? ??? ?????? ????
??SQL? ??? ?????? ????
BJ Jang
?
?????? ??????? GXT? ????
?????? ??????? GXT? ????
HaNJiN Lee
?
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 ????????? ?????? ??????? ?????????? ?????? ????? ?????? (...
Chanjin Park
?
[?86? Open Technet]OGC ?? ??? ???? ??? ??? ?? ??
[?86? Open Technet]OGC ?? ??? ???? ??? ??? ?? ??
MinPa Lee
?
RxJS? ???? ????
RxJS? ???? ????
Seokju Na
?
Proj4? ??? ??? ??
Proj4? ??? ??? ??
BJ Jang
?
Geo tools Data Transfer
Geo tools Data Transfer
Jiyoon Kim
?
[FOSS4G Korea 2016] Workshop - Advanced GeoServer
[FOSS4G Korea 2016] Workshop - Advanced GeoServer
MinPa Lee
?
???????? - PyQGIS ? ???? ??
???????? - PyQGIS ? ???? ??
MinPa Lee
?
Mongodb and spatial
Mongodb and spatial
Jiyoon Kim
?
[FOSS4G Korea 2021]Workshop-QGIS-TIPS-20211028
[FOSS4G Korea 2021]Workshop-QGIS-TIPS-20211028
MinPa Lee
?
Open source engineering - 0.1
Open source engineering - 0.1
YoungSu Son
?
Node.js?? ??API? ???? ????
Node.js?? ??API? ???? ????
Inho Kwon
?
Ad

More from PgDay.Seoul (20)

[pgday.Seoul 2022] PostgreSQL?? - ???
[pgday.Seoul 2022] PostgreSQL?? - ???
PgDay.Seoul
?
[pgday.Seoul 2022] PostgreSQL with Google Cloud
[pgday.Seoul 2022] PostgreSQL with Google Cloud
PgDay.Seoul
?
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
PgDay.Seoul
?
[Pgday.Seoul 2020] ???????? ???? ???
[Pgday.Seoul 2020] ???????? ???? ???
PgDay.Seoul
?
[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
?
[Pgday.Seoul 2019] Advanced FDW
[Pgday.Seoul 2019] Advanced FDW
PgDay.Seoul
?
[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
?
[Pgday.Seoul 2018] PostgreSQL Authentication with FreeIPA
[Pgday.Seoul 2018] PostgreSQL Authentication with FreeIPA
PgDay.Seoul
?
[Pgday.Seoul 2018] ??? DB?? PostgreSQL?? Migration? ?? DB2PG
[Pgday.Seoul 2018] ??? DB?? PostgreSQL?? Migration? ?? DB2PG
PgDay.Seoul
?
[Pgday.Seoul 2018] AWS Cloud ???? PostgreSQL ????
[Pgday.Seoul 2018] AWS Cloud ???? PostgreSQL ????
PgDay.Seoul
?
[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
?
[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
?
[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
?
[Pgday.Seoul 2017] 8. PostgreSQL 10 ??? ?? - ???
[Pgday.Seoul 2017] 8. PostgreSQL 10 ??? ?? - ???
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
?
[pgday.Seoul 2022] PostgreSQL?? - ???
[pgday.Seoul 2022] PostgreSQL?? - ???
PgDay.Seoul
?
[pgday.Seoul 2022] PostgreSQL with Google Cloud
[pgday.Seoul 2022] PostgreSQL with Google Cloud
PgDay.Seoul
?
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
[Pgday.Seoul 2021] 2. Porting Oracle UDF and Optimization
PgDay.Seoul
?
[Pgday.Seoul 2020] ???????? ???? ???
[Pgday.Seoul 2020] ???????? ???? ???
PgDay.Seoul
?
[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
?
[Pgday.Seoul 2019] Advanced FDW
[Pgday.Seoul 2019] Advanced FDW
PgDay.Seoul
?
[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
?
[Pgday.Seoul 2018] PostgreSQL Authentication with FreeIPA
[Pgday.Seoul 2018] PostgreSQL Authentication with FreeIPA
PgDay.Seoul
?
[Pgday.Seoul 2018] ??? DB?? PostgreSQL?? Migration? ?? DB2PG
[Pgday.Seoul 2018] ??? DB?? PostgreSQL?? Migration? ?? DB2PG
PgDay.Seoul
?
[Pgday.Seoul 2018] AWS Cloud ???? PostgreSQL ????
[Pgday.Seoul 2018] AWS Cloud ???? PostgreSQL ????
PgDay.Seoul
?
[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
?
[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
?
[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
?
[Pgday.Seoul 2017] 8. PostgreSQL 10 ??? ?? - ???
[Pgday.Seoul 2017] 8. PostgreSQL 10 ??? ?? - ???
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
?

[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 ̄ Cdatabase ??? ??? ??? ???? ???? ?? ? Shared Editing C?? ??? ??? ???? ??? ?? ? Performance and Scale C??? ???? ?? ???? ?? C???? GIS?? ??? ??? ??/?? ??? ???
  • 7. PgDay Seoul 2017 Spatial Database ???? 7 ?Spatial data types CGeometry(point, line, polygon ?) ? Spatial indexing C????? ??? ?? ?? ? Spatial functions, C??? ??? ?? ?? C???? ???? ?? ??: 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 ?? ??: /gis_todd/postgis-and-spatial-sql PostGISSpatialLite
  • 12. PgDay Seoul 2017 PostGIS Archtecture 12 ??: /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 ??: /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 ??: /SimeonNedkov/delft-postgis
  • 15. PgDay Seoul 2017 PostGIS Archtecture 15 PostgreSQL PostGIS Extension GEOS Proj4 LibXML2 LibLwGeom Database? ?? ??? ? ?? ?? ???? Sub Library ?? Low Level? ??? ??? ???. GDAL ??: /SimeonNedkov/delft-postgis
  • 16. PgDay Seoul 2017 PostGIS Archtecture 16 PostgreSQL PostGIS Extension GEOS Proj4 LibXML2 LibLwGeom ?? ???? C++?? ???? ?????? ??? ?? ??? ??? ??/?? ??? ????. GDAL ??: /SimeonNedkov/delft-postgis
  • 17. PgDay Seoul 2017 PostGIS Archtecture 17 PostgreSQL PostGIS Extension GEOS Proj4 LibXML2 LibLwGeom ??? ?? ?????? ?? ??? ?? ? ??? ???? ????. GDAL ??: /SimeonNedkov/delft-postgis
  • 18. PgDay Seoul 2017 PostGIS Archtecture 18 PostgreSQL PostGIS Extension GEOS Proj4 LibXML2 LibLwGeom XML ?????? ??? GML, KML ? XML ?? ???? ??? ???. GDAL ??: /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; ??: /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 ?´ ?´ ??? ???? C ?? ?? ?? 31 ALTER TABLE liquor_licenses ADD Column buffer geometry(Polygon,4326) ? EPSG:4326 - ??? ??? ??? - GPS?? ?? ???? ?? - ???? ?? ??? ? ? ?? ??
  • 32. PgDay Seoul 2017 ?´ ?´ ??? ???? C ?? ??? ?? 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;