geo-registry

Symmetric Difference

The parts of two layers that are covered by one layer but not both.

Pitfall. Functions that work per pair of geometries need each layer unioned first to compare whole layers.
About this operation
Also called Symmetrical Difference, XOR overlay, exclusive or
Group vector/overlay
Checks crs.agreement, geometry.valid, extent.plausible
Pitfalls 1 listed above
Columbus tool Not stated
Notes Not stated
Status active
Broader Not stated
Narrower Not stated
Related

Parameters

Not stated

Inputs and outputs

Direction Name Type Geometry Note
Input a vector polygon Not stated
Input b vector polygon Not stated
Output output vector polygon Not stated

In each engine

Engine Tool Parameters Differences
apache-sedona sedona.sql.ST_SymDifference
  • a → a
  • b → b
  • Per pair of geometries: union each layer first to compare whole layers.
  • A Spark SQL function: arguments are columns or column names, run over a Spark DataFrame.
gdal gdal vector layer-algebra
  • a → input
  • b → method
  • output → output
None noted
Preset: {"operation":"sym-difference"}
geopandas geopandas.GeoSeries.symmetric_difference
  • b → other
  • Element-wise against another GeoSeries (aligned on the index) or one geometry; geopandas.overlay(how='symmetric_difference') works on whole layers.
grass v.overlay
  • a → ainput
  • b → binput
  • output → output
  • The b input must be areas.
Preset: {"operator":"xor"}
postgis st_symdifference
  • a → geom1
  • b → geom2
  • Per pair of geometries: union each layer first to compare whole layers.
qgis native:symmetricaldifference
  • a → INPUT
  • b → OVERLAY
  • output → OUTPUT
None noted
shapely shapely.symmetric_difference
  • a → a
  • b → b
  • Per pair of geometries: union each layer first to compare whole layers.
whiteboxtools SymmetricalDifference
  • a → input
  • b → overlay
  • output → output
None noted