MapInfo Pro

 View Only
  • 1.  Distance from a referenced point

    Posted 07-04-2024 09:59
    Edited by Ryan Cook 07-04-2024 10:00

    Hello!

    I have a table of points called "START" with the following fields:
    ID, EndID, Dist

    I have a second table of points called END with the following fields:
    ID

    I would like to update Table START, populating the field Dist with the distance between the Start object, and the object in table END as referenced by each rows EndID. 

    Help?



    ------------------------------
    Ryan Cook
    ORH LTD
    ------------------------------



  • 2.  RE: Distance from a referenced point
    Best Answer

    Posted 07-04-2024 10:46

    Ah ignore me, my first attempt didn't work but I had my x and y mixed up like an idiot.

    FTR (although I'm sure everyone knows):

    Ensure START has X and Y coordinate fields, then

    Add Column START (EndX) From END set to Centroidx(obj) where EndID = ID
    Add Column START (EndY) From END set to Centroidy(obj) where EndID = ID
    Update START set Dist = Distance(X, Y, EndX, EndY, "m")

    Might be a quicker way of doing it but I'm cool with this. 



    ------------------------------
    Ryan Cook
    ORH LTD
    ------------------------------