This workspace can be used to automatically tag contour lines. Needed is a set of 'blank' contour lines (i.e. contours without any elevation value or attribute) and one or more helper lines, defining a start elevation, direction of slope and contour interval.
It's very important that the helper lines are placed so that no single contour line intersects more than one helper line (or that one contour line intersects the same helper line more than once).
First, a
SpatialFilter is used to select the contour lines that actually intersect the helper lines. Only those can be tagged.
The start point of the helper line(s) is determined using a
CoordinateFetcher and
2DPointReplacer. Then a
NeighborFinder is used to find out the distance from each contour to the start of the helper line. The contours are then sorted based upon the distance to the start point. This means it's quite important to carefully look at the geometry of the countour lines when placing the helper lines. If the contour geometry is too complex it may be necessary to have multiple helper lines.
Finally, by using a
Counter and
ExpressionEvaluator the elevation of every contour line intersecting the helper line is calculated.