Skip to main content
I would like to know if there is any process to pick contour of same interval. 

 

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) .

 

 

Hi,

 

 

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
Hi Vijai,

 

 

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
Hi,

 

How about testing for ends with 2,4,6 etc?
Just use the AttributeParity transformer and filter off your even contours:

 

 

http://fmepedia.safe.com/articles/Samples_and_Demos/AttributeParity

 


Hi David,

 

 

Can you send me a snap showing this.

 

Vijai
Hi All,

 

 

Many thanks for your help , i found the answer to my question,  i used the following applications ,

 

ElevationExtractor,SubstringExtractor,AttributeClassifier,ExpressionEvaluator,Tester .

 

 

Vijai Lal

 

 


There you go:

 

 

 


I'm looking to expand on this and select contours at different intervals (1,2,5,10,20,25,50,100,250,500). I'm using AttributeValueMapper.  Would the FMOD function work for this?

Reply