Given two drawings of lines [a] and [b], how would I get the points where the lines intersect in Manifold 9? Apologies if this is too simple, I couldn't find any documentation in the forums or the users manual. I've tried the following:
GeomIntersectLines([S_GEOM],[O_GEOM], 0) AS [GEOM]
FROM (TABLE CALL GeomOverlayIntersecting([A], [B], 0))
I figured it out. The above query is fine.
The problem was that coordinate system metrics were different between the two drawings... I don't know if its possible to resolve this, but issues like this represent a significant barrier to new users.
Whew. I thought your SQL looked fine, I'm glad my eyes aren't completely bung.
It is easy to resolve the issue of different coordinate systems in SQL. There are loads of examples (search on CoordConverterMake) and it is well documented.
Necessary, but easy.
It would be wrong for this to be automated within SQL, because manual choices sometimes matter (e.g. about conversion paths).
It is effectively automated for transforms, of course. Default conversion paths are used. (That is not always best, but there must be some default.)
New users tend to use transforms, before SQL. That is my assumption.
I see that the problem was related to the coordinate systems and was resolved. That's great.
A minor side note: you don't have to write ... FROM (TABLE CALL ...). You can just write ... FROM CALL ..., omitting parentheses and TABLE.
The GeomIntersectLines assumes that we have two different drawings, what if we just have one drawing and trying to find the intersection points like in the uploaded project please?
Thank you all.
That's fine, you just cite the same drawing twice in the call to GeomOverlayIntersecting:
SELECT GeomIntersectLines([s_geom],[o_geom], 0) AS [geom]
FROM CALL GeomOverlayIntersecting([drawing], [drawing], 0)
WHERE [s_mfd_id] < [o_mfd_id];
The WHERE does two things: removes self-intersections ([s_mfd_id] = [o_mfd_id]) and counts each intersection only once (otherwise if [s_mfd_id] = 1 intersects [o_mfd_id] = 2, it would be counted twice, first as 1 intersecting 2, and then as 2 intersecting 1).
Thank you Adam.