ie.) i have a contour file in DGN format of 1m interval (1,2,3,4,5,6,7,8,9,10, etc) from this contour i need to pick only (2,4,6,8,10,12, etc) .
ie.) i have a contour file in DGN format of 1m interval (1,2,3,4,5,6,7,8,9,10, etc) from this contour i need to pick only (2,4,6,8,10,12, etc) .
you could use the modulo operator in the ExpressionEvaluator in conjunction with a tester for this.
In the ExpressionEvaluator, use something like:
@int(@Value(CONTOUR_HEIGHT)) % 2
Then use the Tester to check if the result of the ExpressionEvaluator = 0. The features that pass have a CONTOUR_HEIGHT divisible by 2.
David
This is a kind of programmatic issue. I like it :-)
When both of n and m are positive integer values, "n % m" returns the remainder of n divided by m.
0 % 2 --> 0
1 % 2 --> 1
2 % 2 --> 0
3 % 2 --> 1
and so on.
So you can select contours of the same interval using a Tester transformer with such an expression.
If the contour feature has the elevation value as an attribute named "elevation" and you want to get 2m interval lines, for example, specify the Tester parameter like this:
Left Value: =@Value(elevation)%2 <-- use the Arithmatic Editor to set this.
Operator: =
Right Value: 0
Just be aware that % operator assumes the operands are positive integer values. If the elevation values may be decimal numbers, consider converting them to integer values using AttributeRounder, @int function etc.
Takashi
How about testing for ends with 2,4,6 etc?
http://fmepedia.safe.com/articles/Samples_and_Demos/AttributeParity
Can you send me a snap showing this.
Vijai
Many thanks for your help , i found the answer to my question, i used the following applications ,
ElevationExtractor,SubstringExtractor,AttributeClassifier,ExpressionEvaluator,Tester .
Vijai Lal