Two-layer analysis operations

Every two-layer operation run on the same two layers, so the difference between them is the only thing that changes. The shapes below are the operations' own output, computed by the same code the tool runs — not illustrations of it.

The two inputs

The first layer is five Natural Earth countries, each carrying a name and a pop_est. The second is one rectangle called rectangle, carrying a name and a note.

The rectangle is placed deliberately: it contains Ireland completely, cuts the United Kingdom, and never reaches the Netherlands, Belgium or France. So every spatial test below has a visible yes and a visible no in one picture.

first layer: countries
second layer: rectangle
nameeupop_est
United Kingdomno64769452
Irelandyes5011102
Netherlandsyes17084719
Belgiumyes11491346
Franceyes67106161
namenote
rectanglestudy area

Both layers have a name. Where an operation carries both layers' attributes into one table, the second layer's colliding field is suffixed: name from the countries, name_2 from the rectangle. A field that does not collide — note — keeps its own name.

Clip

Keeps the parts of the countries that fall inside the rectangle. One country stays one feature, and only the countries’ own attributes come through.

in: countries + rectangle
out: 2 features

Result attributes: name eu pop_est

nameeupop_est
United Kingdomno64769452
Irelandyes5011102

Erase

The opposite of clip: everything the rectangle covers is cut away. Ireland disappears entirely, because the rectangle contains all of it.

in: countries + rectangle
out: 4 features

Result attributes: name eu pop_est

nameeupop_est
United Kingdomno64769452
Netherlandsyes17084719
Belgiumyes11491346
Franceyes67106161

Intersect

The same geometry as clip, but one feature per overlapping pair — and the rectangle’s attributes travel with it. Its name collides with the countries’ name, so it arrives as name_2.

in: countries + rectangle
out: 2 features

Result attributes: name eu pop_est name_2 note

nameeupop_estname_2note
United Kingdomno64769452rectanglestudy area
Irelandyes5011102rectanglestudy area

Union (overlay)

Every piece of both layers: the overlap, the countries outside the rectangle, and the rectangle outside the countries. part says which of the three a feature is, and a piece with no counterpart has NULL where the other layer’s fields would be.

in: countries + rectangle
out: 7 features

Result attributes: name eu pop_est name_2 note part

nameeupop_estname_2notepart
United Kingdomno64769452rectanglestudy areaboth
Irelandyes5011102rectanglestudy areaboth
United Kingdomno64769452NULLNULLfirst
Netherlandsyes17084719NULLNULLfirst
Belgiumyes11491346NULLNULLfirst
Franceyes67106161NULLNULLfirst
NULLNULLNULLrectanglestudy areasecond

Select by location — touch or overlap

Keeps whole features that touch the rectangle at all. Geometry is untouched — this filters, it does not cut.

in: countries + rectangle
out: 2 features

Result attributes: name eu pop_est

nameeupop_est
United Kingdomno64769452
Irelandyes5011102

Select by location — lie completely inside

Stricter: only Ireland qualifies, because the United Kingdom sticks out of the rectangle.

in: countries + rectangle
out: 1 feature

Result attributes: name eu pop_est

nameeupop_est
Irelandyes5011102

Select by location — do not touch

The negation: the three mainland countries, which the rectangle never reaches.

in: countries + rectangle
out: 3 features

Result attributes: name eu pop_est

nameeupop_est
Netherlandsyes17084719
Belgiumyes11491346
Franceyes67106161

Spatial join — touches or overlaps

Every country keeps its own geometry and gains the rectangle’s attributes where the two meet. Countries that do not meet it keep their geometry and get nothing.

in: countries + rectangle
out: 5 features

Result attributes: name eu pop_est name_2 note

nameeupop_estname_2note
United Kingdomno64769452rectanglestudy area
Irelandyes5011102rectanglestudy area
Netherlandsyes17084719NULLNULL
Belgiumyes11491346NULLNULL
Franceyes67106161NULLNULL

Spatial join — lies inside

Only a country that lies entirely within the rectangle picks up its attributes.

in: countries + rectangle
out: 5 features

Result attributes: name eu pop_est name_2 note

nameeupop_estname_2note
United Kingdomno64769452NULLNULL
Irelandyes5011102rectanglestudy area
Netherlandsyes17084719NULLNULL
Belgiumyes11491346NULLNULL
Franceyes67106161NULLNULL

Spatial join — contains

The mirror image: the country would have to contain the rectangle. None does, so nothing is matched — the same layer back, with empty columns.

in: countries + rectangle
out: 5 features

Result attributes: name eu pop_est name_2 note

nameeupop_estname_2note
United Kingdomno64769452NULLNULL
Irelandyes5011102NULLNULL
Netherlandsyes17084719NULLNULL
Belgiumyes11491346NULLNULL
Franceyes67106161NULLNULL