Solved

Draw perpendicular Lines at Specific Distances


Badge

Hi everyone, I have a large table of points (example) and a straight polyline file. I need to start from Zero metres and travel along Distance (metres) and draw perpendicular lines (negative is left) on either side for Offset (metres)

IDDistanceOffset123-12123956356210473-34

The result should look like this

I tried 2D Vector Generator developed by @takashi but so far I have got only the following

This Line layer has 5 segments has two columns. Only first segment (Start 0 End 1) has worked

The other 4 segments failed with the following error.

StartEnd_failure_reason 23

start index is out of range

IDStartEndA01B12C23D34E45

Anyone can help me please? Thanks in advance.

icon

Best answer by takashi 17 March 2016, 06:43

View original

12 replies

Userlevel 2
Badge +17

Hi @thiru, thanks for using the 2DVectorCalculator. How about this?

Badge

Hi @thiru, thanks for using the 2DVectorCalculator. How about this?

Thank you very much @takashi.

Do I need to divide the original straight line before the featuremerger?

This is the result that I got so far. It's a Friday here, I must be missing something in my brain. Have a good weekend, @takashi

Userlevel 2
Badge +17

@thiru, why do you think that you might need to divide the line? In my workspace example, I assumed that the input is just a single straight line, and every "Distance" is measured from the start node (Distance = 0). If the actual data condition is different, naturally different workflow would be necessary. Please clarify the actual condition including the definition of each column - "ID", "Object", "Distance".

Badge

@thiru, why do you think that you might need to divide the line? In my workspace example, I assumed that the input is just a single straight line, and every "Distance" is measured from the start node (Distance = 0). If the actual data condition is different, naturally different workflow would be necessary. Please clarify the actual condition including the definition of each column - "ID", "Object", "Distance".

Thanks @takashi for responding to my request.

Here's my workspace 2dvectorgen.fmw I can specify the start and end coordinates and use Creator to generate the line layer. What do I use in FeatureMerger where it asks "Join On"

I was using an existing line layer to feed to requestor. I got confused on using FeatureMerger join on.

ID is a row-id that I have added to sort them from 1 to n

Object is what it is

Distance starting from one end of the line (length = 0)

I do not need to divide the line layer. If I can measure the Distance and mark the Offset lines, that's all is required. Thanks once again.

Userlevel 2
Badge +17

@thiru, why do you think that you might need to divide the line? In my workspace example, I assumed that the input is just a single straight line, and every "Distance" is measured from the start node (Distance = 0). If the actual data condition is different, naturally different workflow would be necessary. Please clarify the actual condition including the definition of each column - "ID", "Object", "Distance".

@thiru, you can merge every Supplier to each Requestor feature unconditionally with setting an identical constant value (e.g. 1) to the Join On parameter. For example:

Badge

@thiru, you can merge every Supplier to each Requestor feature unconditionally with setting an identical constant value (e.g. 1) to the Join On parameter. For example:

Hi @takashi ok, I now end up with "the number of coordinates is less than 2" error. No features are being created.

 

_creation_instanceIDObject DistanceOffset _failure_reason

0 1 Fence 66.799999999999997 -107.59999999999999 the number of coordinates is less than 2

02Tree77.799999999999997-172.30000000000001the number of coordinates is less than 2 04Fence126.3-116.3the number of coordinates is less than 2 05Tree198.80000000000001-166the number of coordinates is less than 2 06Tree291.10000000000002-146.5the number of coordinates is less than 2 08Pole375-225.40000000000001the number of coordinates is less than 2

Userlevel 2
Badge +17

Hi @takashi ok, I now end up with "the number of coordinates is less than 2" error. No features are being created.

 

_creation_instanceIDObject DistanceOffset _failure_reason

0 1 Fence 66.799999999999997 -107.59999999999999 the number of coordinates is less than 2

02Tree77.799999999999997-172.30000000000001the number of coordinates is less than 2 04Fence126.3-116.3the number of coordinates is less than 2 05Tree198.80000000000001-166the number of coordinates is less than 2 06Tree291.10000000000002-146.5the number of coordinates is less than 2 08Pole375-225.40000000000001the number of coordinates is less than 2

Connect the Inspector transformer to the FeatureMerger and Snipper and run again, to check if every input feature has a line geometry.

Badge

Connect the Inspector transformer to the FeatureMerger and Snipper and run again, to check if every input feature has a line geometry.

FeatureMerger Merged outputs one record (first row of Excel), no geometry

FeatureMerger Referenced outputs 11 records

Snipper outputs all 11 records, no geometry.

Userlevel 2
Badge +17

Hi @takashi ok, I now end up with "the number of coordinates is less than 2" error. No features are being created.

 

_creation_instanceIDObject DistanceOffset _failure_reason

0 1 Fence 66.799999999999997 -107.59999999999999 the number of coordinates is less than 2

02Tree77.799999999999997-172.30000000000001the number of coordinates is less than 2 04Fence126.3-116.3the number of coordinates is less than 2 05Tree198.80000000000001-166the number of coordinates is less than 2 06Tree291.10000000000002-146.5the number of coordinates is less than 2 08Pole375-225.40000000000001the number of coordinates is less than 2

Make sure that the Creator outputs a feature containing line geometry, and the "Feature Merge Type" parameter of the FeatureMerger is set to "Attributes Only".

Badge +3

if you built lists, you might find yourself dumping geometry.

USe a geometryextraxctor prior to merging, if thats the case. And replacer after merging.

Badge

@thiru, why do you think that you might need to divide the line? In my workspace example, I assumed that the input is just a single straight line, and every "Distance" is measured from the start node (Distance = 0). If the actual data condition is different, naturally different workflow would be necessary. Please clarify the actual condition including the definition of each column - "ID", "Object", "Distance".

Success. Your solution has worked @takashi . The Create did not create the geometry because the co-ordinates that typed have vanished. I retyped them again and it works now.

I am so grateful for your guidance. Thanks.

Userlevel 2
Badge +17

Success. Your solution has worked @takashi . The Create did not create the geometry because the co-ordinates that typed have vanished. I retyped them again and it works now.

I am so grateful for your guidance. Thanks.

Good to hear :-)

I forgot that the 2DVectorCalculator can accept a negative value for the Vector Length parameter. If the specified length value is negative, the direction of the resulting line will be reversed. Therefore, you can omit the Tester and one 2DVectorCalculator in the workspace.

Reply