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...