QGIS – Constraint Checker

Marketing
Marketing
  • Updated

By David Crowther

QGIS___Constraint_Checker_-_1.JPG

Question:

How can I quickly run constraint checks within QGIS?

Answer:

The ability to run spatial queries to understand any constraints on your data is a key advantage of GIS software.

Indeed, Cadline have implemented this functionality within our webGIS – MapThat – as our Report Generator tool:

https://www.cadlinecommunity.co.uk/hc/en-us/articles/360018942637-MapThat-Report-Generator-Con29-made-easy-

However, you can also run these queries within QGIS using a plugin called the Constraint Checker.

From the Plugins menu choose > Manage and Install Plugins and search for Constraint.

QGIS___Constraint_Checker_-_2.JPG

Tick and then choose Install Plugin and the Constraint Checker will be added into the Plugins menu.

QGIS___Constraint_Checker_-_3.JPG

Firstly, choose to Edit the the Configuration.

QGIS___Constraint_Checker_-_4.JPG

Choose the source of your spatial data. This will need to be a PostGIS database. Also, ensure that your source datasets and map canvas all have the same SRID so that analysis is accurate e.g. BNG 27700.

In this example we will connect to the Cadline TryDynamicMaps PostGIS database.

QGIS___Constraint_Checker_-_5.JPG

Next, one by one, add in each Constraint. In the first example we will add a Constraint check on our Conservation Areas layer in the PostGIS database.

QGIS___Constraint_Checker_-_6.JPG

Settings are:

  • Constraint – the name of the Constraint e.g., Conservation Area Checking
  • Schema – the Schema in your PostGIS database that has the source table e.g. Public
  • Table – the PostGIS table name e.g. conservation_areas
  • Geometry Column – the geometry column name for the source table e.g. geom
  • Search Distance – apply a search distance to the query e.g. 10 so that the constraint will check if there are any features within a set distance e.g. 10metres
  • Columns for Reporting - choose any number of fields from the source table to add to the output report e.g. name, type etc…

To run the Constraint Checker, you can either select an existing map feature or choose to find any constraints on an area that you draw freehand.

Check Constraints for Freehand Polygon

In the map window draw a polygon for the area that you wish to run the Constraint Checker for, ending the freehand polygon by right clicking.

QGIS___Constraint_Checker_-_7.JPG

Give the Constraint Check a Reference Number e.g. 1.

QGIS___Constraint_Checker_-_8.JPG

When you press OK, the Constraint Checker runs and generates the Constraint Results.

QGIS___Constraint_Checker_-_9.JPG

The results list all the Conservation Areas that intersect the freehand polygon, with a line item for each Conservation Area. The results have been configured so that the Area Name and the Type for the intersected Conservation Area has been exported.

The results of the report can then be exported to a CSV file.

QGIS___Constraint_Checker_-_10.JPG

This time we will add a second environmental constraint check for Open Spaces.

QGIS___Constraint_Checker_-_11.JPG

Note – you can save Constraint Checker settings by exporting the settings to an INI file, which can then be imported again whenever you wish to run the same report.

QGIS___Constraint_Checker_-_12.JPG

Check Constraints for Existing Polygon

This time we will check for any environmental constraints that affect an existing polygon. In the map we have loaded in the Ward boundaries and selected our chosen Ward.

QGIS___Constraint_Checker_-_13.JPG

From the Plugins menu > Choose Constraint Checker > Check for Constraints for Existing Polygon > giving the Report a number.

QGIS___Constraint_Checker_-_14.JPG

When you press OK, the Constraint Checker runs and generates the Constraint Results.

QGIS___Constraint_Checker_-_15.JPG

The result lists all the Conservation Areas and Open Spaces that intersect the chosen Ward boundary, with a line item for each constraint.

Exporting to CSV will then allow you to view the Environmental Constraints within an Excel file.

QGIS___Constraint_Checker_-_16.JPG

The Constraint Checker plugin for QGIS will enable you to run complex spatial analysis against multiple layers in just a few seconds. Using the Export and Import settings you can choose to save and then run any number of Constraint checks e.g. Environmental, Land Charges, Planning etc…. on any of your datasets or chosen geographic boundaries.

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.