Hi David
I think the solution lies in the difference between the different attributes for the IntersectNodes function.
- INCL_CROSSINGS: Returns points where segments cross.
- INCL_COMMON: Returns end-points of segments that overlap.
- INCL_ALL: Returns points where segments cross and points where segments overlap.
If you create a new node at the intersections, I think MapInfo sees this as an overlap, not as a crossing.
I tried changing your statements from:
PntEnd = IntersectNodes(oBaseline,oLineEnd, INCL_CROSSINGS)
to
PntEnd = IntersectNodes(oBaseline,oLineEnd, INCL_ALL)
That seemed to fixed the problem where you didn't find the node at the overlap.
Let us know if you see the same improvement.
------------------------------
Peter Horsbøll Møller
Distinguished Engineer
Pitney Bowes Software & Data
------------------------------
Original Message:
Sent: 02-06-2020 05:44
From: David Wilson
Subject: OverlayNodes and IntersectNodes
Hi Peter,
Unfortunately not, the coordinate system is set.
In this particular case I'm using 2 kerb lines and splitting them by 4 cross lines, so calling this routine 4 times. It fails about once out of 4 occasions.
All the objects are usually derived objects stored in variables, not based on objects from an actual table.
I've basically taken the MapX code I had using 'FeatureFactory.IntersectionTest' and 'FeatureFactory.IntersectionPoints' and moved it into MapBasic.
I've attached some of the geometry code used, but the same procedure works on some lines but not others.
Cheers
David
------------------------------
David Wilson
Buchanan Computing
London, UK
Original Message:
Sent: 02-06-2020 05:08
From: Peter Horsbøll Møller
Subject: OverlayNodes and IntersectNodes
Hi David
Could it be something as basic as not specifying the coordinate system?
------------------------------
Peter Horsbøll Møller
Distinguished Engineer
Pitney Bowes Software & Data
Original Message:
Sent: 02-05-2020 11:48
From: David Wilson
Subject: OverlayNodes and IntersectNodes
Hi
Using MB17 and MapInfo v17.02
I have 2 polylines (although only 2 pnts) that cross another polyline.
I'm trying to get the points along the main line between the two crossing lines.
But quite often the overlaynodes and intersectnodes does not return anything.
Basically I use:
'add nodes to base line
oBaseline = OverlayNodes(oBaseline,oLineStart)
'repeat other cross line
oBaseline = OverlayNodes(oBaseline,oLineEnd)
PntStart = IntersectNodes(oBaseline,oLineStart, INCL_CROSSINGS)
PntEnd = IntersectNodes(oBaseline,oLineEnd, INCL_CROSSINGS)
But occasionally PntStart or PntEnd has no points, as in the case below, the top crossing line hasn't generated any nodes on the vertical base line..
Has anyone else had this problem?
If I do the process manually within MapInfo it works.
Cheers
David
------------------------------
David Wilson
Buchanan Computing
London, UK
------------------------------