/  Find


Applicability:

Ribbon Groups:

Home-Selection

Table-Sort & Filter

Map Window:

Or use Ctrl+F in the Map Window

Associated commands:


Description:

 /  Find finds and selects items.

Keyboard shortcut key is Ctrl+F or F3.

The items can be chosen from the Find dialog using four tabs:

Expression

Filter

Geometry

Spatial Filter

Expression

The drop-down box shows an expression to be applied to items in the SWD.

Select an expression from the drop-down list to apply to items in the SWD or click the fx button to display the Expression Builder dialog:

Enter an expression .... (top pane)

The expression can be evaluated on items. If the expression uses a variable (e.g. _id&), then the property value is fetched from the item under consideration.

The opening and closing parentheses buttons are for finding matching parentheses. Where you have expressions containing several sets of parentheses, this function finds the one which matches the one you have selected.

To find items with an implicit style enter the JSON string (string to find) in the top pane. Double quote characters in the string must be "escaped", for example if searching for the following Pen string:

{"Pen":{"Style":"DashDot","Colour":{"RGBA":[0,255,255,0]},"Width":1000}}

the string to be entered in the top pane must be:

_pen$="{\"Pen\":{\"Style\":\"DashDot\",\"Colour\":{\"RGBA\":[0,255,255,0]},\"Width\":1000}}"

alternatively single quotes can be used around the string:

_pen$='{\"Pen\":{\"Style\":\"DashDot\",\"Colour\":{\"RGBA\":[0,255,255,0]},\"Width\":1000}}'

Note: The following is list of the operations available from the Expression Builder dialog. For full details of these operations see Property Expression Syntax.

Expression operations

Values

Select an expression from Expression operations > Values, in either Built-in properties, Schema columns, Attributes or Literals groups. Select the required expression value in the right-hand pane. Click Insert to add the value to the top pane and add the appropriate values to create an expression. Click Append and Replace to append further values or replace an existing value in the top pane.

For example creating the expression _area#>500 would select only the items with an area greater than 500.

Comparisons   

The Comparison operators are fully described in the Property Expression Syntax topic.

And - Logical And operator, e.g. '_bSimple& And _bClosed&. 

Between - Tests whether a value is between two other values, e.g. 'Value# Between 0 And maximum Value#. 

Choose - Selects and returns a value from a list of arguments.

Equal To - Are two values equal, e.g. 'value#=1.234'?

NotEqual To - Are two values different, e.g. 'value#<>1.234'?

Less Than or Equal To - Is one value less than or equal to another, e.g. 'value#<=1.234'?

Less Than - Is one value less than another, e.g. 'value#<1.234'?

Greater Than or Equal To - Is one value greater than or equal to another, e.g. 'value#>=1.234'?

Greater Than - Is one value greater than another, e.g. 'value#>1.234'?

Coalesce - Calculate difference between two overlays

Iif - Returns one of two parts, depending on the evaluation of a Boolean expression. the Iif statement allows the return to be non-Boolean values (e.g. A String value) from a Boolean expression.

In - Tests whether a value is a member of a set of values.

IsNotNull - Tests whether a mnemonic or expression is not Null, e.g. 'value@ Is Not Null'

IsNull - Tests whether a mnemonic or expression is Null, e.g. 'value@ Is Null'

Like - Matches a string using a regular expression

Not - Logical Not operator

Or - Logical Or operator

Switch - Selects and returns a value from a list of possible values

Not - Logical Not operator

Operators

Bitwise And - Bitwise And operator

Bitwise not - Bitwise Not operator, e.g. 'Not _bSimple&'

Bitwise Or - Bitwise Or operator, e.g. '_bSimple& Or _bClosed&'

Divide - Divide one numerical value by another, e.g. '1.234/10' or '_area#/length#'

Get Property - Gets a property value from an item

Subtract - Subtract one value from another, e.g. '1.234-5.678' or '_ox#-_sx#'

Modulus - Gets the remainder of division of one numerical value by another

Add - Add two values together, e.g. '1.234+5.678' or '_ox#+_sx#'

Raise to the Power - Raises a value, or a property representing a number, by a power, e.g. '1.234^5' or '_length#^2'

Multiply - Multiply two values together , e.g. '1.234*5.678' or '_area#*_sz#'

