QGIS Algorithm provided by QGIS (native c++) Detect dataset changes (native:detectvectorchanges). Calculates features which are unchanged, added or deleted between two dataset versions. This algorithm compares two vector layers, and determines which features are unchanged, added or deleted between the two. It is designed for comparing two different versions of the same dataset. When comparing features, the original and revised feature geometries will be compared against each other. Depending on the Geometry Comparison Behavior setting, the comparison will either be made using an exact comparison (where geometries must be an exact match for each other, including the order and count of vertices) or a topological comparison only (where geometries are considered equal if all of their component edges overlap. E.g. lines with the same vertex locations but opposite direction will be considered equal by this method). If the topological comparison is selected then any z or m values present in the geometries will not be compared. By default, the algorithm compares all attributes from the original and revised features. If the Attributes to Consider for Match parameter is changed, then only the selected attributes will be compared (e.g. allowing users to ignore a timestamp or ID field which is expected to change between the revisions). If any features in the original or revised layers do not have an associated geometry, then care must be taken to ensure that these features have a unique set of attributes selected for comparison. If this condition is not met, warnings will be raised and the resultant outputs may be misleading. The algorithm outputs three layers, one containing all features which are considered to be unchanged between the revisions, one containing features deleted from the original layer which are not present in the revised layer, and one containing features added to the revised layer which are not present in the original layer.

qgis_detectvectorchanges(
  ORIGINAL = qgisprocess:::qgis_default_value(),
  REVISED = qgisprocess:::qgis_default_value(),
  COMPARE_ATTRIBUTES = qgisprocess:::qgis_default_value(),
  MATCH_TYPE = qgisprocess:::qgis_default_value(),
  UNCHANGED = qgisprocess:::qgis_default_value(),
  ADDED = qgisprocess:::qgis_default_value(),
  DELETED = qgisprocess:::qgis_default_value(),
  ...,
  .complete_output = .complete_output_option(),
  .quiet = .quiet_option(),
  .messages = .message_option()
)

Arguments

ORIGINAL

source - Original layer. Path to a vector layer.

REVISED

source - Revised layer. Path to a vector layer.

COMPARE_ATTRIBUTES

field - Attributes to consider for match (or none to compare geometry only). The name of an existing field. ; delimited list of existing field names.

MATCH_TYPE

enum of ("Exact Match", "Tolerant Match (Topological Equality)") - Geometry comparison behavior. Number of selected option, e.g. '1'. Comma separated list of options, e.g. '1,3'.

UNCHANGED

sink - Unchanged features. Path for new vector layer.

ADDED

sink - Added features. Path for new vector layer.

DELETED

sink - Deleted features. Path for new vector layer.

...

further parameters passed to qgisprocess::qgis_run_algorithm()

.complete_output

logical specifying if complete out of qgisprocess::qgis_run_algorithm() should be used (TRUE) or first output (most likely the main) should read (FALSE). Default value is TRUE.

.quiet

logical specifying if parameter .quiet for qgisprocess::qgis_run_algorithm() Default value is TRUE.

.messages

logical specifying if messages from qgisprocess::qgis_run_algorithm() should be printed (TRUE) or not (FALSE). Default value is FALSE.

Details

Outputs description

  • ADDED - outputVector - Added features

  • ADDED_COUNT - outputNumber - Count of features added in revised layer

  • DELETED - outputVector - Deleted features

  • DELETED_COUNT - outputNumber - Count of features deleted from original layer

  • UNCHANGED - outputVector - Unchanged features

  • UNCHANGED_COUNT - outputNumber - Count of unchanged features