0

I am currently working on a MapBasic tool that generates start and end coordinates for a polyline layer. So far I have successfully populated 4 columns in a table (SX, EX, SY, EX) with coordinates of start and end nodes. The tool then exports the table as a csv. Now I want to open the exported table (I can do this) then create points based on these 4 columns in mapbasic. How would I go about doing this?

  • Just had a thought, would a for while loop using fetch in each specific column work? – Alan Carr Apr 1 '14 at 9:00
2

Alan

I would recommend that you insert the start and end coordinates as separate rows in your table. In that way you can create points for these individually like explanined below.

I'm assuming that you have already: - created your new table - made this new table mappable - read the coordinates from the polyline into varialbes called fX1, fY1, fX2, fY2

Insert Into NODE_POINTS
   (X, Y, OBJ)
   Values
   (fX1, fY1, CreatePoint(fX1, fY1))
Insert Into NODE_POINTS
   (X, Y, OBJ)
   Values
   (fX2, fY2, CreatePoint(fX2, fY2))

In this way you insert the values into columns called X and Y and at the same time you create a point for each of the start and end points

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.