1

Is there a query to see whether a linestring is intersecting on itself in SQL Management Studio? The line will be a geometry data type.

The line string can be for example:

LINESTRING(318400 745924,318525 745908,318524 745920,318453 745912,318389 745885)
Vince
  • 20,017
  • 15
  • 45
  • 64
  • What happens when you run st_isvalid? https://docs.microsoft.com/en-us/sql/t-sql/spatial-geometry/stisvalid-geometry-data-type?view=sql-server-ver15 ? – Encomium Jun 09 '21 at 17:31

1 Answers1

2

STIsSimple should answer this question:

https://docs.microsoft.com/en-us/sql/t-sql/spatial-geometry/stissimple-geometry-data-type?view=sql-server-ver15

To be simple, a geometry instance must meet all of the following requirements:

  • Each figure of the instance must not intersect itself, except at its endpoints.
  • No two figures of the instance can intersect each other at a point that is not in both of their boundaries.
Michael Entin
  • 1,017
  • 5
  • 8