Functions

Maths

Abs - Gets the absolute value of a number, or a property representing a number, e.g. 'Abs(-1.234)', or 'Abs)_ox#)'

Acos - Gets the angle, in radians, of a cosine value (the arccosine), e.g. 'Acos(0.785398)' or 'Acos(cosine#)'

Asin - Gets the angle, in radians, of a sine value (the arcsine), e.g. 'Asin(0.785398)' or 'Asin(sine#)'

Atan - Gets the angle, in radians, of a tangent value (the arctangent), in the range -n/2 to n/2, e.g. 'Atan(0.785398)' or 'Atan(tan#)'

Atan2 - Gets the angle, in radians, of the tangent value y/x (the arctangent), in the range -n to n, e.g. 'Atan2(1.234, 1.234)' or 'Atan2(Y#,X#)'

Chr - Gets a character from an ASCII value, e.g. 'Chr(9)'

Cos - Gets the cosine of an angle specified in radians, e.g. 'Cos(1.5708)' or 'Cos(_angle#)'

Exp - Gets the natural exponent of a number

Fix - Gets the integer portion of a number. If the number is negative Fix will return the first negative number greater than or equal to the given number.

Int - Gets the integer portion of a number. If the number is negative Int will return the first negative number less than or equal to the given number.

Log - Gets the natural logarithm of a number

Log10 - Gets the base-10 logarithm of a number

Max - Gets the larger of two numbers

Min - Gets the smaller of two numbers

Round - Round a fractional value to  an integer, or a given number of decimal places

Sin - Gets the sine of an angle specified in radians, e.g. 'Sin(1.5708)' or 'Sin(_angle#)'

Sqrt - Gets the square root of a number, e.g. 'Sqrt(1.234)' or 'Sqrt(_area#)'

Tan - Gets the tangent value of an angle specified in radians, e.g. 'tan(1.5708)' or 'Tan(_angle#)'

Negative - Subtract one value from another, e.g. '1.234-5.678' or '_ox#-sx#'

Positive - Add two values together, e.g. '1.234+5.678' or '_ox#+sx#'

String   

Bin - Converts a hexadecimal string into an array of bytes, e.g. 'Hex("FFFFFFFF")'

Exists - Does the given property exist on this item?

Find - Find the byte position of a substring within a string

FindW - Find the position of a substring within a string

Format - Format a date number as a string

FormatFlt - Format a floating point number as a string

FormatInt - Format an integer as a string

FormatStr - Format a string

Fuzzy - Compare two strings using a fuzzy comparison

Grep - Search a string using a regular expression

Hex - Returns the hexadecimal representation of an array of bytes

Left - Gets a number of characters from the left of a string using a byte count, e.g. 'Left("Cadcorp",3)' or 'Left(postcode$,4)'

LeftW - Gets a number of characters from the left of a string using a character count, e.g. 'Left("Cadcorp",3)' or 'Left(postcode$,4)'

Len - Gets the length of a string, in bytes, e.g. 'Len("Cadcorp")' or 'Len(name$)'

LenW - Gets the length of a string, in characters, e.g. 'LenW("Cadcorp")' or 'LenW(name$)'

Local - Gets the "local" representation of a number as a string. e.g. "1.000"

Lower - Convert a string to lowercase characters, e.g. 'Lower("Cadcorp") or 'Lower(name$)'

Ltrim - Trim spaces from the start of a string, e.g. 'Ltrim(" Cadcorp ")' or 'Ltrim(name$)'

Mid - Gets a number of characters from the middle of a string using a byte count, e.g. 'Mid("Cadcorp",2,2)' or 'Mid(postcode$,4,1)'

MidW - Gets a number of characters from the middle of a string using a character count, e.g. 'MidW("Cadcorp",2,2)' or 'MidW(postcode$,4,1)'

Right - Gets a number of characters from the right of a string using a byte count, e.g. 'Right("Cadcorp",4)' or 'Right(postcode$,3)'

RightW - Gets a number of characters from the right of a string using a character count, e.g. 'RightW("Cadcorp",4)' or 'RightW(postcode$,3)'

Rtrim - Trim spaces from the end of a string, e.g. 'Rtrim(" Cadcorp ")' or 'Rtrim(name$)'

Sentence - Changes a string to 'sentence case', i.e. it makes the first letter uppercase and the other letters lowercase, e.g. 'Sentence("the quick brown fox")' or 'Sentence(reason_for_change$)'

Str - Gets the string representation of a number

Title - Changes a string to 'title case', i.e. it makes the first letter of each word uppercase, e.g. 'Title("computer aided development corporation ltd")' or 'Title(fullname$)'

Toggle - Toggles the case of each character in a string, i.e. it makes lowercase case characters uppercase and vice versa, e.g. 'Toggle("cADCORP")' or 'Toggle(application_name$)'

Upper - Converts a string to uppercase characters, e.g. 'Upper("Cadcorp")' or 'Upper(name$)'

Val - Gets the numerical value of a string, e.g. 'Val("1.234")' or 'Val(value$)'

VarType - Gets the type of a property, e.g. 'VarType(value@)' 

Date

CvDate - Convert year/month/day and optional hours/minutes/seconds numbers to a date/time number, e.g. 'CvDate(2001,6,29,11,27)'

Date - The date/time number of the current date/time, or of the given date/time as a property or as a literal date string, e.g. 'Date(standard@)' or 'Date("20010629112700")'

Day - Gets the day of the month (in the range 1 to 31) represented by a date/time value, e.g. 'Day(startdate@)'

DayOfWeek - Gets the day of the week in the range 1 to 7, 1=Sunday, 2=Monday, etc.) represented by a date/time value, e.g. 'DayOfWeek(startdate@)' or 'DayOfWeek("20010629112700")'

DayOfYear - Returns the day of the year (in the range 1 to 366, 1st January, 32=1st February, etc.) from a date/time value, e.g. 'DayOfYear(startdate@)' or 'DayOfYear("20010629112700")'

Hour - Gets the hour (in the range 0 to 23) represented by a date/time value, e.g. 'Hour(startdate@)'

Minute - Gets the minute value (in the range 0 to 59) represented by a date/time value, e.g. 'Minute(startdate@)'

Month - Gets the month (1=January, 2=February, etc.) represented by a date/time value, e.g. 'Month(startdate@)'

Now - Returns a date value for the current date and time, e.g. 'Now()'

Second - Gets the second (in the range 0 to 59) represented by a date/time value, e.g. 'Second(startdate@)'

Timespan - Calculates a timespan value from a number of days, hours, minutes and seconds

Year - Gets the year (in the range 100 to 9999) represented by a date/time value, e.g. 'Year(startdate@)'

Spatial

CalcInterior - Perform a mathematical operation on an expression, or a numeric property, of the items on another overlay whose hook points are inside the current item, e.g. 'CalcInterior("Addresses","residents&",1)'

CalcItems - Perform a mathematical operation on a numeric property of the items on another overlay that satisfy a spatial relation with the geometry of the current item, or with a given geometry, e.g. 'CalcItems("Addresses",{income&/1000},OP_Sum.ST_Within.ST_Geometry)"

CalcRaster - Perform a mathematical operation on the grid values of the raster items on another overlay that satisfy a spatial relation with the current item

Extents - Gets the extents of an item as a comma-separated string, e.g. 'Extents()'

FindContainer - Find an item on another overlay that contains the current item

FindInterior - Find an item on another overlay whose hook point is inside the current item

FindItem - Find an item on another overlay that satisfies a spatial test with the current item

FindItemX - Find an item on another overlay that satisfies a spatial test with the current item

GeoJSON - Gets the GeoJSON representation of the geometry of an item, e.g. 'GeoJSON()'

Grid - Gets the value of a Grid item on another overlay at the hook point of the current item

Origin - Gets the origin of an item as a comma-separated string, e.g. 'origin()'

OverlapArea - Gets the area of overlay between an item on another overlay and the current item

Overlay -

ST_AsBinary - Gets the OGC Well-known Binary (WKB) representation of a geometry

ST_AsGeoJSON - Gets the GeoJSON representation of a geometry

ST_AsText - Gets the OGC Well-known Text (WKT) representation of a geometry

ST_Contains - Does one geometry contain another geometry (or the geometry of an item)?

ST_Crosses - Does one geometry cross another geometry (or the geometry of an item)?

ST_Disjoint - Are one geometry and another geometry (or the geometry of an item) disjoint?

ST_Distance - Returns the distance between one geometry and another geometry (or the geometry of an item)?

ST_DWithin - Is one within a distance of another geometry (or the geometry of an item)

ST_Equals - Is one geometry equal to another geometry (or the geometry of an item)?

ST_GeomFromGeoJSON - Creates a geometry from a GeoJSON representation

ST_GeomFromText - Creates a geometry from an OGC Well-Known Text (WKT) representation

ST_GeomFromWKB - Creates a geometry from an OGC Well-Known Binary (WKB) representation

ST_Intersects - Does one geometry intersect another geometry (or the geometry of an item)?

ST_Overlaps - Does one geometry overlap another geometry (or the geometry of an item)?

ST_Relateb - Does one geometry have the given spatial relationship with another geometry (or the geometry of an item)?

ST_Touches - Does one geometry touch another geometry (or the geometry of an item)?

ST_Within - Is one geometry within another geometry (or the geometry of an item)?

Tin - Gets the value of a TIN item on another overlay at the hook point of the current item

WKB - Gets the OGC Well-Known Binary (WKB) representation of the geometry of an item, e.g. 'Wkb()'

WKT - Gets the OGC Well-Known Text (WKT) representation of the geometry of an item, e.g. 'Wkt()'

Scope

dts - Gets a property from a Dataset

Geometry - Gets a property from the Geometry of an Item, e.g. 'Geometry.Length'

Join - Gets a property from a column in a joined Table

swd - Gets a property from an SWD

this - Gets a property from an item

Click OK to return to the Find dialog.

Back to top of page

Filter

Find items that ...

pass

Selects items that pass the filter.

fail

Selects items that fail the filter.

...the filter...

Select the drop-down box and choose the required filter.

If you wish to create your own filter select a filter of the appropriate type and click the arrow to the right of the filter at the bottom of the drop down box and make the required changes in the subsequently displayed dialog. The next Filter dialog to be displayed will depend on the type of filter selected, these are Class FilterCompound FilterFeature Filter and Property Filter.

Class Filter

Select a Class Filter, in this example Class Filter.Line is selected, to display the Class Filter dialog. The LineString button will be initially selected (this can be changed):

To view all the items, click on the horizontal non-filled arrow symbol next to each item. It will change to a filled arrow rotated 45 degrees clockwise and the structure of the filter will be revealed.

To include items, either click the circular button(s) so they are black, or select them one at a time and click Include. To exclude items, click the circular button so that it is white, or select them one at a time and click Exclude.

If the filter test parameters are changed the ... the filter ... box will show Class Filter (unnamed):

Compound Filter

Select a Compound Filter and click the bottom right arrow to display the Compound Filter dialog:

First filter

The first filter to combine. Select the filter from the drop-down box and click the bottom right arrow to display the Class Filter dialog to allow the required first filter settings to be made.

Second filter

The second filter to combine. Select the filter from the drop-down box and click the bottom right arrow to display the Class Filter dialog to allow the required second filter settings to be made.

Combination: (items must pass...)

AND - Combined filter will allow items that pass both filters.

OR - Combined filter will allow items that pass at least one of the filters.

XOR - Combined filter will allow items that pass exactly one of the filters.

DIFF - Combined filter will allow items that pass the first filter, but that do not pass the second filter. if you do not select a first filter, then this has the effect of inverting the second filter

Feature Filter

Select a Feature Filter and click the bottom right arrow to display the Feature Filter dialog All Items will be initially selected (this can be changed):

To view all the items, click on the horizontal non-filled arrow symbol next to each item. It will change to a filled arrow rotated 45 degrees clockwise and the structure of the filter will be revealed.

To include items, either click the circular button(s) so they are black, or select them one at a time and click Include. To exclude items, click the circular button so that it is white or select them and click Exclude.

If the filter test parameters are changed the ... the filter ... box will show Feature Filter (unnamed):

Property Filter

Select a Property Filter and click the bottom right arrow to display the Expression Builder dialog.

In the Expression Builder top pane enter the required filter expression, for example _area#>1000.

Click OK to return to the Find dialog:

Enter a name for this filter in the Save filter as text box, for example AreasGreaterThan1000.

Click Save Now and click OK.

This filter will now be saved in the current library and will be available from the ...the filter ... drop-down box.

   

Back to top of page

Geometry

      The currently selected item(s) must...

Check this tickbox if the only items that pass a geometrical test are to be selected.

The tests use the OGC "relate" function. This measures the dimensions of the nine intersections formed between the  interior boundary and exterior of the two items being compared. The different tests have different rules for which dimension matrices are valid.

      all...

Check this tickbox if all the selected items have to pass the test, or uncheck if any one will be enough.

      The tests are as follows:

      contain

Their interior is completely inside the selected item.

      be disjoint from

They are completely separate from the selected item, and their boundaries do not touch.

      intersect

If they have a point in common with the selected item (they must not be disjoint).

      cross

LineString items will be found if they intersect the selected item without being tangential.

Other items will be found if their interior intersects with the interior of the selected item, and the selected item goes outside the found item.

      be equal to

If their geometry is the same as that of the selected item.

      overlap

If the selected item is a LineString item, another LineString item will be found only if the two LineString items are tangential, and if neither contains the other.

With other item classes, an item will be found only if its interior intersects with that of the selected item, and neither contains the other.

      touch

If its interior is disjoint from that of the selected item, and if their boundaries intersect.

      be within

If the interior of the selected item falls completely within it.

      be crossed by

LineString items will be found if they intersect the selected item without being tangential.

Other items will be found if their interior intersects with the interior of the selected item, and the found item goes outside the selected item.

      ...the...    of the found items

      origin

Tests the origin of each SWD item against the current item(s). This lets you speed up the test.

      extents

Tests the origin of each SWD item against the current item(s). This lets you speed up the test for complex items. An item’s extents are considered to be a notional rectangle drawn to encompass the item. This rectangle is as small as possible, but still contains the entire item.

      geometry

Does a full geometry test. This is the slowest, but most accurate mode.

Back to top of page

Spatial Filter

A Spatial Filter is a named object that uses Geometry Tests to decide whether or not an Item passes or fails the spatial filter.

An example of the use of a spatial filter could be to identify which houses lie within an electoral district. A spatial filter object is the spatial equivalent of a Filter object.

Find items that are ...

    inside

Select items inside the spatial filter.

    outside

Select items outside the spatial filter.

    ...the spatial filter...

This is the named spatial filter to use for testing items in the SWD.

The ... the spatial filter ... drop-down box will show available spatial filters.

To edit an existing spatial filter click on the right-hand arrow at the bottom of the ... the spatial filter ... drop-down list to display the Spatial Filter dialog, for example:

The Test to apply and Component of item to test drop-down boxes show the geometrical test that the spatial filter will use and the geometry component that the spatial filter will compare against as described above for the Geometry tab. The spatial test parameters may be set or changed here as follows:

Test to apply - The spatial tests that can be applied:

  • Contain - retains those items which are contained by the spatial filter.
  • Cross - retains those items which are crossed by the spatial filter as well as those contained by the spatial filter.
  • Cross by - retains those items which are crossed by the spatial filter but not those contained by the spatial filter.
  • Disjoint - retains those items which are not crossed by the spatial filter or those contained by the spatial filter.
  • Equal - retains only those items which are equal to the spatial filter in area and location.
  • Intersect - retains those items which intersect the spatial filter.
  • Overlap - retains those items which overlap the spatial filter.
  • Touch - retains those items which touch the spatial filter but do not overlap.
  • Within - retains those items which are wholly within the spatial filter.

For full details see Geometry Tests.

Component of item to test - The drop-down box allows you to select the geometry component that the Spatial Filter will compare against - their Extents, their Geometry, or their Origin.

A picture of the spatial filter is shown in the square pane of the Spatial Filter dialog with its dimensions shown below it.

After making any changes click OK to return to the Find dialog

If the spatial filter has been changed the ... the spatial filter ... box will show Spatial Test (unnamed):

Enter a name for the changed spatial filter in the Save spatial filter as text box.

Click Save Now and click OK.

The spatial filter will now be saved in the current library and will be available from the ...the filter ... drop-down box.

Also see Filter Examples and Spatial testing: Spatial filter.


Top of page AComSelect

Send comments on this topic.

Click to return to www.cadcorp.com

© Copyright 2000-2017 Computer Aided Development Corporation Limited (Cadcorp).