Polygon.ContainmentTest for Sublists

I am looking to run the Polygon.ContainmentTest for each [ x ] sublist of polygons to a respective [ y ] sublist of Points to test and receive the Indicies of which points lie in which polygon.

Below is a working example when it is just one list and not a multiple number of sublists:

If the List of “Polygons” grows another level:


and the List of “Points” grows another level:

How do I test which [0] Points lie in [0] Rectangles and [1] Points lie in [1] Rectangles?

Not sure is the best way, but you can try something like this:

The node becomes yellow because the list of points have different items, so you may get some null values. But it should work.

Never knew why this worked, just know that it works :stuck_out_tongue: (again, thanks @Vikram_Subbaiah)

1 Like

Thanks @mellouze and I suppose more importantly @Vikram_Subbaiah who led you to the answer.
Also @lucamanzoni I appreciate your answer! Cool to see transpose used for this example.

The use of the code block seems to work as intended! This brings up a few more questions but I’ll probably have to start a new thread for those. Thanks to all who supported!

1 Like