I have a Contours Featureclass, with an interval of 0.2 meters. I wish to select only those Contours, which are at 1 m interval?
I have tried using the following syntax in the 'Select by Attribute' dialog (in ArcMap), but it selects all the contours:
Mod("ELEVATION", 1)=0
What query should I run?
Answer
The simple trick to select only Integer values, is to use the following syntax:
Mod(Round("ELEVATION", 0)*10, 10)=0
This Multiplication by 10, makes all the values Integer, and then we select only those which are multiples of 10.
In case you wish to select Multiples of some other number, just multiply 10 by the interval.
To get contours at 5 m intervals, use:
Mod(Round("ELEVATION",0) * 10, 50)=0
To get contours at 100 m interval use:
Mod(Round("ELEVATION", 0) * 10, 1000)=0
Update
As per Whuber's advice given in the comment below, I have added the rounding function in the query expression.
No comments:
Post a Comment