Skip to main content
Best Answer

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

  • April 5, 2018
  • 6 replies
  • 55 views

tnarladni
Enthusiast
Forum|alt.badge.img+23

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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

6 replies

fmelizard
Safer
Forum|alt.badge.img+21
  • 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+23
  • Author
  • Enthusiast
  • 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.

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+40
  • 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
Celebrity
  • 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+23
  • Author
  • Enthusiast
  • April 10, 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.

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