2

I have a shapefile containing parcel data for multiple counties, and I'm trying to narrow this dataset with the following conditions:

1.) Identify owners with contiguous parcels AND 2.) Exclude owners that may have contiguous parcels, but may also have parcels that are not contiguous.

I followed this question and found it extremely helpful How to only select contiguous parcels that have same ownership (QGIS)

which gives the following select by expression formula:

array_contains (overlay_touches (@layer, name, limit:=-1), name)

I was able to select those owners with contiguous parcels, but now I want to narrow the results further to only owners with contiguous parcels and no other parcels. For example, if John Doe is in my table and owns 5 parcels, and 3 are touching (those three are selected under the current expression), I want to remove John Doe from my table completely.

2 Answers 2

1

Collect all geometries with the same name, buffer them by 0 (to dissolve), then check if the result is multipart. To do so, use this expression:

not is_multipart( 
    buffer (
        with_variable (
            'nm',
            name,
            collect( $geometry, filter:=name=@nm)
        ),0
    )
)

enter image description here

0
  1. Run Menu Processing > Toolbox > Aggregate and select the owner field for Group by expression.

  2. Run the expression not is_multipart( $geometry) on the aggregated layer.

10
  • Thanks for your response - I could not get the multipart_buffer with_variable code below to run on my computer, however, I was able to follow your suggestions for aggregating the layer. However, when I attempt the ` not is_multipart ($geometry)` on the aggregated layer, QGIS says that no features were selected. I don't get any error message beyond that. Oct 18, 2023 at 21:28
  • Replace name with the name of your owner field.
    – Babel
    Oct 18, 2023 at 21:29
  • Gotcha, I tried that, but still get the eternal spin. Oct 18, 2023 at 21:31
  • Probably too many data, QGIS repeats this for every feature. Stick to this solution here using aggregate
    – Babel
    Oct 18, 2023 at 21:56
  • Any idea why the expression: not is_multipart($geometry) would return 0 features on the aggregated layer? Oct 19, 2023 at 13:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.