Scientific Explorations: In-Depth Studies

An In-depth GIS Study: Exploring Selection Modes and Data Filtering in SGIS Desktop!

Published on: 27.09.2023

Facebook
Twitter
LinkedIn
Reddit
Print

When working with GIS data, you’re essentially managing a spatial database, emphasizing the importance of data selection and filtering!

GIS data comprises organized information divided into two primary logical categories: coordinates, which spatially define geometric elements, and attributes, which are linked to each geometric element.

However, these data become significantly more useful with the aid of dedicated GIS software. In the contemporary market, various commercial and open-source software solutions are readily available to facilitate working with GIS data. These tools empower users to harness the full potential of geographical information systems for a wide range of applications.

GIS software provides various essential functionalities when working with data:

  • Loading GIS Files: It allows you to load GIS files, view their graphical content, and access attribute tables for data inspection.
  • Data Selection and Filtering: You can select specific data elements and apply filters to refine your datasets.
  • Data Manipulation: GIS software offers tools for modifying data, enabling versatile data handling.

Unlike CAD software, which primarily focuses on graphics, GIS software treats graphics and attributes equally. When working with GIS data, you’re essentially managing a spatial database, emphasizing the importance of data selection and filtering.

In this text, we will explore the methods of data selection and filtering using SGIS Desktop software.

Selecting and filtering in SGIS Desktop

Our selection and filtering features consistently yield one or more GIS elements, which can be based on either attribute data or geometric elements. In this context, “element” refers to a geometric element within the active layer that is associated with attribute data. These functionalities enhance your ability to work with and manipulate GIS data effectively.

“Filtering” refers to extracting elements from the attribute table that meet specific conditions into a new dataset. This can be achieved in two ways:

  1. By applying filters to attribute data in the “Attributes” format. The filtered dataset appears in the attribute grid, and you can make selections afterward.
  2. Filtering based on label values, allowing both filtering and selection. The resulting dataset is placed in the “Selected Attributes” tree view section of the main form.

On the other hand, “selection” involves marking elements that meet certain criteria or are manually chosen by the user. The dataset of selected elements is found in the “Selected Attributes” tree view section of the main form. These features enhance your ability to efficiently work with GIS data.

If the filtering or selection criteria don’t match any elements, the dataset becomes empty.

1_Selection_menu
Selection modes from the main Menu
2_Graphics_toolbar
Selection tools in the Graphics Toolbar

As you can see in the image, SGIS Desktop provides several ways to select elements.

Selecting Elements by Clicking Graphics

The initial three choices in the Selection menu pertain to user interaction with the graphics. These selection options are accessible both within the Selection menu and as buttons on the Graphics Toolbar.

To select an element from the active layer, you can utilize the “Select” option, available in both the main menu and the Graphics Toolbar. Simply left-click on the desired element. When an element is recognized, it will be added to the dataset. Keep in mind that adding a selected element to the dataset clears it beforehand for your convenience.

The “Add” option is an extension of the “Select” function. When activated, you can click on elements within the active layer, and each identified element will be included in the dataset. It’s important to note that this action does not clear the dataset.

As for the “Polygon” option, it comes into play when a user defines a polygon on the graphical interface. To create a selection polygon, simply left-click on each vertex point and complete it with a right-click. At this moment, all elements located within the polygon area will be selected. This feature can be quite handy for precise selections.

Selections by Area (for Polygon Layer Type)

The ‘Select Polygons with Area Less than’ option allows you to define a threshold value for the surface area. This selection applies to the active layer, and it includes all elements with an area smaller than the specified threshold value in the dataset. The comparison of each element’s area to the threshold value is based on the computed area derived from its coordinates.

The ‘Select Polygons with Area Larger than’ feature provides a way to specify a threshold surface area value. This selection pertains to the active layer and encompasses all elements with an area greater than the specified threshold value within the dataset. The comparison of each element’s area to the threshold value is based on the computed area derived from its coordinates.

Selection by Label Value

In SGIS Desktop, you have the capability to display labels on your graphics. These labels consist of textual values sourced from selected attribute fields. To activate labels, simply check the ‘LABELS’ box and choose the desired attribute field. Depending on the layer type, labels are positioned differently: for polygons, they appear at the centroid; for polylines, at the beginning; and for point layers, at the bottom right relative to the element. This feature enhances your ability to work with labeled data effectively.

The “Select By Label Value” option opens a form where you can input a value for searching. This search is carried out using the values in labels. It populates the dataset with all elements that match the condition of having a label value equal to the entered value. Another way to perform this search is by entering ‘NOT ‘ followed by a comparison value.

