Skip to content

Instantly share code, notes, and snippets.

@pigreco
Created March 22, 2018 22:01
Show Gist options
  • Save pigreco/2b358cca0a4070a06c35487a706d87bb to your computer and use it in GitHub Desktop.
Save pigreco/2b358cca0a4070a06c35487a706d87bb to your computer and use it in GitHub Desktop.
query di aggiornamento per correzione geometrie non valide istat
-- per i comuni
UPDATE Com01012018_WGS84
SET geom = MakeValid(geom)
WHERE ST_IsValid(geom) <> 1;
-- per le province:
UPDATE ProvCM01012018_WGS84
SET geom = MakeValid(geom)
WHERE ST_IsValid(geom) <> 1;
-- per le regioni:
UPDATE Reg01012018_WGS84
SET geom = MakeValid(geom)
WHERE ST_IsValid(geom) <> 1;
-- ed infine:
UPDATE RipGeo01012018_WGS84
SET geom = MakeValid(geom)
WHERE ST_IsValid(geom) <> 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment