What is strange if the intersection result is a point ?
The intersect predicate is
Returns True if the boundary and interior of the object intersect in any way with those of the other.
With a common point between the geometries, the intersects predicate returns TRUE because the boundary of the first geometry intersects the boundary of the second geometry at this point. The result is always this point
from shapely.geometry import LineString, Polygon
from shapely.wkt import loads
Line1 = loads("LINESTRING ({0} {0}, {1} {0})".format(0, 1))
Line2 = loads("LINESTRING ({1} {0}, {2} {0})".format(0, 1, 2))
Line1.intersects(Line2)
True
Line1.touches(Line2)
True
Line1.intersection(Line2).wkt
'POINT (1 0)'
# polygons
polygon1 = loads('POLYGON (( 140 360, 140 480, 220 480, 220 360, 140 360 ))')
polygon2 = loads('POLYGON (( 220 260, 220 360, 300 360, 300 260, 220 260 ))')
polygon1.intersection(polygon2).wkt
'POINT (220 360)'
In your case the resulting layer is an ogr.wkbPoint
If you change the value of the point, the result is
polygon3 = loads('POLYGON (( 220 260, 220 370, 300 360, 300 260, 220 260 ))')
polygon1.intersection(polygon3).wkt
'LINESTRING (220 370, 220 360)'
Or
polygon4 = loads('POLYGON ((220 260, 200 370, 300 360, 300 260, 220 260))')
polygon1.intersection(polygon4).wkt
'POLYGON ((220 368, 220 360, 201.8181818181818 360, 200 370, 220 368))'
UPDATE 2: With Shapely, there is no problem to clip a roads Shapefile using a polygon even if the road vertex points and the edge of the polygon coincide
roads = loads('LineString (220 360, 120 468)')
polygon1.intersection(roads).wkt
'LINESTRING (220 360, 140 446.4)'
The problem is generated with invalid geometries, which is not exactly what the geometry checker plugin is analyzing.
At this moment, QGIS has an excellent tool called Fix Geometries, following the method of the ST_MakeValid function of PostGIS.
Once you have all valid geometries, you will notice that the performance of the Geometry Checker plugin, as well as many other components of the platform that also require working with valid geometries, is as expected.
Best Answer
For me it seems that both tools give correct results. The difference is that the OGR IsValid function does not apply any tolerance but the QGIS Check Geometries tool is using a tolerance of 1E-8 by default.
For example QGIS tool reports duplicate points at place
82.762954,46.935208
. Actually there are two distinct vertices with coordinatesWhen the tolerance of 1E-8 is applied the coordinates are the same.
One of the self-contact cases look like this
Actually the polygon ring does not touch itself but there is just a very narrow intruding spike
It is possible to emulate the QGIS behavior with tolerance by using ST_SnapToGrid function https://postgis.net/docs/en/ST_SnapToGrid.html that rounds the coordinates but does not care if the new geometry is valid or not. Notice the difference to ST_ReducePrecion https://postgis.net/docs/en/ST_ReducePrecision.html that returns valid geometries. I linked the PostGIS manual pages instead of the SpatiaLite reference https://www.gaia-gis.it/gaia-sins/spatialite-sql-latest.html because PostGIS pages are more detailed. Both are using the same GEOS functions and are therefore equivalent.
A simple test ogrinfo and the data that you provided
Valid geometry if tolerance is not used
Applying tolerance makes the geometry invalid