MapInfo Pro

 View Only
  • 1.  Add a node to the midway point of a line (MapInfo Pro v2019)

    Posted 03-23-2022 08:18


    Does anyone know how to add one node to lines and polylines, which is placed at the midway point of the lines and polylines?

    I have found tools which can add points with a fix distance along polylines, or at the end of the polylines. But I cannot find a way to add one node at the midway point of lines and polylines.

    I have noticed that the "show line direction" places the arrow somewhat near the midway point. So, it seems like it should be possible to get the coordinates for the midway point.



    Adding a mode to each line and polyline in a network of 1000+ objects. The node should be place at the midway point of lines or polylines.

    Is there a tool, python script etc. which makes it possible to add a node to all lines and polylines in a network place at the midway point of the line and polyline?



    Software: MapInfo Pro v2019

    Niklas L
    Knowledge Community Shared Account

  • 2.  RE: Add a node to the midway point of a line (MapInfo Pro v2019)

    Posted 03-23-2022 09:07
    Hi Niklas

    I don't recall having seen such a tool. It can however be done, sure.

    The centroid is not what you are after. The centroid for a polyline is, and I quote the MapBasic Help: "If the obj_expr parameter represents a polyline object, the Centroid() function returns a point located at the midpoint of the middle segment of the polyline"

    @Uffe Kousgaard has a tool called RouteWare Toolbox that has a feature for creating points along any line or polyline. The code behind this tool is included and can be modified to meet your needs.

    Peter Horsbøll Møller
    Principal Presales Consultant | Distinguished Engineer
    Precisely | Trust in Data