SQLite Forum

Recursive CTE
Login
I know for example than in shapefiles the direction defines the shape. The right hand side of the lines defines inside and the left hand side is outside. Otherwise you would never know which side was the actual shape. If you could define it as either way you would never know if it's "this square" or "everything except this square".

[](https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry)
According to wikipedia for Well known text format anyway: "The OGC standard definition requires a polygon to be topologically closed. It also states that if the exterior linear ring of a polygon is defined in a counterclockwise direction it will be seen from the "top". Any interior linear rings should be defined in opposite fashion compared to the exterior ring, in this case, clockwise."

So the order for WKT and shape are the opposite.