# File lib/geo_ruby/simple_features/polygon.rb, line 21
      def bounding_box
        unless with_z
          @rings[0].bounding_box
        else
          result = @rings[0].bounding_box #valid for x and y

          max_z, min_z = result[1].z, result[0].z
          1.upto(size - 1) do |index|
            bbox = @rings[index].bounding_box
            sw = bbox[0]
            ne = bbox[1]
            max_z = ne.z if ne.z > max_z
            min_z = sw.z if sw.z < min_z 
          end
          result[1].z, result[0].z = max_z, min_z
          result
        end
      end