MapInfo Pro Developers User Group

Welcome to the MapInfo Pro Developers community!  We are a group dedicated to the discussion and understanding of MapBasic and .Net MapInfoPro AddIn development. Bring your questions and ideas here. This group includes several members of the Pro development team from around the world.

Please feel free to start a discussion in the discussion tab or join in a conversation.

Product Information  Ideas Portal  MapInfo Community Downloads

Discussions

Members

Resources

Events

 View Only
  • 1.  What is the real Output of INTERSECTNODES

    Posted 12-09-2017 10:34

    Hi,

    i just came accross a strange Problem with the function intersectnodes.

    I have Two Tables:

    pValve: Contains one region object, made of one polygon that is made of 11 nodes.

    pPipe: Contains two polyline objects, each made of one section containing 2 points

    Both tables are stored in the same coordinate system and the session coordinate system is set accordingly.

    See AttachmentWhen i select the intersecting lines of pPipes, both lines are selected as you can see in the screenshot, - so they intersect the Region object.

    But when i now try to find out, how they intersect with this query:

    select

       pPipe.OID,

       objectinfo(intersectnodes(pPipe.obj,pValve.obj,1),20) "nCrossings",

       objectinfo(intersectnodes(pPipe.obj,pValve.obj,6),20) "nCommon",

       objectinfo(intersectnodes(pPipe.obj,pValve.obj,7),20) "nAll",

       objectinfo(intersectnodes(pPipe.obj,pValve.obj,1),21) "nPoly",

       objectinfo(intersectnodes(pPipe.obj,pValve.obj,1),22) "nPoints"

    from pPipe, pValve where (pPipe.obj intersects pValve.obj) into bb

    I get a, - from my Point of view -, strange result:

    See AttachmentAs you can see:

       - Again both pPipe-Objects get selected, so they have to intersect the pValve-Object

       - But there are no points at all in the result-Object of intersectnodes, whatever parameter i take

       - and even more astonishing, the last record: There are no intersecting nodes and no common nodes but the sum of it is one!

     

    What am i doing wrong?

    Attached you can find the two tables.

     

    I would be happy if someone could bring light into my currently clouded mind,- thanks!

    Stefan

    Attachment(s)

    zip
    Bug_Test.zip   2 KB 1 version


  • 2.  RE: What is the real Output of INTERSECTNODES

    Posted 12-10-2017 20:00
      |   view attached

    Hi Stefan, I agree this behaviour is confusing, using your data I received the same results.

    Looking at the datasets further, if you zoom in (& in & in & in) the objects don't actually intersect. They are very close but there is a distinct gap between the Pipe & Valve objects. As a test I created a new obj in the Pipe table that clearly intersected the valve (in 2 locations) and then ran the SQL select in the MapBasic window, the results were different -

    See Attachment

    this doesn't answer all your questions but hopefully provides some guidance on where to look further.



  • 3.  RE: What is the real Output of INTERSECTNODES

    Employee
    Posted 12-11-2017 07:35
      |   view attached

    I tried adding nodes to the polygon where the Pipes should intersect the Valve.

    I basically turned on snap, selected the valve, turned on Reshape and selected the Add Node tool. I now positioned my cursor so that it snapped to the end of the line (pipe) and clicked. This added a new new to the valve polygon exactly where the line ended.

    I repeated this at the other line.

    When I run you query, I now get this result telling my that each line has one node in common with the polygon:

    See Attachment



  • 4.  RE: What is the real Output of INTERSECTNODES

    Posted 12-11-2017 10:36

    Hi Ashley and Peter,

    the gap, that you can see when you zoom in, is a common program be?haviour. At the time this gap is clearly visible, the zoom of the mapwindow is normaly somewhere below 10 cm and there the Grey Zone of precision with large carthesian coordinates begins.

    But that cannot explain the program behaviour: MiPro selects the records, because they intersect the valve object, but cannot describe how.

    I cannot change the involved objects as suggested, they are originial customer datasets, - undisputable.

    I thought intersecting object have at least to cross each other or have at least one node in common, so no results of intersectnodes contradict the intersect-selection, either of these is wrong. Or am i wrong, - that was the original question.

    But thanks for looking into this issue and reproducing the results.

    best regards

    Stefan