Solved

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


Badge +9

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? ;)

icon

Best answer by takashi 6 April 2018, 00:46

View original

6 replies

Userlevel 4
Badge +13

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.

Badge +9

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.

 

 

Userlevel 3
Badge +26

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.

Badge +22

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.

Userlevel 2
Badge +17

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.

Badge +9

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.

 

Reply