The “Select By Part Of Label Value” option also opens a form for entering a value to search. It searches based on label values and populates the dataset with elements that have the entered value within their label value.

In practice, selecting by label value is highly practical and straightforward. For example, when working with a cadastral parcel layer and selecting labels with land use codes, using the F3 shortcut for “Select By Label Value” makes it easy to choose all parcels with a specific land use.

When the dataset isn’t empty, the initially selected element is placed in the center of the graphics, and the complete dataset or all selected elements are displayed in the “Selected Attributes” tree. This feature simplifies the selection process based on label values.

Attribute Filter-Based Selection

This feature applies to the active layer. You can define a filter by inputting specific parameters and then execute the filtering process by clicking OK.

The filter is constructed using a syntax that includes field names from the attribute table and various operators such as equal to, not equal to, less than, less than or equal to, greater than, and greater than or equal to [=, <>, <, <=, >, >=]. You can also use parentheses [(, )] and logical connectors like AND and OR in the filter syntax.

3_ByAttributeFilter
Attribute Filter

After applying the filter, you can see the results right away in the Graphics Window and the Selected Attributes panel:

4_SelectedGraphics1
Selected elements displayed in the Graphics Window panel

It’s worth noting that once you’ve filtered the elements, the status bar in the lower right corner of the main form will display the filter text along with the count of elements in the dataset that match your filter criteria. This provides you with a quick summary of your filtering results.

Selecting Elements by Text File Attribute Values

In SGIS Desktop, you’ll often find yourself working with datasets containing selected elements displayed in the Selected Attributes panel. If you wish to preserve these selected elements, you can easily do so by right-clicking within the panel and selecting the appropriate option from the context menu.

5_Save_ID
Save the ID of the selected elements of a certain layer, as a plain textual file

The ‘Select by Text File Attribute Value’ feature becomes invaluable when you have a text file containing attribute values from a specific attribute field. By selecting a text file using the Open Dialog form, all values are imported and the corresponding elements are automatically selected. The dataset is neatly organized in the Selected Attributes panel, with all the selected elements readily visible in the graphical window. Furthermore, the graphical window centers on the first selected element in the dataset.

This selection method proves incredibly practical, particularly when dealing with specific GIS data. It empowers you to save one or more text files for future selections, streamlining your workflow and enhancing your efficiency

Example: Imagine you have an input file containing a list of cadastral parcel numbers like this:

514

489

492

3472

3461

In SGIS Desktop, you can enhance your selection process by enabling the ‘LABELS’ option and choosing the field that contains these parcel numbers [PARCNO]. When you select the input file, SGIS Desktop performs a selection operation, and the result is displayed as shown below:

6_SelectedGraphics2
Cadastral Parcels selected through filtering and selecting by the PARCNO (Parcel Number) Value

The “Select by Text File with Element ID” option allows you to perform a selection based on IDs from a text file. This is useful when you have a file containing unique IDs assigned to elements in the active layer, and you want to select them.

On the other hand, the “Select by ID” option is designed for selecting a single element specifically by its unique ID number, offering a precise way to choose individual elements.

The "Selection by Another Layer" option!

The “Selection by Another Layer” option allows you to choose a layer from a list. The elements of this selected layer will be the focus of your selection. You also pick a condition layer and a selection mode, which defines a geometric relationship between these two chosen layers.

7_SelectByLayer
Selection By Layer Pop-Up Form
8_SelectionByLayer_mode
Selection By Layer - Available Selection Modes displayed in the List

Here are the available selection modes:

  • Points IN Polygons
  • PolyLines INTERSECT Polygons
  • Polygons INTERSECT Polygons
  • Polygons IN Polygons
  • Points ON Polylines
  • Polylines INTERSECT Polylines
  • DIFFERENCES Polygons – Polygons
  • MATCHING Points
  • MATCHING Polylines
  • MATCHING Polygons

“Points,” “Polylines,” and “Polygons” indicate the type of the selection layer and the condition layer. These selection modes cover a wide range of geometric relationships to cater to your specific selection needs.

Exploring Additional Selection Methods

  1. Select Cover Polygons: This handy tool allows you to select polygons on the active layer, provided that the active layer is of the polygon type. It’s particularly useful when you want to choose polygons that intersect with the combination of two or more other polygons.
  2. Select Geometric Identical Elements: This tool comes in handy when you need to select elements with identical geometry. It will automatically select all identical elements within the layer, excluding the first one. This helps you efficiently manage surplus elements.
  3. Neighboring Polygons: If your active layer consists of polygons and you’ve selected one or more polygons in any way, this tool becomes available. It’s a great way to select all the neighboring polygons of each of the initially selected ones, simplifying your selection process.

