매우 큰 다각형 레이어에서 처리하려고합니다. 그러나 다음과 같은 다양한 기하학 오류가 발생합니다.
NOTICE: Ring Self-intersection at or near point 470396.52017068537 141300.52235257279
CONTEXT: PL/pgSQL function st_intersection(geometry,raster,integer) line 10 at RETURN QUERY
SQL function "st_intersection" statement 1
NOTICE: Ring Self-intersection at or near point 504154.61769969884 140782.04115761846
CONTEXT: PL/pgSQL function st_intersection(geometry,raster,integer) line 10 at RETURN QUERY
SQL function "st_intersection" statement 1
NOTICE: Ring Self-intersection at or near point 505255.50242871145 140803.34860398644
CONTEXT: PL/pgSQL function st_intersection(geometry,raster,integer) line 10 at RETURN QUERY
SQL function "st_intersection" statement 1
NOTICE: Ring Self-intersection at or near point 510312.46970004693 141215.29256710084
CONTEXT: PL/pgSQL function st_intersection(geometry,raster,integer) line 10 at RETURN QUERY
SQL function "st_intersection" statement 1
NOTICE: Ring Self-intersection at or near point 510312.46970004693 141215.29256710084
CONTEXT: PL/pgSQL function st_intersection(geometry,raster,integer) line 10 at RETURN QUERY
SQL function "st_intersection" statement 1
NOTICE: Ring Self-intersection at or near point 511839.50335641927 141115.85781738357
CONTEXT: PL/pgSQL function st_intersection(geometry,raster,integer) line 10 at RETURN QUERY
SQL function "st_intersection" statement 1
NOTICE: Ring Self-intersection at or near point 515064.03024010791 140895.68087158105
CONTEXT: PL/pgSQL function st_intersection(geometry,raster,integer) line 10 at RETURN QUERY
SQL function "st_intersection" statement 1
NOTICE: Ring Self-intersection at or near point 519233.18724611058 140881.47590733573
CONTEXT: PL/pgSQL function st_intersection(geometry,raster,integer) line 10 at RETURN QUERY
SQL function "st_intersection" statement 1
NOTICE: Ring Self-intersection at or near point 521072.73011588014 141044.83299615697
CONTEXT: PL/pgSQL function st_intersection(geometry,raster,integer) line 10 at RETURN QUERY
SQL function "st_intersection" statement 1
NOTICE: Ring Self-intersection at or near point 523331.31943088671 141144.26774587421
CONTEXT: PL/pgSQL function st_intersection(geometry,raster,integer) line 10 at RETURN QUERY
SQL function "st_intersection" statement 1
NOTICE: Ring Self-intersection at or near point 523331.31943088671 141144.26774587424
CONTEXT: PL/pgSQL function st_intersection(geometry,raster,integer) line 10 at RETURN QUERY
SQL function "st_intersection" statement 1
NOTICE: Ring Self-intersection at or near point 523395.24176999065 140725.22130063715
CONTEXT: PL/pgSQL function st_intersection(geometry,raster,integer) line 10 at RETURN QUERY
SQL function "st_intersection" statement 1
NOTICE: Ring Self-intersection at or near point 524531.63890961662 140810.45108610913
CONTEXT: PL/pgSQL function st_intersection(geometry,raster,integer) line 10 at RETURN QUERY
SQL function "st_intersection" statement 1
나는 여기에 제안 된 기능을 시도했다 : https://trac.osgeo.org/postgis/wiki/UsersWikiCleanPolygons
지오메트리를 청소하기 위해 내가 사용한 코드는 다음과 같습니다.
UPDATE public.mytable
SET geom=cleangeometry(geom);
결과 :
ERROR: GEOSisSimple: IllegalArgumentException: This method does not support GeometryCollection arguments
그리고 또한
UPDATE public.valid_mytable
SET geom=ST_MakeValid(geom);
이것은 작동하지만 형상 열을 형상으로 처음 변경하는 경우에만 작동합니다
ALTER TABLE public.mytable ALTER COLUMN geom SET DATA TYPE geometry;
그러면 다른 기능과 더 이상 작동하지 않는 테이블이 생깁니다!
ERROR: Relate Operation called with a LWGEOMCOLLECTION type. This is unsupported.
열을 기하학으로 다시 변경하려고했습니다 (MultiPolygon)
ALTER TABLE public.my_table ALTER COLUMN geom SET DATA TYPE geometry (멀티 폴리곤);
그러나 이것은 실패
ERROR: Geometry type (GeometryCollection) does not match column type (MultiPolygon)
PostGIS in Action (Second Ed) http://www.manning.com/obe/를 통해 시도했지만 유효하지 않은 형상을 찾는 기능 만 찾을 수 있지만 데이터 세트가 너무 커서 수동으로 해결할 수는 없습니다. 자동으로 고칠 무언가가 필요합니다.
ST_MakeValid ()를 시도하고 실행할 때 문제가있는 다각형을 격리 할 수있었습니다. 결과가 나타납니다.
ERROR: Geometry type (GeometryCollection) does not match column type (MultiPolygon)
********** Error **********
ERROR: Geometry type (GeometryCollection) does not match column type (MultiPolygon)
SQL state: 22023
형상 열에서 유형 검사를 수행 한 결과 유형이 "MULTIPOLYGON"