How can you get ST_IsSimple reason and detail similar to ST_IsValidDetail in PostGIS?
When validating geometries I can use these handy functions to not only check if geometry is valid, but also the detail when not:
SELECT reason(ST_IsValidDetail(geom)) AS reason, ST_AsText(location(ST_IsValidDetail(geom))) AS location FROM my_polylines WHERE ST_IsValid(geom) = false;
This returns reason and location of the problem. I would like to get similar information for geometries where ST_IsSimple(geom) = false. Are there any PostGIS functions to achieve that? Or any guide how to achieve it through combination of PostGIS functions?
From "Ensuring OpenGIS compliancy of geometries": A LINESTRING is simple if it does not pass through the same POINT twice (except for the endpoints, in which case it is referred to as a linear ring and additionally considered closed).
So talking about LINESTRING only, there is always only one reason - 'self-intersection' (including self-overlap). The goal is to find out how many and where exactly.