What is the difference between these two queries :
select a.gid, sum(length(b.the_geom))
from polygons as a
, roads as b
where st_intersects(a.the_geom,b.the_geom)
group by a.gid ;
select a.gid, sum(length(b.the_geom))
from polygons as a
, roads as b
where st_overlaps(a.the_geom,b.the_geom)
group by a.gid ;
Where the first query is giving the correct output whereas the second query retrieves no rows at all. The road that intersects the polygons also overlaps it, right?
From the documentation of PostGIS
http://postgis.net/docs/ST_Intersects.html
http://postgis.net/docs/ST_Overlaps.html
The difference is: If two geometries overlap 100%, they do not overlap any more.
Here is a POSTGIS example: