def union(geom = nil)
      if geom
        check_geometry(geom)
        cast_geometry_ptr(FFIGeos.GEOSUnion_r(Geos.current_handle_pointer, ptr, geom.ptr), srid_copy: pick_srid_from_geoms(srid, geom.srid))
      else
        if respond_to?(:unary_union)
          unary_union
        else
          union_cascaded
        end
      end
    end
def union(geom = nil)
      if geom
        check_geometry(geom)
        cast_geometry_ptr(FFIGeos.GEOSUnion_r(Geos.current_handle_pointer, ptr, geom.ptr), srid_copy: pick_srid_from_geoms(srid, geom.srid))
      else
        if respond_to?(:unary_union)
          unary_union
        else
          union_cascaded
        end
      end
    end
Calling without a geom argument is equivalent to calling unary_union when
 using GEOS 3.3+ and is equivalent to calling union_cascaded in older
 versions.