Solved

create station points


Badge +6
Hi All,

 

 

simple Questionhow can I create station points in FME?

 

i have a line object (shape and in one attribute the measure length)

 

and i want create station points every 100m (for example) which have an attribute with measurement (for example 100....200......300 and so on)

 

 

Thank you

 

Franco
icon

Best answer by takashi 5 March 2014, 14:53

View original

11 replies

Userlevel 2
Badge +17
Hi Franco,

 

 

I think the DistanceMarker_2013 from FME Store is suitable to do that.

 

 

Takashi
Badge +6

Thanky ou very much,

 

 

so i can create the points, but which transformer helps me to put the measure (e.g.100m, 200m, 300m,...) as an attribute on teh points?

 

 

Greetz

 

Franco
Userlevel 2
Badge +17
According to the definition of the transformer, the points will be output in the order from start side of the original line. So you can add sequencial number (0, 1, 2 ...) to the points with the Counter.

 

For example, if the interval is 100m, you can then calculate the measure value by multiplying the sequential number by 100.

 

 

If there are multiple lines to be processed, specify unique ID attribute of lines to Counter Name parameter of the Counter, so that the sequential numbers will be grouped by lines. If there is not ID, consider using another Counter to add temporary ID to each line.

 

 

Of course you can create your own workflow to create interval points. That will be an interesting challenge.
Userlevel 2
Badge +17
Another approach.

 

Maybe the Cloner and Snipper can be used to create equal interval points along a line.

 

-----

 

1) Calculate number of required points (ExpressionEvaluator or AttributeCreator).

 

number of points = int(line length / specified interval) + 1

 

Length of the line can be calculated with the LengthCalculator or @Length function.

 

 

2) Copy the line by the number of points (Cloner).

 

Copy Number Attribute (named "_copynum" by default) will be 0-based sequential number.

 

 

3) Calculate measurement (distance to resultant point from start of the line).

 

_measure = _copynum * specified interval

 

 

4) Transform the line into a point (Snipper).

 

Snipping Mode: Distance (Value)

 

Start Location: _measure

 

End Location: _measure

 

The Snipper transforms a line into a point if End Location is equal to Start Location.

 

-----

 

 

There are several ways to do that. Cloner + Snipper is one of them.
Badge +6

Hi Takashi,

this issue is now actual again.

 

i've worked with the Distance Maker, Length Calculator to get station points...that works perfectly

 

BUT:

 

i want the measures from the points as an attribute (Measureextractor)...

 

works also fine

 

BUT:

 

the end point of the line has the wrong measure.

 

 

for example: i have a line with a length 18369,67 meters

 

every 100 meters i have station points

so the ponit before last point has measure 18300 .....thats right

 

the end point of the line has measure 18400......thas false!!!!!!

 

 

so is there a way to bring the right measure (maybe the length from the line) in the attribute from the end point of the line?

 

 

Thanx

 

Franco
Userlevel 2
Badge +17

Hi @franco69, dear old subject :-)

Later I've published a custom transformer called LineDivider in the FME Store. This transformer can propagate measure dimension from the input line to the output lines and points. Try this.

  1. Add measure to the input line with the MeasureGenerator.
  2. Divide the line with the LineDivider.
  3. Extract measure from the output points with the MeasureExtractor.
Badge +3

Thanks Takashi

Badge
According to the definition of the transformer, the points will be output in the order from start side of the original line. So you can add sequencial number (0, 1, 2 ...) to the points with the Counter.

 

For example, if the interval is 100m, you can then calculate the measure value by multiplying the sequential number by 100.

 

 

If there are multiple lines to be processed, specify unique ID attribute of lines to Counter Name parameter of the Counter, so that the sequential numbers will be grouped by lines. If there is not ID, consider using another Counter to add temporary ID to each line.

 

 

Of course you can create your own workflow to create interval points. That will be an interesting challenge.
Hi, what if the line got a measure start value not set to 0?

 

For example, a line with

 

start m-val = 341.3456 metre

 

end m-val = 1468.356 metre

 

and want to mark every 100 or 500 interval. How could this be done?

 

 

thanks andre

 

 

 

Userlevel 2
Badge +17
Hi, what if the line got a measure start value not set to 0?

 

For example, a line with

 

start m-val = 341.3456 metre

 

end m-val = 1468.356 metre

 

and want to mark every 100 or 500 interval. How could this be done?

 

 

thanks andre

 

 

 

Hi @andre, the LineDivider from FME Hub always divides the input line based on the length measured from the start node, regardless what value its m-value starts from.

 

Userlevel 2
Badge +17
Hi, what if the line got a measure start value not set to 0?

 

For example, a line with

 

start m-val = 341.3456 metre

 

end m-val = 1468.356 metre

 

and want to mark every 100 or 500 interval. How could this be done?

 

 

thanks andre

 

 

 

The LineDivider computes length based on coordinates of vertices, regardless of how m-value is set to the line. Therefore, if the length of the line was not exactly equal to the difference of measure values between start and end, it may not generate your desired result.

 

If you need to get the point whose m-value is exactly match 842.500, the Snipper transformer might help you.

 

  • Snipping Mode: Measure (Value)
  • Starting Location: 842.500
  • Ending Location: 842.500

 

Badge
The LineDivider computes length based on coordinates of vertices, regardless of how m-value is set to the line. Therefore, if the length of the line was not exactly equal to the difference of measure values between start and end, it may not generate your desired result.

 

If you need to get the point whose m-value is exactly match 842.500, the Snipper transformer might help you.

 

  • Snipping Mode: Measure (Value)
  • Starting Location: 842.500
  • Ending Location: 842.500

 

Hi, yepp this can be used for single measures. Not sure how it can be done for every interval value along the whole line.. but i might have an idea..

 

regards

 

andre

 

 

Reply