Select to view content in your preferred language

Intersect tool works different than Join/Selection (Intersect)

518
2
05-12-2023 03:40 PM
Scoth
by
New Contributor III

I want to join these two blue polygon attributes to the pink line. If you run the intersection tool, only the attributes from the two blue polygons will get applied to the line fragments, as expected since the pink line doesn't cross the boundary of the third polygon. 

But when you do a spatial join or spatial selection with the "Intersect" option, suddenly it grabs the third polygon.

Scoth_0-1683930157806.png

There are easy workarounds if you just doing a selection. But if you are doing a join, it's not so easy. You can't really choose multiple spatial relationships with a join (i.e. "Within OR Crosses Boundary"). 

I can't use the Intersect tool, because I don't want the lines to get split, and when I try to dissolve them back to the original line shapes the attributes from the polygons get messed up. (The dissolve tool does weird things with attribute aggregation.)

Does anyone else have this issue?

I will probably do multiple joins then figure out how to combine fields, but it seems like it should be much easier than that. This is the type of join I use most often.

 

0 Kudos
2 Replies
DavidPike
MVP Frequent Contributor

Possibly 2 Select by locations using 'Add to selection' then run your join.  I agree it would be nice to stack some spatial relationships.

I also think you should also be able to incorporate AND OR logic into a cursor using SHAPE@ tokens to compare geometries, but it might be too computationally expensive depending on the dataset size.

0 Kudos
Scoth
by
New Contributor III

It doesn't work to use a Selection by Location first, because there are more than just these features. In the real data there are any number of lines and polygons that overlap. There might be a polygon that has the desired relationship with one line (thus getting included in the Select by Location), but it might only touch the endpoint of another line (so I don't want it joined to that line). However, since it was included because of the selection, it will get joined.

Consider the case of this new purple line I just drew. It would cause the large trapezoid to get included in the selection, and thus it would get joined to both lines (with INTERSECTION relationship), when I only want the two highlighted polygons to get joined to the pink line.

Scoth_1-1684964075444.png

 

0 Kudos