Is there a way to get the DE-9IM matrix between two geometries in a Spatialite function, analogous to the st_relate() function in PostGIS?

(I find it very helpful to spatially join using intersect() and then do a count(*) group by with the DE-9IM matrix to determine what my interesections are like, whether on the edge or not. Then I often calculate the ratio of areas for geometries that don't line up exactly to tell me about slivers.)

For reference:



1 Answer 1


It seems you miss the ST_relate function like in PostGIS. Search "relate" word in the reference functions for version 4.2. The signature will look like below :

ST_Relate( geom1 Geometry , geom2 Geometry , patternMatrix String ) : Integer

patternMatrix is the DE-9IM pattern.

PS: If your spatialite version is old, ST_relate may be named relate

  • I understood that the wish is to get the complete matrix as an answer. Spatialite returns only true/false for a given matrix.
    – user30184
    Aug 16, 2014 at 6:47
  • @user30184, you are correct. I know about the three argument version of relate, I am hoping for a two argument version. Aug 20, 2014 at 0:11
  • You should ask on the spatialite mailing list groups.google.com/forum/#!forum/spatialite-users to get further info for this two arg version availability and learn if there is a schedule for the function.
    – ThomasG77
    Aug 20, 2014 at 1:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.