Last active 1756701004

OGG revised this gist 1756701004. Go to revision

1 file changed, 1 insertion, 1 deletion

inValid Geometry \355\225\264\352\262\260.md"

@@ -7,7 +7,7 @@ postgresql의 ST_Intersects()를 사용중 아래와 같이 오류가 발생했
7 7 ST_IsValid()함수를 이용하여 어떤놈들인지 찾아본다.
8 8
9 9 ```sql
10 - select pnu from lsmd_cont_ldreg where ST_IsValid(geom)
10 + select pnu from lsmd_cont_ldreg where not ST_IsValid(geom)
11 11 ```
12 12
13 13 이놈들을 ST_MakeValid()이용해 유효한 geom으로 업데이트해준다.

OGG revised this gist 1753925795. Go to revision

1 file changed, 1 insertion, 1 deletion

inValid Geometry \355\225\264\352\262\260.md"

@@ -18,7 +18,7 @@ set geom = ST_MakeValid(geom)
18 18 where not ST_IsValid(geom)
19 19 ```
20 20
21 - 깔끔하게 해결될 줄 알았지만 여전히 동일한 오류가 발생했다.
21 + 깔끔하게 처리될 줄 알았지만 여전히 동일한 오류가 발생했다.
22 22 나머지 유효하지않은 데이터들은 약간의 보정값을 주어 해결했다.
23 23
24 24 ```sql

OGG revised this gist 1753925713. Go to revision

1 file changed, 15 insertions

inValid Geometry \355\225\264\352\262\260.md"

@@ -16,4 +16,19 @@ select pnu from lsmd_cont_ldreg where ST_IsValid(geom)
16 16 update lsmd_cont_ldreg
17 17 set geom = ST_MakeValid(geom)
18 18 where not ST_IsValid(geom)
19 + ```
20 +
21 + 깔끔하게 해결될 줄 알았지만 여전히 동일한 오류가 발생했다.
22 + 나머지 유효하지않은 데이터들은 약간의 보정값을 주어 해결했다.
23 +
24 + ```sql
25 + UPDATE lsmd_cont_ldreg a
26 + SET geom = b.cleaned_geom
27 + FROM (
28 + SELECT pnu, ST_Union(ST_Buffer(geom, 0.0000001)) AS cleaned_geom
29 + FROM lsmd_cont_ldreg
30 + WHERE pnu IN (SELECT pnu FROM invalid_ldreg)
31 + GROUP BY pnu
32 + ) b
33 + WHERE a.pnu = b.pnu;
19 34 ```

OGG revised this gist 1753925620. Go to revision

1 file changed, 2 insertions, 1 deletion

inValid Geometry \355\225\264\352\262\260.md"

@@ -10,7 +10,8 @@ ST_IsValid()함수를 이용하여 어떤놈들인지 찾아본다.
10 10 select pnu from lsmd_cont_ldreg where ST_IsValid(geom)
11 11 ```
12 12
13 - 이놈들을 이용해 유효한 geom으로 업데이트해준다.
13 + 이놈들을 ST_MakeValid()이용해 유효한 geom으로 업데이트해준다.
14 + (단, geom이 없어질수도, 하나의pnu에 여러 geom이 생기거나 예기치 못한 방식으로 처리될 수 있으니 주의바람)
14 15 ```sql
15 16 update lsmd_cont_ldreg
16 17 set geom = ST_MakeValid(geom)

OGG revised this gist 1753925559. Go to revision

1 file changed, 9 insertions, 1 deletion

inValid Geometry \355\225\264\352\262\260.md"

@@ -1,10 +1,18 @@
1 1 postgresql의 ST_Intersects()를 사용중 아래와 같이 오류가 발생했다.
2 -
3 2 ```
4 3 오류 발생: SQLSTATE = XX000, SQLERRM = GEOSIntersects: TopologyException: side location conflict at 298600.73221767566 264940.33694780665. This can occur if the input geometry is invalid.
5 4 ```
5 +
6 6 유효하지않은 geom이 존재한다고 한다.
7 + ST_IsValid()함수를 이용하여 어떤놈들인지 찾아본다.
7 8
8 9 ```sql
9 10 select pnu from lsmd_cont_ldreg where ST_IsValid(geom)
11 + ```
12 +
13 + 이놈들을 이용해 유효한 geom으로 업데이트해준다.
14 + ```sql
15 + update lsmd_cont_ldreg
16 + set geom = ST_MakeValid(geom)
17 + where not ST_IsValid(geom)
10 18 ```

OGG revised this gist 1753925408. Go to revision

1 file changed, 4 insertions, 1 deletion

inValid Geometry \355\225\264\352\262\260.md"

@@ -3,5 +3,8 @@ postgresql의 ST_Intersects()를 사용중 아래와 같이 오류가 발생했
3 3 ```
4 4 오류 발생: SQLSTATE = XX000, SQLERRM = GEOSIntersects: TopologyException: side location conflict at 298600.73221767566 264940.33694780665. This can occur if the input geometry is invalid.
5 5 ```
6 -
7 6 유효하지않은 geom이 존재한다고 한다.
7 +
8 + ```sql
9 + select pnu from lsmd_cont_ldreg where ST_IsValid(geom)
10 + ```

OGG revised this gist 1753925309. Go to revision

1 file changed, 7 insertions

inValid Geometry \355\225\264\352\262\260.md" (file created)

@@ -0,0 +1,7 @@
1 + postgresql의 ST_Intersects()를 사용중 아래와 같이 오류가 발생했다.
2 +
3 + ```
4 + 오류 발생: SQLSTATE = XX000, SQLERRM = GEOSIntersects: TopologyException: side location conflict at 298600.73221767566 264940.33694780665. This can occur if the input geometry is invalid.
5 + ```
6 +
7 + 유효하지않은 geom이 존재한다고 한다.
Newer Older