Skip to main content
Solved

I want to use group by in Spatial Relator but I don't have a common attribute


tnarladni
Enthusiast
Forum|alt.badge.img+16

I'm trying to separate many polygon features (+1mil) by another polygon boundary dataset. I'm using the spatial relator and anything with _related_candidate > 0, are exported to a file with the boundary name. It takes about 32 minutes to run. I would like to use the group by parameter and parallel processing to make this go faster except there's not a common attribute between the datasets. Is this a fruitless endeavor? Should I be happy with 32 minutes? ;)

Best answer by takashi

Hi @tnarladni, if you can assume that each polygon is within only a single boundary (i.e. any polygon doesn't intersect two or more boundaries, or you just need to find a single boundary for a polygon even if it intersects multiple boundaries), the SpatialFilter could be faster than the SpatialRelator. For better performance, read the Filter features (boundaries) first and set 'Filters First' to the Filter Type.

View original
Did this help you find an answer to your question?

6 replies

fmelizard
Safer
Forum|alt.badge.img+18
  • Safer
  • April 5, 2018

Hi @tnarladni, is there any way that you can create an attribute to group by? Although creating and assigning an attribute to all of those features might be costly as well.


tnarladni
Enthusiast
Forum|alt.badge.img+16
  • Author
  • Enthusiast
  • April 5, 2018
fmelizard wrote:

Hi @tnarladni, is there any way that you can create an attribute to group by? Although creating and assigning an attribute to all of those features might be costly as well.

I could, except how will I assign a value that are meaningful in both datasets because the only thing they have in common currently is their spatial? like I will have a bunch of polygons in SET A that resides in Boundary 1 of SET B. But I only know that after running them through the SpatialRelator.

 

 


dustin
Influencer
Forum|alt.badge.img+31
  • Influencer
  • April 5, 2018

I might try a DonutBuilder to create two big donut features, merging the attributes. Then use a DonutHoleExtractor to get the original geometry, which should give you the original boundary attributes to separate by. I'm not sure this will be any faster, but you could give a try.


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • April 5, 2018

If there are only a few boundary polygons, you could clone them, and use a modulo counter with the same name on the other dataset, and use that as your group by.

I don't know that it will be that much more efficient, but it could be worth looking into.


takashi
Influencer
  • Best Answer
  • April 5, 2018

Hi @tnarladni, if you can assume that each polygon is within only a single boundary (i.e. any polygon doesn't intersect two or more boundaries, or you just need to find a single boundary for a polygon even if it intersects multiple boundaries), the SpatialFilter could be faster than the SpatialRelator. For better performance, read the Filter features (boundaries) first and set 'Filters First' to the Filter Type.


tnarladni
Enthusiast
Forum|alt.badge.img+16
  • Author
  • Enthusiast
  • April 10, 2018
takashi wrote:

Hi @tnarladni, if you can assume that each polygon is within only a single boundary (i.e. any polygon doesn't intersect two or more boundaries, or you just need to find a single boundary for a polygon even if it intersects multiple boundaries), the SpatialFilter could be faster than the SpatialRelator. For better performance, read the Filter features (boundaries) first and set 'Filters First' to the Filter Type.

Thanks @takashi. I got it down to 17 minutes doing what you suggested.

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings