I have an abeLayer (geoLayer:NULL) which has certain number of different different rectangles. I want the bBox or any coordinates of those rectangles. I am unable to fetch their coordinates since I cannot apply bBox function on them since its an abeLayer and not any list or array.
How can I access the bBox of the shapes for any abeLayer?
I hope you understand my query well.
There's no direct function to do it, but it's easy enough to write one - see this earlier post.
I dont want all the shapes named in "layerName".
I already have filtered out some of the shapes of my interest in one of the abeLayer.
From that abeLayer I want the shapes and not all the shapes of "layerName".
It's a pretty obvious change to the code to make this do what you want - surprised you couldn't just write your own code based on my example. Simply remove the initialisation and retrieval of the layer from the cellView, and you'd get this:
let((iter tile ollx olly ourx oury)
destructuringBind(((llx lly) (urx ury)) tile->bbox
ollx=if(ollx min(ollx llx) llx)
olly=if(olly min(olly lly) lly)
ourx=if(ourx max(ourx urx) urx)
oury=if(oury max(oury ury) ury)
By looking at your code I realize destructuringBind can also split lists!
I guess I never tried it that way even though it is the behaviour I have been looking for and always achieved it with a second let...
It seems extremely convenient but its quite surprising as it is not at all described in the documentation
I thought destructuringBind was only a macro generating a lambda and applying it to its second argument (I see by expanding it in your case that it is also recursive!?)
Has it always done that or was it implemented in a recent version? (I plan to use it from now on but I don't want to lose backward compatibility with some previous versions)
It's always been supported. I'll file a CCR to get the documentation improved - it's not great right now because it doesn't cover any of that and gives a minimal example. This is kind of the point of the word "destructuring" in the function name!