What is the best way to add point to existing LINESTRING in codeless?
Hello Ez,
you can use the Update GEO LineString
block for this purpose
Hi Stan,
That block updates the whole LineString. Is there a way to add just one point to the end of array in LineString?
Hi Ez,
I do not see a codeless block to do what youโre asking for. Would you be interested in a solution that uses code? (it can be embedded into codeless logic)
Regards,
Mark
Hi Mark,
That what I thought. It would be great to have example.
In my case it looks like this: I receive LAT and LON then I need to add that point to existing GEO LineString.
I tried to compose list of points from existing LineString then add point but I couldnโt extract points from LineString. Even If there is way to extract points from LineString then structure becomes bulky. Solution with code then embed to codeless logic sounds better.
Is your existing LineString stored in some codeless variable?
I pull it from DB and yes I can store it in variable.
Hereโs an example:
The Custom Code
block has the following logic:
var linestringPoints = linestring.getPoints();
linestringPoints.push( point );
linestring.setPoints( linestringPoints )
Hereโs the output of the program:
Regards,
Mark
Awesome! Thank you, Mark!