﻿{"id":6873,"date":"2018-11-07T00:32:31","date_gmt":"2018-11-06T23:32:31","guid":{"rendered":"http:\/\/www.sigterritoires.fr\/?p=6873"},"modified":"2021-03-09T08:05:10","modified_gmt":"2021-03-09T07:05:10","slug":"gis-tools-for-validating-geometries-2-spatialite-and-postgis","status":"publish","type":"post","link":"https:\/\/www.sigterritoires.fr\/index.php\/en\/gis-tools-for-validating-geometries-2-spatialite-and-postgis\/","title":{"rendered":"GIS tools for validating geometries (2): Spatialite and PostGis"},"content":{"rendered":"\n<p>In the previous article (<a href=\"https:\/\/translate.google.com\/translate?hl=en&amp;prev=_t&amp;sl=auto&amp;tl=en&amp;u=http:\/\/www.sigterritoires.fr\/index.php\/les-outils-sig-de-validation-des-geometries-1\/\">GIS Tools for validating geometries (1)<\/a>) we\nprocessed the Italian Communes layer (com2011.shp) with the ArcMap geometry\nchecker. We did not detect any anomalies. <\/p>\n\n\n\n<p>Now, let&rsquo;s load this layer into a Spatialite database and see what we\nfind. As previously stated, this applies to a <a href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/starting-with-postgres-postgis\/\">PostGIS<\/a> database; the SQL queries\nused being strictly the same. <\/p>\n\n\n\n<!--more-->\n\n\n\n<p><strong>Validating geometries with Spatialite<\/strong> <strong>and<\/strong> <strong>PostGis<\/strong> <\/p>\n\n\n\n<p>You will find the few available references for validating geometries with\nSpatialite in this page: <a href=\"https:\/\/translate.google.com\/translate?hl=en&amp;prev=_t&amp;sl=auto&amp;tl=en&amp;u=https:\/\/www.gaia-gis.it\/fossil\/libspatialite\/info\/0978ac2017454733\">https:\/\/www.gaia-gis.it\/fossil\/libspatialite\/info\/0978ac2017454733<\/a>\n. Regarding PostGis there&rsquo;s a little bit more in the following page <a href=\"https:\/\/translate.google.com\/translate?hl=en&amp;prev=_t&amp;sl=auto&amp;tl=en&amp;u=http:\/\/postgis.net\/docs\/using_postgis_dbmanagement.html%23OGC_Validity#OGC_Validity\">http:\/\/postgis.net\/docs\/using_postgis_dbmanagement.html#OGC_Validity<\/a>\n<\/p>\n\n\n\n<p>GEOS (and therefore SpatiaLite) supports the SQL ST_ IsValid ( )\nfunction. By using this function, you can easily identify all deceiving\ngeometries in your tables. But this function does not solve the problems. <br>\nSpatiaLite supported, in previous versions, an SQL ST_SeritizeGeometry ( )\nfunction. But this function made it possible to treat a small number of\nanomalies. <br>\nNow, thanks to the integration of the library <strong><em>liblwgeom<\/em><\/strong> , SpatiaLite\ncan support the function ST_ MakeValid ( ), identical to that supported by\nPostGIS. <\/p>\n\n\n\n<p>For our example, we have created an empty spatial basis, loaded the\ncom2011.shp layer and defined the geometry field. If you need help to do this,\nplease refer to this article: &nbsp; <a href=\"https:\/\/translate.google.com\/translate?hl=en&amp;prev=_t&amp;sl=auto&amp;tl=en&amp;u=http:\/\/www.sigterritoires.fr\/index.php\/creer-une-base-de-donnees-spatialite-avec-qgis-2-8\/\">Creating a spatial Spatialite database<\/a> if using\nQGis or this article <a href=\"https:\/\/translate.google.com\/translate?hl=en&amp;prev=_t&amp;sl=auto&amp;tl=en&amp;u=http:\/\/www.sigterritoires.fr\/index.php\/arcgisqgis-comment-partager-les-donnees\/\">Share the data between ArcGis and QGis<\/a> if using\nArcGis. <\/p>\n\n\n\n<p>For the rest of the example, we will first use QGis to execute SQL\nqueries in the Spatialite database, then we will explain how to do it when\nusing ArcMap. <\/p>\n\n\n\n<p><strong>Detecting geometry anomalies with QGis<\/strong> <\/p>\n\n\n\n<p>The first SQL query to execute is the one that allows you to check and\ndetect geometry anomalies. The ST_IsValid function performs this detection. <strong><em>SELECT<\/em><\/strong><strong><em>Count (<\/em><\/strong><strong><em>*)<\/em><\/strong><br><strong><em>FROM com2011<\/em><\/strong><br><strong><em>WHERE ST_IsValid (geometry) = 0;<\/em><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"525\" height=\"389\" data-attachment-id=\"6875\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/gis-tools-for-validating-geometries-2-spatialite-and-postgis\/v21\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v21.png?fit=525%2C389&amp;ssl=1\" data-orig-size=\"525,389\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"v21\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v21.png?fit=525%2C389&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v21.png?resize=525%2C389&#038;ssl=1\" alt=\"\" class=\"wp-image-6875\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v21.png?w=525&amp;ssl=1 525w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v21.png?resize=300%2C222&amp;ssl=1 300w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/figure>\n\n\n\n<p>You will find that 19 municipalities have anomalies. <\/p>\n\n\n\n<p>To find out which communes are concerned, just run the query: <strong><em>SELECT nome_com<\/em><\/strong><br><strong><em>FROM com2011<\/em><\/strong><br><strong><em>WHERE ST_<\/em><\/strong><strong><em>IsValid (<\/em><\/strong><strong><em>geom) = 0;<\/em><\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"525\" height=\"388\" data-attachment-id=\"6876\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/gis-tools-for-validating-geometries-2-spatialite-and-postgis\/v22\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v22.png?fit=525%2C388&amp;ssl=1\" data-orig-size=\"525,388\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"v22\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v22.png?fit=525%2C388&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v22.png?resize=525%2C388&#038;ssl=1\" alt=\"\" class=\"wp-image-6876\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v22.png?w=525&amp;ssl=1 525w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v22.png?resize=300%2C222&amp;ssl=1 300w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/figure>\n\n\n\n<p>SQL queries are not very explanatory. If you want to know what the\ndetected error is, you must search in your GIS. \n\nThe first mistake concerns the commune of\nSannicandro di Bari. \n\n\n\n<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"525\" height=\"237\" data-attachment-id=\"6877\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/gis-tools-for-validating-geometries-2-spatialite-and-postgis\/v23\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v23.png?fit=525%2C237&amp;ssl=1\" data-orig-size=\"525,237\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"v23\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v23.png?fit=525%2C237&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v23.png?resize=525%2C237&#038;ssl=1\" alt=\"\" class=\"wp-image-6877\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v23.png?w=525&amp;ssl=1 525w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v23.png?resize=300%2C135&amp;ssl=1 300w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/figure>\n\n\n\n<p>The anomaly is \u00a0\u00bb &nbsp; visible &nbsp; \u00ab\u00a0. This commune polygon\ncontains another polygon included. Most likely the meaning of both polygons is\nnot opposite. \n\nFor the Trieste commune, the next one, it is\nmore difficult to find at first sight. \n\n\n\n<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"525\" height=\"310\" data-attachment-id=\"6878\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/gis-tools-for-validating-geometries-2-spatialite-and-postgis\/v24\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v24.png?fit=525%2C310&amp;ssl=1\" data-orig-size=\"525,310\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"v24\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v24.png?fit=525%2C310&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v24.png?resize=525%2C310&#038;ssl=1\" alt=\"\" class=\"wp-image-6878\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v24.png?w=525&amp;ssl=1 525w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v24.png?resize=300%2C177&amp;ssl=1 300w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/figure>\n\n\n\n<p>Here, as well, we find an inner polygon. Instead of two polygons, one\nfor the outer ring and another for the inner ring, it has been built with a\nsingle ring. This is possible because the edge of the inner polygon consists of\na single point. <\/p>\n\n\n\n<p><strong>Detecting anomalies with ArcMap<\/strong> <\/p>\n\n\n\n<p>In QGis you have an SQL window to execute queries, available in the\nDatabase Manager panel. <\/p>\n\n\n\n<p>In ArcMap, there is nothing similar. So at first glance you cannot\nexecute SQL queries in the Spatialite database. <\/p>\n\n\n\n<p>Remind that you load a Spatialite layer directly into ArcMap without\ngoing through any database connection. \n\nBut if we think about it more thoroughly, the\nattribute queries we perform with ArcMap are actually SQL queries. Even if it\nis not documented, you can run the ST_ IsValid ( ) query simply from an <strong><em>Attribute\nSelection<\/em><\/strong> window!&nbsp; &nbsp;\n\n\n\n<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"525\" height=\"221\" data-attachment-id=\"6879\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/gis-tools-for-validating-geometries-2-spatialite-and-postgis\/v25\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v25.png?fit=525%2C221&amp;ssl=1\" data-orig-size=\"525,221\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"v25\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v25.png?fit=525%2C221&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v25.png?resize=525%2C221&#038;ssl=1\" alt=\"\" class=\"wp-image-6879\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v25.png?w=525&amp;ssl=1 525w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v25.png?resize=300%2C126&amp;ssl=1 300w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/figure>\n\n\n\n<p>You will notice the result of the query: the 19 communes with anomalies\nare the same ones we found when using QGis. <\/p>\n\n\n\n<p><strong>Automatic correction of errors<\/strong> <\/p>\n\n\n\n<p>First, let&rsquo;s get things straight. Automatic correction, being automatic,\ndoes not involve the human operator. The solution that will be applied is not\nnecessarily the right one, but it is one that will make the geometry valid. <\/p>\n\n\n\n<p>In the case of the commune of Trieste, it is obvious that at the time of\nthe digitization of the bottom of the sound, the operator has selected two\npoints too close that have merged, closing the last small end of the sound. The\ncorrect solution would be to duplicate the point in question and to separate\nthese two points, so that there is no inner polygon. But this cannot be\ndetermined by an automatic correction. <\/p>\n\n\n\n<p>What the automatic correction will do will be to respect the placement\nof the existing points. It will duplicate the point in question by assigning\none to the outer polygon, the other to the inner polygon. Then it will reverse\nthe order of the inner points so that they respect the rule that the direction\nof the interior polygons must be counter clockwise (and the outer rings clockwise).\n<\/p>\n\n\n\n<p>By applying this solution, even if we do not approach the reality of the\nfield, at least the geometry will respect the rules and will no longer be\nconsidered as erroneous. <\/p>\n\n\n\n<p>To correct the geometries you have an SQL query using the function <strong>ST_<\/strong>\n<strong>MakeValid (<\/strong> <strong>)<\/strong> : <\/p>\n\n\n\n<p><strong>UPDATE com2011 SET geom = ST_<\/strong> <strong>MakeValid (<\/strong> <strong>geom)<\/strong> <br>\n<strong>WHERE ST_IsValid (geom) = 0;<\/strong> <\/p>\n\n\n\n<p>But depending on the software used, this function will or will not be\nimplemented. <\/p>\n\n\n\n<p>When using ArcMap, the SQL is limited to SELECT clauses. Since we want\nto make an UPDATE, this is not possible in the Attribute Selection windows. <\/p>\n\n\n\n<p>Under QGis it is not straight away with the Spatialite database manager.\nYou have to go through a plugin: \u00a0\u00bb &nbsp; Processing LWGEOM provider\n&nbsp; \u00ab\u00a0. &nbsp; Once installed, you will have at your disposal lwgeom as\nan algorithm provider in the Treatment Toolbox. <\/p>\n\n\n\n<p>Small, or rather big, hic: No way in version 2.8 to correct the existing\ntable. You have to create a new layer &#8230; of shape type. Even if you select the\nspatialite format as output, it is bugged and you have a shape. <\/p>\n\n\n\n<p>While waiting for it to be corrected, anyway what we are looking for is\nto correct an existing table. Here is the simplest, although there must be\nother solutions. <\/p>\n\n\n\n<p>Download the spatialite_gui executable. This is provided by the project\nthat develops Spatialite and therefore has all the necessary implementations,\nup to date. It does not need installation; you download and run the .exe file\nby double-clicking. <\/p>\n\n\n\n<p>The download address is <a href=\"https:\/\/translate.google.com\/translate?hl=en&amp;prev=_t&amp;sl=auto&amp;tl=en&amp;u=http:\/\/www.gaia-gis.it\/gaia-sins\/windows-bin-x86\/\">http:\/\/www.gaia-gis.it\/gaia-sins\/windows-bin-x86\/<\/a>\nand the file to download is the one that starts with <strong><em>spatialite_gui_<\/em><\/strong>\n&#8230; <\/p>\n\n\n\n<p>Currently, you can download it by clicking here directly: spatialite_gui-1.8.0-devel-win-x86.7z \n\nIf we execute the geometry verification SQL\nquery, we see the same result as before: \n\n\n\n<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"525\" height=\"389\" data-attachment-id=\"6880\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/gis-tools-for-validating-geometries-2-spatialite-and-postgis\/v26\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v26.png?fit=525%2C389&amp;ssl=1\" data-orig-size=\"525,389\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"v26\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v26.png?fit=525%2C389&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v26.png?resize=525%2C389&#038;ssl=1\" alt=\"\" class=\"wp-image-6880\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v26.png?w=525&amp;ssl=1 525w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v26.png?resize=300%2C222&amp;ssl=1 300w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/figure>\n\n\n\n<p>We now execute the geometry correction request: \n\n\n\n<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"525\" height=\"393\" data-attachment-id=\"6881\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/gis-tools-for-validating-geometries-2-spatialite-and-postgis\/v27\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v27.png?fit=525%2C393&amp;ssl=1\" data-orig-size=\"525,393\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"v27\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v27.png?fit=525%2C393&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v27.png?resize=525%2C393&#038;ssl=1\" alt=\"\" class=\"wp-image-6881\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v27.png?w=525&amp;ssl=1 525w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v27.png?resize=300%2C225&amp;ssl=1 300w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/figure>\n\n\n\n<p>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nFinally,\nwe re-execute the geometry validation request: &nbsp;&nbsp;\n\n\n\n<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"525\" height=\"394\" data-attachment-id=\"6882\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/gis-tools-for-validating-geometries-2-spatialite-and-postgis\/v28\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v28.png?fit=525%2C394&amp;ssl=1\" data-orig-size=\"525,394\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"v28\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v28.png?fit=525%2C394&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v28.png?resize=525%2C394&#038;ssl=1\" alt=\"\" class=\"wp-image-6882\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v28.png?w=525&amp;ssl=1 525w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2018\/11\/v28.png?resize=300%2C225&amp;ssl=1 300w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/figure>\n\n\n\n<p>The 19 geometries containing anomalies have been corrected. <\/p>\n\n\n\n<p>In the next article we will see how to do the same for a Spatialite\ndatabase, but this time with any GIS format. We will be using Safe Software&rsquo;s\nFME software. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the previous article (GIS Tools for validating geometries (1)) we processed the Italian Communes layer (com2011.shp) with the ArcMap geometry checker. We did not detect any anomalies. Now, let&rsquo;s load this layer into a Spatialite&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"give_campaign_id":0,"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"sfsi_plus_gutenberg_text_before_share":"","sfsi_plus_gutenberg_show_text_before_share":"","sfsi_plus_gutenberg_icon_type":"","sfsi_plus_gutenberg_icon_alignemt":"","sfsi_plus_gutenburg_max_per_row":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1260],"tags":[],"class_list":["post-6873","post","type-post","status-publish","format-standard","hentry","category-non-classe-en"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p6XU0A-1MR","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/posts\/6873","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/comments?post=6873"}],"version-history":[{"count":0,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/posts\/6873\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/media?parent=6873"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/categories?post=6873"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/tags?post=6873"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}