Backup

PostgreSQL PostGIS ST_ConcaveHull

Backup 2022. 9. 20. 12:02

SELECT ST_ConcaveHull(ST_Collect(공간데이터), )

FROM 테이블명

 

공간데이터에 따라 값(0.5~0.8) 이하 결과가 동일하게 나올 수 있음

(값이 작을 수록 시간이 오래걸림)

 

※ST_ConcaveHull(ST_Collect(공간데이터), 1) = ST_ConvexHull(ST_Collect(공간데이터))

 

- 일부의 경우, 최소 결과 리턴( 확인 필요)

SELECT geom, geom9998, geom985, ST_Intersection(geom9998, geom985) AS geom_min

FROM (

SELECT ST_Collect(공간데이터) AS geom

,ST_Intersection(ST_ConcaveHull(ST_Collect(공간데이터), 0.99), ST_ConcaveHull(ST_Collect(공간데이터), 0.98)) AS geom9998

,ST_Intersection(ST_ConcaveHull(ST_Collect(공간데이터), 0.98), ST_ConcaveHull(ST_Collect(공간데이터), 0.5)) AS geom985

FROM 테이블명

) test

 

 

ST_ConcaveHull 비교

공간데이터 ST_ConcaveHull(ST_Collect(공간데이터), 1)
ST_ConcaveHull(ST_Collect(공간데이터), 0.99) ST_ConcaveHull(ST_Collect(공간데이터), 0.98)
ST_ConcaveHull(ST_Collect(공간데이터), 0.5) ST_ConcaveHull(ST_Collect(공간데이터), 0.1)
ST_Intersection(
ST_ConcaveHull(ST_Collect(공간데이터), 0.99)
, ST_ConcaveHull(ST_Collect(공간데이터), 0.98)
)
ST_Intersection(
ST_ConcaveHull(ST_Collect(공간데이터), 0.98)
, ST_ConcaveHull(ST_Collect(공간데이터), 0.5)
)
 
ST_Intersection(ST_Intersection(
ST_ConcaveHull(ST_Collect(공간데이터), 0.99)
, ST_ConcaveHull(ST_Collect(공간데이터), 0.98)
), ST_Intersection(
ST_ConcaveHull(ST_Collect(공간데이터), 0.98)
, ST_ConcaveHull(ST_Collect(공간데이터), 0.5)
))
 

 

test_sample_5179.csv
0.00MB

 

 

ST_ConcaveHull

Name ST_ConcaveHull — Computes a possibly concave geometry that encloses all input geometry vertices Synopsis geometry ST_ConcaveHull(geometry param_geom, float param_pctconvex, boolean param_allow_holes = false); Description A concave hull of a geometry

postgis.net

 

 

PostGIS 3.0.0 사용자 지침서

SELECT ST_AsText(ST_Snap(poly,line, ST_Distance(poly,line)*1.01)) AS polysnapped FROM (SELECT ST_GeomFromText('MULTIPOLYGON( ((26 125, 26 200, 126 200, 126 125, 26 125 ), ( 51 150, 101 150, 76 175, 51 150 )), (( 151 100, 151 200, 176 175, 151 100 )))') As

postgis.net

 

 

Geometry의 공간연산 – GIS Developer

얼마전에 했던 작업이 공간연산이였는데, 쉽게 알고만 있었고 쉽게 사용해 왔던 공간연산이 직접 하나 하나 정확하게 구분하려고 보니, 상당이 헤깔린다는 것을 알게 되었다. 또한 공간연산하

www.gisdeveloper.co.kr

 

'Backup' 카테고리의 다른 글

PostgreSQL SQL 덤프  (1) 2022.09.30
PostgreSQL Oracle FDW  (2) 2022.09.30
Hadoop 3.x Erasure Coding  (0) 2022.09.14
국가법령정보 공동활용 크롤링  (1) 2022.09.14
QGIS .shp → .csv 변환  (0) 2022.09.14