Spatial databases, such as PostGIS, implement the DE-9IM model with function st_relate(),
which returns a string with domain of {0,1,2,F}, meaning 0=point, 1=line, 2=area, and F="empty set"...
See DE-9IM at Wikipedia.
The DE-9IM codes are not understandable for programmers and mortal users, but each code have the semantic of a list of predicates, then, it can be translated into a human-redable list of predicates.
Example: when st_relate(a,b)='FF1F0F1F2' or st_relate(a,b)='FF10F0102' or st_relate(a,b)='FF1F0F1F2' the DE-9IM code can be understood as "Intersects & Touches" or "Intersects & Touches with a point".
Is there a standard function or library that implements this translation, from a DE-9IM code to a human-readable string?
REPORT EXAMPLES: instead Report-1 I need Report-2.
Report-1 (have a standard string, but not human readable)
0F1F00102 | 2 | group 1
0F1FF0102 | 616 |
total 618
1FF00F102 | 1 | group 2
1FF0FF102 | 1 |
total 2
1FFF0FFF2 | 23 | group 3
total 23
F01FF0102 | 31 | group 4
F01FFF102 | 1 |
FF10F0102 | 42 |
FF1F00102 | 19673 |
FF1F0F1F2 | 25 |
total 19772
Report-2 (human readable... There are a SQL function to do this?)
618 | point-Intersects & point-Crosses & line-Overlaps
2 | point-Intersects & line-Crosses & line-Within & point-CoveredBy
23 | line-Equals
19772 | point-Intersects & point-Touches