Selection-Related Tools

  • Select All: This tool serves to select all elements within the active layer. It’s a handy way to quickly choose everything in the layer.
  • Invert: The Invert tool is quite nifty. It allows you to toggle the selection status of elements in the active layer. Selected becomes unselected, and unselected becomes selected. It’s useful for fine-tuning your selections.
  • Clear: When you want to start fresh and remove all selections, the Clear tool does just that. It wipes the selection list clean.

In addition, when you have a dataset of selected elements in the Selected Attributes tree, you can interact with them individually. Clicking on a specific element in the tree within the graphics window deselects all other elements and chooses only the one you clicked. If you want to select all the elements again, the “Restore” action comes in handy. It selects all elements from the tree or dataset in the graphics window. This can be particularly useful for managing your selections with precision.

Attributes Form - Managing Attributes

To access the Attributes form, you have two options: either go to the View > Attributes menu or simply click on the Attributes icon in the main toolbar.

This form is a powerful tool for handling the attributes of the active layer. It allows you to effortlessly view, filter, select, and modify attribute data. You can make changes to individual field values or update entire fields. Now, let’s delve into how you can effectively filter and select elements using this form.

The Attributes form is comprised of three key elements: a toolbar that grants you access to various functions, a table where you can view and edit attribute values, and a status line that provides essential information updates.

Atributi1
Table of attributes

First 8 Toolbar Buttons - Filtering and Selecting

The toolbar’s initial 8 buttons are designed for filtering and selecting operations. Here’s a breakdown of each function:

 

  • Open / Close Filter Attribute Data: This button serves to toggle the filter editor, which allows you to define filter strings. On the right side of the editor, you’ll find a list of field names and their data types from the attribute table of the active layer. When dealing with string types, remember to enclose the filter string in single quotes. However, for integer and double field types, quotes are not necessary.

 

  • Execute Filter: Clicking this button triggers the execution of the defined filter. Consequently, the displayed table will be adjusted accordingly. After applying the filter, the table will either show elements that meet the specified filter conditions or display all elements if none match the criteria. You can track the outcome of the filtering process in the status line, where it’s presented as ‘Total = 2098 / Filter = 194’. It’s important to note that filtering doesn’t automatically select elements in the graphical dataset; it solely influences the way attribute data is displayed.

 

  • Select All Records: This option is used to select all elements within the graphical dataset. It essentially includes every element in the grid and updates the “Selected Attributes” tree on the main form to reflect this selection.

 

  • Clear Selection List: This function allows you to deselect elements from the list, effectively clearing the tree. However, it’s important to note that the attribute table still contains all elements, and any previously selected elements on the graph will be deselected.

 

  • Select one element / Multi-select elements: By default, this button remains unpressed, indicating that the grid displays the last selection. When pressed in combination with the Ctrl key, it signifies that all selections in the grid are highlighted with a color typically defined by the operating system, often appearing as blue. This feature becomes especially useful when used alongside the “Add To Selection List” function.

 

  • Select One Element: This button serves as a toggle switch. When unpressed (the default state), selecting a layer or element in the grid doesn’t automatically select it. However, when pressed, it enables automatic selection of the clicked element, making it visible both in the tree and the graphical window. This can be handy when you want to focus on specific elements.

 

  • Pan To Element: This action comes into play when you’ve selected an element using the “Select One Element” button, but that element isn’t currently visible in the graphical window due to the large number of elements on the graph. By using this tool, you can reposition and zoom in on the selected element, ensuring it’s centered within the graphical window.

 

  • Add To Selection List: Clicking this button changes the behavior of selecting elements in the grid. With it enabled, each click in the grid adds the selected element to an ongoing selection list. This list is visible in both the tree and the graphical window, allowing you to keep track of all selected elements. It can be particularly useful when you need to work with a specific set of elements within a larger dataset.
Atributi2
Table of attributes displays data about elements

GIS data should be viewed as a spatial database. To that end, SGIS Desktop provides a wide array of tools and methods for searching, filtering, and selecting elements.

Filtering and selecting elements offer you the opportunity to apply additional tools like area summation, copying to new layers, and more. These selections empower you to conduct data analyses effectively.

These functionalities enable you to isolate a subset of elements from the complete layer set without altering the attribute structure. If you ever need to make structural changes, you can do so using Attribute Fields, following specific rules to preserve data in the new structure. This flexibility allows you to efficiently manage and analyze your GIS data.