J'essaie de faire du traitement sur de très grandes couches de polygones. Cependant, je rencontre diverses erreurs de géométrie telles que:
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
J'ai essayé la fonction suggérée ici: https://trac.osgeo.org/postgis/wiki/UsersWikiCleanPolygons
pour le nettoyage des géométries, le code que j'ai utilisé étant:
UPDATE public.mytable
SET geom=cleangeometry(geom);
Avec le résultat:
ERROR: GEOSisSimple: IllegalArgumentException: This method does not support GeometryCollection arguments
et aussi
UPDATE public.valid_mytable
SET geom=ST_MakeValid(geom);
Celui-ci fonctionne, mais seulement si je change d'abord ma colonne de géométrie en géométrie
ALTER TABLE public.mytable ALTER COLUMN geom SET DATA TYPE geometry;
Ce qui me laisse alors une table qui ne fonctionne plus avec mes autres fonctions!
ERROR: Relate Operation called with a LWGEOMCOLLECTION type. This is unsupported.
J'ai essayé de remettre les colonnes en géométrie (MultiPolygon)
ALTER TABLE public.my_table ALTER COLUMN geom SET TYPE DE DONNÉES geometry (MultiPolygon);
Mais cela échoue
ERROR: Geometry type (GeometryCollection) does not match column type (MultiPolygon)
J'ai essayé de passer par PostGIS in Action (Second Ed) http://www.manning.com/obe/ mais je ne peux trouver que des fonctions pour trouver des géométries invalides, mais mon ensemble de données est si gros pour corriger cela manuellement, j'ai vraiment besoin de quelque chose qui les réparera automatiquement.
J'ai pu isoler les polygones problématiques, lorsque j'essaie d'exécuter ST_MakeValid () j'obtiens le résultat:
ERROR: Geometry type (GeometryCollection) does not match column type (MultiPolygon)
********** Error **********
ERROR: Geometry type (GeometryCollection) does not match column type (MultiPolygon)
SQL state: 22023
J'ai fait une vérification de type sur ma colonne de géométrie, et il a dit que le type était "MULTIPOLYGON"