turn line data into points and identifying which is the start/end point

111 views
Skip to first unread message

Jamie

unread,
Dec 6, 2012, 7:48:24 AM12/6/12
to mapi...@googlegroups.com
Is there a way to add points to the start and end of a line and add information as to whether they are the start of end of the line?

using vertical mapper i can create points at the start and end of each line (vertical mapper > create grid > poly-to-point) but i'm not sure how i'd go about adding information to say which was the starting point and which was the end point.

MapInfo must have this information as you can tick the show line direction box to add arrows to the lines. is there anyway to extract this information to point data?


background.
i have been given some sewer records - as lines
i have also been given the manholes for the network - as points

i need to import this data into some hydraulic modelling software (InfoWorks CS), but in order to do this i need to know which node is the up/down stream reference for each pipe in the network.

ideally i'd like to end up with each sewer pipe (line) having an extra two columns containing the manhole reference for the upstream and downstream node id's
Message has been deleted

Jamie

unread,
Dec 6, 2012, 7:51:10 AM12/6/12
to mapi...@googlegroups.com
Capture.PNG

Peter Horsbøll Møller

unread,
Dec 6, 2012, 9:03:43 AM12/6/12
to MapInfo-L
Jamie

You can use ObjectNodeX() and ObjectNodeY() to extract coordinates from your polylines.

So you could do a number of things with this knowledge:

1. Add four extra columns to your wsewer records for your start and end points
You can update these with the coordinates using this statement:

Update SEWER
   Set FROMX = ObjectNodeX(OBJ, 1, 1),
         FROMY = ObjectNodeY(OBJ, 1, 1),
         TOX = ObjectNodeX(OBJ, 1, ObjectInfo(OBJ, 20)),
         TOY = ObjectNodeY(OBJ, 1, ObjectInfo(OBJ, 20))

2. Create a copy of your sewer table and call it startnode and then update this with a point for the start node:

Update StartNode
   Set Obj = CreatePoint(ObjectNodeX(OBJ, 1, 1),ObjectNodeY(OBJ, 1, 1))

and make a similar copy for the endnodes:

Update StartNode
   Set Obj = CreatePoint(ObjectNodeX(OBJ, 1, ObjectInfo(OBJ, 20)),ObjectNodeY(OBJ, 1, ObjectInfo(OBJ, 20)))

Maybe this gets you started.

If you run the statements above, do remember to adjust the table and column names and run each statement as a complete statement.
You might also want to set a specific coordinate system before extracting the coordinates.

Peter Horsbøll Møller
Pitney Bowes Software

Reply all
Reply to author
Forward
0 new messages