Can I know the size of integrated Regions in one layer?

Hello,

I want to know the total size of Region geography in one layer in Ruby.

I have small piece of Region::Box. (e.g. | )
and I attach them in horizontal direction to make a strip (e.g. |||||||||||||||||||||||||||||||||||||||||| )
Now, I attach them in vertical direction to make square
(e.g.
||||||||||||||||||||||||||||||||||||||||||
||||||||||||||||||||||||||||||||||||||||||
||||||||||||||||||||||||||||||||||||||||||
||||||||||||||||||||||||||||||||||||||||||
||||||||||||||||||||||||||||||||||||||||||
)

And those are, for example, in layer number 1.

here, what I want to know is that, the total size of the square (i.e. width and height) in layer 1.
I script them in Ruby.

Since the square actually consists of complex cells, it is pretty difficult to calculate by multiplying the number of cells to the width of each cell.

Thank you very much, and really hope there is a way for this.

Comments

  • Hi,

    By "size" you mean "area"?

    You can get the area using "Region#area". This gives you the total area of the (merged) polygons in square database units.

    Matthias

Sign In or Register to comment.