Method: RGeo::Geos::CAPIGeometryMethods#envelope

Defined in:
ext/geos_c_impl/geometry.c

#envelopeObject



205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'ext/geos_c_impl/geometry.c', line 205

static VALUE
method_geometry_envelope(VALUE self)
{
  VALUE result;
  RGeo_GeometryData* self_data;
  const GEOSGeometry* self_geom;
  GEOSGeometry* envelope;

  result = Qnil;
  self_data = RGEO_GEOMETRY_DATA_PTR(self);
  self_geom = self_data->geom;
  if (self_geom) {
    envelope = GEOSEnvelope(self_geom);
    if (!envelope) {
      envelope = GEOSGeom_createCollection(GEOS_GEOMETRYCOLLECTION, NULL, 0);
    }
    result = rgeo_wrap_geos_geometry(self_data->factory, envelope, Qnil);
  }
  return result;
}