MapInfo Pro

 View Only
  • 1.  How to figure distance of multiple line segments

    Posted 06-18-2019 15:46
    Hey guys,

    Got a question. I am needing to know in miles the distance of several selected roads or line segments. For instance, I have 10 segments of roads selected, and I need to know how many miles long the selected roads are. I know you can double click on one road segment and get the distance of it, but I don't know how to get the combined distance of several line segments. If you all can help out, that would be great!

    ------------------------------
    Rachel Taylor
    GIS Analyst
    ------------------------------


  • 2.  RE: How to figure distance of multiple line segments
    Best Answer

    Posted 06-18-2019 18:43
    Hi @Rachel Taylor - great question!

    Like most things there's a few ways you could do this, here's one:
    • With the objects you want to measure selected, open the ​"SQL Select" dialog box & use these parameters -
      • from Tables: selection
      • Select Columns: SphericalObjectLen(obj, "mi")

    click OK. The result will be a new query table with one field & a row for each object showing the object length (in miles, change the "mi" to another unit to switch). Now open the Statistics window and you have the sum of all fields in a single total.

    ------------------------------
    Ashley Crane
    Regional Director, Software Support
    Pitney Bowes
    ------------------------------



  • 3.  RE: How to figure distance of multiple line segments

    Employee
    Posted 06-19-2019 02:48

    And building on the initial answer from @Ashley Crane​, you can use the Sum aggregation to get the sum of the object length in your query.

    Your Select Columns field will look like this: Sum(SphericalObjectLen(obj, "mi"))

    And just in case you aren't aware, the ObjectLen() function comes in a few flavours. If your data is projected, that is not using a Lat/Long coordinate system, I'd recommend that you use the CartesianObjectLen() function.



    ------------------------------
    Peter Horsbøll Møller
    Pitney Bowes
    ------------------------------



  • 4.  RE: How to figure distance of multiple line segments

    Posted 06-19-2019 10:41
    Thank you all so much! That is exactly what I needed. I knew I would using SQL Select, but I am not that familiar with the string functions and getting the correct results. Thanks for making it as easy as copy and paste.

    ------------------------------
    Rachel Taylor
    GIS Analyst
    ------------------------------