There is no way to filter the query based on validity type via SQL. What you do have, due to the NOT ST_IsValid
condition, is a pair of equal length ordered lists of invalid geometry notices and geometries.
These two lists can be manually correlated to identify which error each geometry suffers from. Filter out theany IllegalArgumentException
, and other queries should be able to execute.