You have a series of Points and want to select a sub-set of Points from that series.
Let us discuss the basics of Query Expression:Query Expression works on linear lists. Query expressions have two required parts:1. Definition of variable 2. Identification of the source list from which the variable is selected.
In a Query Expression, 'from' is the keyword that starts the Query Expression, then we need to add the variable (here we have used 'point' as the variable). After that we need to use the 'in' keyword which will specify the source list, then we will be using the source list (here Point1 is the source list)
If we need to select all the points in a point series, we can do it by using the expression below:from point in Point1
This means the selected points will be all the points in the point list.
To identify the sub-set of points, we will create vertical lines on those selected Points. Here Point1 is the set of points & it begins from left to right. (The same process will also be followed in the below mentioned methods)
If we need to select the first few points in a point series, we can do it by using the expression below: from point in Point1 take 5 That means it will take the first 5 points (Point1[0] to point1[4]). You can select any number of points in the point list. Here we are selecting 5 points.
If we need to select specific points in a point series, we can do it by using the expression below:from point in Point1 skip 5 This means it will skip the first 5 points and take the rest of the points in the list.
If we need to select the points in the middle of a point series, we can do it by the expression below: from point in Point1 take 8 skip 5 That means it will take the points from 5 to 7 (Point1[5] to point1[7]). In this expression the starting of the selection of the point will be of point number 7, as 8 is an argument to the list method and as we have commanded to skip 5 points therefore point 5, point 6 and point 7 will be selected.
Please go through the sample file, Selection of points based on Query Expressions.gct